/**
 * DateforLife — User Authentication Styles (Login & Registration)
 * Luxury Burgundy, Warm Gold & Crisp Contemporary Typography
 */

:root {
    --auth-burgundy-dark: #400811;
    --auth-burgundy: #700010;
    --auth-burgundy-light: #8e0b1c;
    --auth-gold: #dfb96c;
    --auth-gold-dark: #b8862d;
    --auth-gold-light: #fbf5eb;
    --auth-text-dark: #1f1f1f;
    --auth-text-muted: #666666;
    --auth-border: #e6dbd3;
    --auth-input-bg: #fdfaf7;
    --font-title: 'DM Serif Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Ubuntu', sans-serif;
}

.auth-page-wrapper *,
.auth-page-wrapper *::before,
.auth-page-wrapper *::after,
body.auth-body *,
body.auth-body *::before,
body.auth-body *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.auth-page-wrapper {
    min-height: calc(100vh - 160px);
    background: #f7f2ed;
    background-image:
        radial-gradient(at 0% 0%, rgba(223, 185, 108, 0.15) 0px, transparent 55%),
        radial-gradient(at 100% 100%, rgba(112, 0, 16, 0.08) 0px, transparent 55%);
    font-family: var(--font-body);
    color: var(--auth-text-dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: clamp(48px, 6vw, 84px) 16px;
    width: 100%;
}

body.auth-body {
    min-height: 100vh;
    background: #f7f2ed;
    background-image:
        radial-gradient(at 0% 0%, rgba(223, 185, 108, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(112, 0, 16, 0.08) 0px, transparent 50%);
    font-family: var(--font-body);
    color: var(--auth-text-dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
}

.auth-container {
    width: 100%;
    max-width: 1060px;
    background: #ffffff;
    border-radius: 28px;
    box-shadow: 0 20px 60px rgba(64, 8, 17, 0.12), 0 1px 3px rgba(0, 0, 0, 0.05);
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    overflow: hidden;
    border: 1px solid rgba(223, 185, 108, 0.3);
    position: relative;
    margin: 0 auto;
}

/* ==========================================================================
   LEFT: Visual Banner & Atmosphere
   ========================================================================== */
.auth-visual-pane {
    position: relative;
    background-color: var(--auth-burgundy-dark);
    background-size: cover;
    background-position: center center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(36px, 5vw, 54px);
    overflow: hidden;
    color: #ffffff;
}

.auth-visual-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(64, 8, 17, 0.94) 0%,
        rgba(88, 11, 23, 0.88) 45%,
        rgba(112, 0, 16, 0.72) 100%
    );
    z-index: 1;
}

.auth-visual-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.auth-brand-link {
    display: inline-block;
    margin-bottom: 24px;
}

.auth-brand-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}

.auth-visual-hero {
    margin: auto 0;
    padding: 24px 0;
}

.auth-kicker {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    color: var(--auth-gold);
    margin-bottom: 12px;
}

.auth-hero-title {
    font-family: var(--font-title);
    font-size: clamp(30px, 3.2vw, 42px);
    line-height: 1.18;
    color: #ffffff;
    margin-bottom: 16px;
    font-weight: 400;
}

.auth-hero-title span.gold {
    color: var(--auth-gold);
}

.auth-hero-desc {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    max-width: 380px;
    margin-bottom: 24px;
}

.auth-features-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.92);
}

.auth-feature-icon {
    width: 20px;
    height: 20px;
    color: var(--auth-gold);
    flex-shrink: 0;
}

.auth-visual-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.65);
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* ==========================================================================
   RIGHT: Authentication Form Pane
   ========================================================================== */
