/**
 * Auth Pages (Login & Signup) - Luma Style
 * Shared styles for authentication pages.
 */

/* ============================================
   PAGE LAYOUT
   ============================================ */
.auth-page {
    --auth-control-height: 44px;
    /* Avoid vertical scroll: page sits below .site-header, so 100vh alone was header + 100vh */
    --auth-header-offset: 56px;
    background: var(--bg-secondary);
    min-height: calc(100vh - var(--auth-header-offset));
    min-height: calc(100dvh - var(--auth-header-offset));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

@media (max-width: 991.98px) {
    .auth-page {
        --auth-header-offset: 50px;
    }
}

/* Stacked layout: title above card (login + signup) */
.auth-page--auth {
    padding: 3.25rem 1rem 2rem;
    display: block;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-container--auth {
    max-width: 440px;
    margin: 0 auto;
}

/* ============================================
   CARD
   ============================================ */
.auth-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2rem;
    border: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

[data-bs-theme="dark"] .auth-card {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.auth-page--auth .auth-card {
    padding: 1.75rem 2rem;
}

/* ============================================
   HEADER
   ============================================ */
.auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-header--above-card {
    text-align: center;
    margin: 0 0 1.25rem;
}

.auth-header--above-card .auth-title {
    margin: 0;
}

.auth-icon-wrapper {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-icon-wrapper--login {
    background: rgba(var(--bs-primary-rgb), 0.1);
}

.auth-icon-wrapper--login svg {
    color: var(--bs-primary);
}

/* Match global page titles: 36px on desktop; mobile overrides below */
h1.auth-title {
    font-size: 36px !important;
    font-weight: 700 !important;
    color: var(--text-primary);
    margin: 0 0 0.375rem 0;
    line-height: 1.35;
}

.auth-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ============================================
   FORM STYLES
   ============================================ */
.auth-form-group {
    margin-bottom: 1rem;
}

.auth-form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.auth-form-input {
    box-sizing: border-box;
    width: 100%;
    height: var(--auth-control-height);
    min-height: var(--auth-control-height);
    padding: 0 1rem;
    font-size: 0.9375rem;
    line-height: 1.25;
    color: var(--text-primary);
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    outline: none;
    transition: all 0.15s ease;
}

[data-bs-theme="dark"] .auth-form-input {
    border: none;
}

/* Chrome/Safari autofill yellow/blue background — keep theme input colors */
.auth-form-input:-webkit-autofill,
.auth-form-input:-webkit-autofill:hover,
.auth-form-input:-webkit-autofill:invalid {
    -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset !important;
    box-shadow: 0 0 0 1000px var(--input-bg) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    caret-color: var(--text-primary);
}

.auth-form-input:-webkit-autofill:focus,
.auth-form-input:-webkit-autofill:focus-visible {
    -webkit-box-shadow:
        0 0 0 1000px var(--input-bg-focus) inset,
        0 2px 8px rgba(0, 0, 0, 0.08),
        0 0 0 0.12rem rgba(var(--bs-primary-rgb), 0.2) !important;
    box-shadow:
        0 0 0 1000px var(--input-bg-focus) inset,
        0 2px 8px rgba(0, 0, 0, 0.08),
        0 0 0 0.12rem rgba(var(--bs-primary-rgb), 0.2) !important;
    -webkit-text-fill-color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .auth-form-input:-webkit-autofill,
[data-bs-theme="dark"] .auth-form-input:-webkit-autofill:hover {
    -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset !important;
    box-shadow: 0 0 0 1000px var(--input-bg) inset !important;
}

[data-bs-theme="dark"] .auth-form-input:-webkit-autofill:focus,
[data-bs-theme="dark"] .auth-form-input:-webkit-autofill:focus-visible {
    -webkit-box-shadow:
        0 0 0 1000px var(--input-bg-focus) inset,
        0 2px 12px rgba(0, 0, 0, 0.35),
        0 0 0 0.12rem rgba(var(--bs-primary-rgb), 0.25) !important;
    box-shadow:
        0 0 0 1000px var(--input-bg-focus) inset,
        0 2px 12px rgba(0, 0, 0, 0.35),
        0 0 0 0.12rem rgba(var(--bs-primary-rgb), 0.25) !important;
}

/* Focus ring: match events index search (events-index-filters-row elevated field) */
.auth-form-input:focus,
.auth-form-input:focus-visible {
    background-color: var(--input-bg-focus);
    color: var(--text-primary);
    border-color: transparent;
    outline: none;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.08),
        0 0 0 0.12rem rgba(var(--bs-primary-rgb), 0.2);
}

[data-bs-theme="dark"] .auth-form-input:focus,
[data-bs-theme="dark"] .auth-form-input:focus-visible {
    border: none;
    outline: none;
    box-shadow:
        0 2px 12px rgba(0, 0, 0, 0.35),
        0 0 0 0.12rem rgba(var(--bs-primary-rgb), 0.25);
}

.auth-form-input::placeholder {
    color: var(--text-tertiary);
}

/* ============================================
   ERROR STYLES
   ============================================ */
.auth-alert {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: var(--error-color, #dc3545);
    padding: 0.875rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.auth-error-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
}

.auth-error-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--error-color, #dc3545);
    margin-top: 0.25rem;
}

.auth-error-item:first-child {
    margin-top: 0;
}

/* ============================================
   SUBMIT BUTTONS
   ============================================ */
.auth-submit-btn {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: var(--auth-control-height);
    height: var(--auth-control-height);
    padding: 0 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.auth-submit-btn--login {
    background: var(--text-primary);
    color: var(--card-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.auth-submit-btn--login:hover,
.auth-submit-btn--login:focus-visible {
    background: var(--text-primary);
    color: var(--card-bg);
    opacity: 0.9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

.auth-page--auth .auth-submit-btn--login {
    margin-bottom: 1.25rem;
}

.auth-submit-btn:hover .auth-btn-icon {
    transform: translateX(4px);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

.auth-btn-icon {
    transition: transform 0.2s ease;
}

/* ============================================
    SOCIAL LOGIN ROW
    ============================================ */
.auth-social-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.auth-social-btn {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.auth-social-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--text-tertiary);
    color: var(--text-primary);
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.auth-social-btn svg {
    transition: color 0.15s ease;
}

/* Brand colors for social icons */
.auth-social-btn[href*="github"] svg {
    color: var(--text-primary);
}

.auth-social-btn[href*="discord"] svg {
    color: var(--text-primary);
}

.auth-social-btn[href*="linkedin"] svg {
    color: #0077B5;
}

/* Override for discord since icon.html uses fill="currentColor" but discord has fill="#7289DA" */
.auth-social-btn[href*="discord"] svg path {
    fill: #7289DA;
}

/* Hover: switch to dark */
/* .auth-social-btn:hover[href*="github"] svg,
.auth-social-btn:hover[href*="discord"] svg,
.auth-social-btn:hover[href*="linkedin"] svg {
    color: var(--text-primary);
} */

/* .auth-social-btn:hover[href*="discord"] svg path {
    fill: var(--text-primary);
} */

.auth-social-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ============================================
    DIVIDER
    ============================================ */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.25rem 0;
    color: var(--text-tertiary);
    font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
    padding: 0 1rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
    padding: 0 1rem;
}

.auth-google-btn {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    min-height: var(--auth-control-height);
    height: var(--auth-control-height);
    padding: 0 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.auth-google-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--text-tertiary);
    color: var(--text-primary);
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.auth-google-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ============================================
    HELP TEXT
    ============================================ */
.auth-help-text {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-top: 0.375rem;
    line-height: 1.5;
}

/* ============================================
   FOOTER
   ============================================ */
.auth-footer {
    text-align: center;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}

.auth-footer-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.auth-footer-link {
    color: var(--bs-primary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
}

.auth-footer-link:hover {
    color: var(--bs-primary);
    text-decoration: underline;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .auth-page {
        --auth-control-height: 40px;
        padding: 1.5rem 1rem;
    }

    .auth-page.auth-page--auth {
        padding: 2.5rem 1rem 1.5rem;
    }

    .auth-card {
        padding: 1.5rem 1.25rem;
    }

    .auth-page--auth .auth-card {
        padding: 1.5rem 1.25rem;
    }

    h1.auth-title {
        font-size: 1rem !important;
        line-height: 1.3;
    }

    .auth-page--auth h1.auth-title {
        font-size: 32px !important;
        line-height: 1.3;
    }

    .auth-icon-wrapper {
        width: 48px;
        height: 48px;
        margin-bottom: 0.875rem;
    }
}
