/* ═══════════════════════════════
   AUTH MODAL — MACCOME Design
   Dark top header + light body card
═══════════════════════════════ */

/* Overlay */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7,10,15,.6);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}
.auth-modal-overlay.active { display: flex; }

/* Modal shell */
.auth-modal {
    background: transparent;   /* let children handle their own bg */
    width: 100%;
    max-width: 440px;
    position: relative;
    border-radius: 2rem;
    /* Remove overflow:hidden — child elements handle their own border-radius
       to avoid webkit subpixel fringe artifacts */
    box-shadow:
        0 40px 100px rgba(7,10,15,.35),
        0 8px 32px rgba(7,10,15,.15);
    animation: authModalIn 0.36s cubic-bezier(0.19, 1, 0.22, 1);
}
@keyframes authModalIn {
    from { opacity: 0; transform: scale(0.95) translateY(16px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

/* ── Header area (dark) ── */
.auth-modal-header {
    position: relative;
    background:
        radial-gradient(ellipse 80% 70% at 50% -10%, rgba(0,89,181,.35) 0%, transparent 65%),
        #070a0f;
    /* Top corners only — matches modal border-radius */
    border-radius: 2rem 2rem 0 0;
    padding: 4rem 2.5rem 1.875rem;
    overflow: hidden;
}

/* Dot grid — contained within header thanks to position:relative above */
.auth-modal-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.055) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
}

/* ── Back & Close buttons ── */
/* Position relative to .auth-modal (position:relative), inside dark header */
.auth-modal-close,
.auth-back-btn {
    position: absolute;
    top: 1rem;
    z-index: 100;
    cursor: pointer;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.22);
    color: #ffffff;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease;
    padding: 0;
    line-height: 0;
}
.auth-modal-close { right: 1.125rem; }
.auth-back-btn    { left: 1.125rem;  }
.auth-modal-close:hover,
.auth-back-btn:hover {
    background: rgba(255,255,255,.26);
}

/* Header text */
.auth-modal-title {
    font-size: 1.625rem;
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.15;
    color: #ffffff;
    margin-bottom: 0.375rem;
    position: relative;
    z-index: 1;
}
.auth-modal-subtitle {
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255,255,255,.4);
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* Logo mark in header */
.auth-modal-header > div[style*="inline-flex"] {
    position: relative;
    z-index: 1;
}

/* ── Body area (light) ── */
.auth-modal-body {
    background: #ffffff;
    /* Bottom corners only — matches modal border-radius */
    border-radius: 0 0 2rem 2rem;
    padding: 1.75rem 2.5rem 2.5rem;
}

/* Form groups */
.auth-form-group { margin-bottom: 1rem; }

.auth-form-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    color: rgba(26,28,29,.38);
}

.auth-form-input {
    width: 100%;
    background: #f3f3f5;
    border: 1.5px solid transparent;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1a1c1d;
    transition: all 0.2s ease;
    outline: none;
    font-family: inherit;
}
.auth-form-input::placeholder { color: rgba(26,28,29,.28); }
.auth-form-input:focus {
    background: #ffffff;
    border-color: rgba(0,89,181,.2);
    box-shadow: 0 0 0 3px rgba(0,89,181,.07);
}

/* Primary button */
.auth-btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #0059b5 0%, #0071e3 100%);
    color: #fff;
    padding: 14px 24px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: .01em;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow .2s ease, transform .15s ease;
    font-family: inherit;
}
.auth-btn-primary:hover {
    box-shadow: 0 8px 28px rgba(0,89,181,.32);
    transform: translateY(-1px);
}
.auth-btn-primary:active { transform: scale(.98); }

/* Alert messages */
.auth-error-message,
.auth-success-message {
    display: none;
    padding: 10px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 1rem;
    border-radius: 10px;
    line-height: 1.5;
}
.auth-error-message   { background: rgba(186,26,26,.07);  color: #ba1a1a; }
.auth-success-message { background: rgba(0,89,181,.07);   color: #0059b5; }
.auth-error-message.active,
.auth-success-message.active { display: block; }

/* OTP code inputs */
.auth-code-inputs {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.auth-code-input {
    width: 100%;
    max-width: 56px;
    height: 60px;
    background: #f3f3f5;
    border: 1.5px solid transparent;
    border-radius: 12px;
    text-align: center;
    font-size: 1.375rem;
    font-weight: 700;
    color: #1a1c1d;
    transition: all 0.2s ease;
    outline: none;
    font-family: inherit;
}
.auth-code-input:focus {
    background: #ffffff;
    border-color: rgba(0,89,181,.22);
    box-shadow: 0 0 0 3px rgba(0,89,181,.07);
}

/* Text button */
.auth-btn-text {
    background: none;
    border: none;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(26,28,29,.35);
    cursor: pointer;
    transition: color .18s;
    padding: 4px 0;
    font-family: inherit;
}
.auth-btn-text:hover { color: #0059b5; }

/* Countdown */
.auth-countdown-text {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(26,28,29,.28);
    display: block;
    margin-top: 8px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.auth-helper-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(26,28,29,.45);
    margin-bottom: 1.25rem;
    line-height: 1.65;
}

/* Step visibility */
.auth-step-content        { display: none; }
.auth-step-content.active { display: block; }
