/* ============================================
   AUTH MODAL - Premium Design v2.0
   Glassmorphism + Catholic Purple/Gold
   ============================================ */

/* ===== OVERLAY ===== */
#auth-modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 0, 30, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: authOverlayIn .25s ease;
}
#auth-modal.active { display: flex; }
@keyframes authOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ===== CARD WRAPPER ===== */
.auth-card {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow:
        0 32px 80px rgba(20, 0, 60, 0.36),
        0 0 0 1px rgba(107, 70, 150, 0.12);
    animation: authCardIn .35s cubic-bezier(.34,1.56,.64,1);
    max-height: 92vh;
    overflow-y: auto;
    scrollbar-width: none;
}
.auth-card::-webkit-scrollbar { display: none; }
@keyframes authCardIn {
    from { opacity: 0; transform: scale(.9) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ===== HERO BANNER ===== */
.auth-banner {
    position: relative;
    background: linear-gradient(135deg, #1e0a3c 0%, #3d2066 45%, #5a2d8a 100%);
    padding: 32px 28px 28px;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 18px;
}
.auth-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 80% 50%, rgba(200,150,60,.18) 0%, transparent 60%),
        radial-gradient(ellipse at 20% 80%, rgba(107,70,150,.3) 0%, transparent 55%);
    pointer-events: none;
}
.auth-banner::after {
    content: '\2721';
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 5rem;
    color: rgba(200,150,60,.15);
    pointer-events: none;
    line-height: 1;
    text-shadow: 0 0 40px rgba(200,150,60,.2);
}

.auth-banner-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(200,150,60,.3), rgba(200,150,60,.1));
    border: 2px solid rgba(200,150,60,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #c8963c;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(200,150,60,.25), 0 0 0 4px rgba(200,150,60,.08);
    position: relative;
    z-index: 1;
}

.auth-banner-copy {
    position: relative;
    z-index: 1;
    min-width: 0;
}
.auth-banner-title {
    font-family: 'Playfair Display', 'Noto Serif', Georgia, serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 5px;
    text-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.auth-banner-subtitle {
    font-size: .78rem;
    color: rgba(255,255,255,.65);
    line-height: 1.5;
}

/* ===== CLOSE BUTTON ===== */
.auth-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.12);
    color: rgba(255,255,255,.8);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
    z-index: 10;
}
.auth-close-btn:hover {
    background: rgba(255,255,255,.22);
    color: #fff;
    transform: scale(1.08);
}

/* ===== BODY ===== */
.auth-body {
    padding: 24px 28px 28px;
}

/* ===== TAB SWITCH ===== */
.auth-tabs {
    display: flex;
    background: rgba(107,70,150,.07);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 22px;
    gap: 0;
}
.auth-tab {
    flex: 1;
    padding: 10px 8px;
    border: none;
    background: transparent;
    border-radius: 9px;
    font-size: .88rem;
    font-weight: 600;
    color: #8a7d9b;
    cursor: pointer;
    transition: all .22s cubic-bezier(.4,0,.2,1);
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.auth-tab.active {
    background: #fff;
    color: #3d2066;
    box-shadow: 0 2px 10px rgba(61,32,102,.14), 0 0 0 1px rgba(107,70,150,.1);
}
.auth-tab:not(.active):hover {
    color: #6b4696;
    background: rgba(107,70,150,.05);
}

/* ===== SOCIAL BUTTONS ===== */
.auth-socials {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}
/* When Facebook is disabled, collapse to 1 column */
.auth-socials:has(.facebook.is-disabled) {
    grid-template-columns: 1fr;
}
.auth-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1.5px solid;
    font-size: .84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .22s ease;
    font-family: inherit;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}
.auth-social-btn:active { transform: scale(.97); }

/* Google */
.auth-social-btn.google {
    background: #fff;
    border-color: rgba(0,0,0,.12);
    color: #3c4043;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.auth-social-btn.google:hover {
    border-color: rgba(66,133,244,.3);
    box-shadow: 0 4px 14px rgba(66,133,244,.15);
    transform: translateY(-1px);
}
/* Facebook — hidden when disabled */
.auth-social-btn.facebook {
    background: #1877f2;
    border-color: #1877f2;
    color: #fff;
    box-shadow: 0 2px 8px rgba(24,119,242,.25);
}
.auth-social-btn.facebook:hover {
    background: #0d65d9;
    box-shadow: 0 4px 14px rgba(24,119,242,.35);
    transform: translateY(-1px);
}
/* Facebook — hidden when disabled, Google — grayed out if disabled */
.auth-social-btn.facebook.is-disabled {
    display: none !important;
}
.auth-social-btn.google.is-disabled {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
}
.auth-social-btn svg { flex-shrink: 0; }