.auth-form-pane {
    padding: clamp(32px, 5vw, 54px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff;
}

.auth-form-header {
    margin-bottom: 28px;
}

.auth-form-title {
    font-family: var(--font-title);
    font-size: clamp(28px, 3vw, 36px);
    color: var(--auth-burgundy);
    margin-bottom: 8px;
    font-weight: 400;
}

.auth-form-subtitle {
    font-size: 14.5px;
    color: var(--auth-text-muted);
}

.auth-form-subtitle a {
    color: var(--auth-burgundy);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-form-subtitle a:hover {
    color: var(--auth-gold-dark);
    text-decoration: underline;
}

/* Alerts */
.auth-alert {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.45;
    margin-bottom: 22px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.auth-alert-error {
    background-color: #fdf2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.auth-alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.auth-alert-info {
    background-color: #fbf7ef;
    color: #634b2b;
    border: 1px solid #ead8b5;
    border-left: 4px solid #9c6c18;
}

.auth-alert svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Form Groups & Inputs */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.auth-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-label {
    font-size: 13px;
    font-weight: 600;
    color: #333333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: #999999;
    pointer-events: none;
    transition: color 0.2s;
}

.auth-input,
.auth-select {
    width: 100%;
    height: 48px;
    padding: 10px 14px 10px 42px;
    font-size: 14.5px;
    font-family: inherit;
    color: var(--auth-text-dark);
    background-color: var(--auth-input-bg);
    border: 1.5px solid var(--auth-border);
    border-radius: 12px;
    transition: all 0.2s ease;
    outline: none;
}

.auth-input:focus,
.auth-select:focus {
    background-color: #ffffff;
    border-color: var(--auth-burgundy);
    box-shadow: 0 0 0 3px rgba(112, 0, 16, 0.08);
}

.auth-input.is-invalid,
.auth-select.is-invalid {
    border-color: #dc2626;
    background-color: #fff9f9;
}

.auth-input-wrapper:focus-within .auth-input-icon {
    color: var(--auth-burgundy);
}

.auth-input-wrapper:focus-within .auth-toggle-pwd {
    color: var(--auth-burgundy);
}

.auth-input-wrapper:has(.auth-toggle-pwd) .auth-input {
    padding-right: 44px;
}

.auth-toggle-pwd {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #999999;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.auth-toggle-pwd:hover {
    color: var(--auth-burgundy);
}

.auth-toggle-pwd svg {
    width: 18px;
    height: 18px;
}

.auth-field-error {
    font-size: 12px;
    color: #dc2626;
    margin-top: 3px;
}

/* Checkbox & Options */
.auth-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13.5px;
}

.auth-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    color: #444444;
}

.auth-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--auth-burgundy);
    border-radius: 4px;
    cursor: pointer;
}

.auth-forgot-link {
    color: var(--auth-burgundy);
    text-decoration: none;
    font-weight: 500;
}

.auth-forgot-link:hover {
    text-decoration: underline;
    color: var(--auth-gold-dark);
}

/* Submit Button */
.auth-btn-submit {
    height: 50px;
    background: linear-gradient(135deg, var(--auth-burgundy) 0%, var(--auth-burgundy-dark) 100%);
    color: #ffffff;
    border: none;
    border-radius: 9999px;
    font-size: 15.5px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(112, 0, 16, 0.28);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 8px;
}

.auth-btn-submit:hover {
    background: linear-gradient(135deg, var(--auth-burgundy-light) 0%, var(--auth-burgundy) 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(112, 0, 16, 0.36);
}

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

.auth-btn-submit svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

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

.auth-terms-notice {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--auth-text-muted);
    text-align: center;
    margin-top: 4px;
}

.auth-terms-notice a {
    color: var(--auth-burgundy);
    text-decoration: none;
}

.auth-terms-notice a:hover {
    text-decoration: underline;
}

.auth-footer-nav {
    margin-top: 24px;
    text-align: center;
    font-size: 13.5px;
    color: var(--auth-text-muted);
}

.auth-footer-nav a {
    color: var(--auth-burgundy);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer-nav a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   OTP Email Verification Components
   ========================================================================== */
.auth-otp-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin: 10px 0 16px;
}

.auth-otp-inputs {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.auth-otp-digit {
    width: 52px;
    height: 62px;
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    font-family: 'DM Serif Display', Georgia, serif;
    color: var(--auth-burgundy);
    background: var(--auth-input-bg);
    border: 1.5px solid var(--auth-border);
    border-radius: 12px;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.auth-otp-digit:focus {
    border-color: var(--auth-burgundy);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(112, 0, 16, 0.12);
    transform: translateY(-2px);
}

.auth-otp-digit.is-filled {
    border-color: var(--auth-gold-dark);
    background: #ffffff;
}

.auth-otp-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-size: 13.5px;
    color: var(--auth-text-muted);
    padding: 0 4px;
}

.auth-otp-timer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--auth-burgundy);
    background: rgba(112, 0, 16, 0.06);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
}

.auth-otp-timer.expired {
    color: #991b1b;
    background: #fee2e2;
}

.auth-resend-form {
    display: inline;
}

.auth-btn-resend {
    background: none;
    border: none;
    color: var(--auth-burgundy);
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    font-family: inherit;
    transition: color 0.2s;
}

.auth-btn-resend:hover:not(:disabled) {
    color: var(--auth-gold-dark);
}

.auth-btn-resend:disabled {
    color: #a8a29e;
    cursor: not-allowed;
    text-decoration: none;
}

.auth-user-email-badge {
    display: inline-block;
    background: #fbf5eb;
    border: 1px solid rgba(223, 185, 108, 0.45);
    color: var(--auth-burgundy);
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 4px;
    word-break: break-all;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 900px) {
    .auth-container {
        grid-template-columns: 1fr;
        max-width: 520px;
        border-radius: 22px;
    }

    .auth-visual-pane {
        padding: 32px 24px;
        min-height: 240px;
    }

    .auth-features-list,
    .auth-visual-footer {
        display: none;
    }

    .auth-visual-hero {
        padding: 10px 0;
    }

    .auth-hero-title {
        font-size: 26px;
    }

    .auth-hero-desc {
        font-size: 13.5px;
        margin-bottom: 0;
    }

    .auth-form-pane {
        padding: 32px 24px;
    }

    .auth-row-2col {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}