/* ===== DIVIDER ===== */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    color: #b0a0c0;
    font-size: .73rem;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: none;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(107,70,150,.1);
}

/* ===== FORM FIELDS ===== */
.auth-field {
    margin-bottom: 14px;
}
.auth-field-label {
    display: block;
    font-size: .74rem;
    font-weight: 600;
    color: #5a4a6e;
    margin-bottom: 6px;
    letter-spacing: .2px;
}
.auth-field-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.auth-field-icon {
    position: absolute;
    left: 13px;
    color: #8a7d9b;
    font-size: .95rem;
    pointer-events: none;
    z-index: 1;
}
.auth-input {
    width: 100%;
    padding: 11px 14px 11px 38px;
    border-radius: 10px;
    border: 1.5px solid rgba(107,70,150,.18);
    background: rgba(107,70,150,.03);
    color: #2d1b4e;
    font-family: inherit;
    font-size: .88rem;
    transition: all .2s ease;
    outline: none;
}
.auth-input::placeholder { color: rgba(107,70,150,.32); }
.auth-input:focus {
    border-color: #6b4696;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(107,70,150,.12);
}

/* Password toggle */
.auth-pw-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: #8a7d9b;
    font-size: .85rem;
    padding: 4px;
    border-radius: 6px;
    transition: color .18s;
    display: flex;
    align-items: center;
}
.auth-pw-toggle:hover { color: #6b4696; }

/* Password strength */
.auth-pw-strength {
    margin-top: 7px;
    display: none;
    flex-direction: column;
    gap: 4px;
}
.auth-pw-strength.visible { display: flex; }
.auth-pw-bar-wrap {
    display: flex;
    gap: 4px;
}
.auth-pw-bar {
    flex: 1;
    height: 3px;
    border-radius: 3px;
    background: rgba(107,70,150,.1);
    transition: background .25s ease;
}
.auth-pw-bar.weak { background: #ef4444; }
.auth-pw-bar.fair { background: #f59e0b; }
.auth-pw-bar.good { background: #22c55e; }
.auth-pw-label {
    font-size: .7rem;
    color: #8a7d9b;
    font-weight: 500;
}

/* ===== SUBMIT BUTTON ===== */
.auth-submit-btn {
    width: 100%;
    padding: 13px 20px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #3d2066, #6b4696);
    color: #fff;
    font-size: .92rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all .22s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(61,32,102,.3);
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(61,32,102,.4);
}
.auth-submit-btn:active { transform: translateY(0); }
.auth-submit-btn.loading {
    pointer-events: none;
    opacity: .8;
}
.auth-btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authSpin .7s linear infinite;
    display: none;
}
.auth-submit-btn.loading .auth-btn-spinner { display: block; }
.auth-submit-btn.loading .auth-btn-label { opacity: .7; }
@keyframes authSpin { to { transform: rotate(360deg); } }

/* ===== FOOTER LINKS ===== */
.auth-footer {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.auth-link-btn {
    background: none;
    border: none;
    color: #6b4696;
    font-family: inherit;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 0;
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: all .18s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.auth-link-btn:hover {
    text-decoration-color: #6b4696;
    color: #3d2066;
}

/* Provider note — hidden by default, only show if both disabled */
.auth-provider-note {
    display: none !important;
}
.auth-provider-note.visible { display: none !important; }

/* ===== SUCCESS STATE ===== */
.auth-success-wrap {
    text-align: center;
    padding: 20px 10px;
    display: none;
}
.auth-success-wrap.visible { display: block; }
.auth-success-icon {
    font-size: 3.5rem;
    margin-bottom: 14px;
    animation: popIn .5s cubic-bezier(.34,1.56,.64,1);
    display: block;
}
@keyframes popIn {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.auth-success-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.22rem;
    font-weight: 700;
    color: #3d2066;
    margin-bottom: 8px;
}
.auth-success-sub {
    font-size: .84rem;
    color: #5a4a6e;
    line-height: 1.55;
}

/* Field hidden helper */
.auth-field.hidden { display: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    #auth-modal { padding: 0; align-items: flex-end; }
    .auth-card {
        max-width: 100%;
        border-radius: 24px 24px 0 0;
        max-height: 94dvh;
        animation: authCardInMobile .35s cubic-bezier(.22,1,.36,1);
    }
    @keyframes authCardInMobile {
        from { transform: translateY(100%); opacity: .5; }
        to   { transform: translateY(0); opacity: 1; }
    }
    .auth-banner { padding: 26px 20px 22px; gap: 14px; }
    .auth-banner-title { font-size: 1.1rem; }
    .auth-body { padding: 18px 20px 22px; }
    .auth-socials { grid-template-columns: 1fr; }
}
