/* Sign-in modal (login / register / forgot password) + the few auth pages
   that must stay pages (reset password, 2FA code, verify email, reactivate).
   Same brand tokens as account.css: navy → blue, logo yellow. */

html.auth-modal-open { overflow: hidden; }

.auth-modal { align-items: center; padding: 24px 16px; background: rgba(7, 22, 47, .62); backdrop-filter: blur(3px); }
.auth-modal__box {
    position: relative; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    width: 100%; max-width: 900px; margin: auto; overflow: hidden;
    background: #fff; border-radius: 22px; box-shadow: 0 30px 70px -20px rgba(7, 22, 47, .55);
    animation: am-in .22s ease-out; text-align: left;
}
@keyframes am-in { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
.auth-modal__close {
    position: absolute; top: 14px; right: 14px; z-index: 2; width: 36px; height: 36px; display: grid; place-items: center;
    padding: 0; border: 0; border-radius: 50%; background: var(--slate-100, #f1f5f9); color: var(--slate-500, #64748b); font-size: 16px; cursor: pointer;
}
.auth-modal__close:hover { background: var(--slate-200, #e2e8f0); color: var(--navy, #07162f); }

/* Brand panel */
.auth-modal__brand {
    padding: 38px 32px; color: #fff; display: flex; flex-direction: column;
    background:
        radial-gradient(circle at 85% 8%, rgba(96,165,250,.38), transparent 40%),
        radial-gradient(circle at 10% 95%, rgba(16,185,129,.25), transparent 38%),
        linear-gradient(160deg, var(--navy, #07162f), #092c67 58%, var(--blue, #1265d8));
}
.auth-modal__badge {
    width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 24px;
    background: var(--yellow, #fabd01); color: var(--navy, #07162f); box-shadow: 0 0 0 5px rgba(255,255,255,.12); margin-bottom: 22px;
}
.auth-modal__eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--yellow, #fabd01); }
.auth-modal__brand h2 { margin: 0 0 24px; font-size: 25px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.auth-modal__perks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.auth-modal__perks li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: rgba(255,255,255,.82); }
.auth-modal__perks strong { color: #fff; }
.auth-modal__perks i { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 13px;
    background: rgba(255,255,255,.12); color: var(--yellow, #fabd01); }

/* Form side */
.auth-modal__main { padding: 30px 34px 26px; min-width: 0; }
.auth-modal__tabs { display: flex; gap: 4px; padding: 4px; margin: 0 44px 22px 0; border-radius: 12px; background: var(--slate-100, #f1f5f9); }
.auth-modal__tab {
    flex: 1; padding: 9px 12px; border: 0; border-radius: 9px; background: transparent; cursor: pointer;
    font-size: 14px; font-weight: 700; color: var(--slate-500, #64748b); transition: background .15s, color .15s, box-shadow .15s;
}
.auth-modal__tab:hover { color: var(--navy, #07162f); }
.auth-modal[data-pane="login"] [data-auth-tab="login"],
.auth-modal[data-pane="register"] [data-auth-tab="register"] { background: #fff; color: var(--blue, #1265d8); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.auth-modal[data-pane="forgot"] .auth-modal__tabs { display: none; }

.auth-pane { display: none; }
.auth-modal[data-pane="login"] [data-auth-pane="login"],
.auth-modal[data-pane="register"] [data-auth-pane="register"],
.auth-modal[data-pane="forgot"] [data-auth-pane="forgot"] { display: block; }
.auth-pane__title { margin: 0 0 4px; font-size: 22px; font-weight: 800; letter-spacing: -.01em; color: var(--navy, #07162f); }
.auth-pane__sub { margin: 0 0 20px; font-size: 14px; color: var(--slate-500, #64748b); }
.auth-pane__foot { margin: 16px 0 0; text-align: center; font-size: 14px; color: var(--slate-600, #475569); }
.auth-pane__foot--small { margin-top: 6px; font-size: 12.5px; color: var(--slate-500, #64748b); }

/* Fields (shared by the modal and the auth pages) */
.am-form { margin: 0; }
.am-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.am-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.am-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.am-label { margin: 0; font-size: 13px; font-weight: 700; color: var(--slate-700, #334155); }
.am-optional { font-weight: 500; color: var(--slate-500, #64748b); }
.am-input-icon { position: relative; }
.am-input-icon > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--slate-500, #64748b); pointer-events: none; }
.am-input {
    width: 100%; height: 46px; margin: 0; padding: 10px 14px 10px 40px; box-sizing: border-box;
    font-size: 15px; color: var(--navy, #07162f); background: var(--slate-50, #f8fafc);
    border: 1px solid var(--slate-300, #cbd5e1); border-radius: 11px; box-shadow: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.am-input:focus { outline: none; background: #fff; border-color: var(--blue, #1265d8); box-shadow: 0 0 0 3px rgba(18,101,216,.15); }
.am-input--code { padding-left: 14px; text-align: center; letter-spacing: .45em; font-size: 22px; font-weight: 800; height: 54px; }
.am-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; padding: 0; border: 0;
    border-radius: 8px; background: transparent; color: var(--slate-500, #64748b); cursor: pointer; }
.am-eye:hover { color: var(--blue, #1265d8); background: var(--slate-100, #f1f5f9); }
.am-input-icon:has(.am-eye) .am-input { padding-right: 44px; }
.am-error { font-size: 12.5px; font-weight: 600; color: #dc2626; }
.am-help { margin: 0 0 12px; font-size: 12.5px; color: var(--slate-500, #64748b); }
.am-help--tight { margin-top: -6px; }
.am-check { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 9px; margin: 0 0 12px; font-size: 13.5px; font-weight: 500; color: var(--slate-700, #334155); cursor: pointer; }
.am-check input { flex: none; width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--blue, #1265d8); cursor: pointer; }
.am-check > span { flex: 1; min-width: 0; }
.am-check .am-error { flex-basis: 100%; }
.am-check a, .am-link { color: var(--blue, #1265d8); font-weight: 700; text-decoration: none; }
.am-check a:hover, .am-link:hover { text-decoration: underline; color: var(--blue-dark, #0b4fb1); }
.am-link { font-size: 13px; }
.auth-pane__foot .am-link { font-size: inherit; }
.am-back { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 16px; font-size: 13px; font-weight: 700; color: var(--slate-500, #64748b); text-decoration: none; }
.am-back:hover { color: var(--blue, #1265d8); text-decoration: none; }

.am-btn {
    display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; height: 48px; margin: 4px 0 0; padding: 0 18px;
    border: 1px solid transparent; border-radius: 12px; font-size: 15px; font-weight: 750; text-decoration: none; cursor: pointer;
    transition: background .15s, box-shadow .15s, transform .15s;
}
.am-btn:hover { text-decoration: none; transform: translateY(-1px); }
.am-btn--primary { background: var(--blue, #1265d8); color: #fff; box-shadow: 0 10px 20px -12px rgba(18,101,216,.8); }
.am-btn--primary:hover { background: var(--blue-dark, #0b4fb1); color: #fff; }
.am-btn--ghost { background: #fff; color: var(--slate-700, #334155); border-color: var(--slate-300, #cbd5e1); }
.am-btn--ghost:hover { background: var(--slate-50, #f8fafc); color: var(--navy, #07162f); }
.am-btn--social { background: #fff; color: var(--navy, #07162f); border-color: var(--slate-300, #cbd5e1); margin-top: 10px; }
.am-btn--social:hover { background: var(--slate-50, #f8fafc); color: var(--navy, #07162f); }
.am-btn + .am-btn, form + form .am-btn { margin-top: 10px; }
.am-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--slate-500, #64748b); }
.am-divider::before, .am-divider::after { content: ""; flex: 1; border-top: 1px solid var(--slate-200, #e2e8f0); }

.am-callout { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; margin: 0 0 16px; border-radius: 11px; font-size: 13.5px; line-height: 1.45; }
.am-callout i { margin-top: 2px; }
.am-callout--ok { background: var(--green-soft, #e9f9f2); color: #065f46; }
.am-callout--err { background: #fef2f2; color: #991b1b; }
.am-callout--info { background: var(--blue-soft, #eaf2ff); color: #1e3a8a; }
.am-callout--warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ── Standalone auth pages (reset password, 2FA code, verify email, …) ── */
.auth-page {
    min-height: calc(100vh - 120px); display: flex; align-items: center; justify-content: center; padding: 48px 16px;
    background:
        radial-gradient(circle at 85% 8%, rgba(96,165,250,.35), transparent 38%),
        radial-gradient(circle at 10% 92%, rgba(16,185,129,.22), transparent 34%),
        linear-gradient(135deg, var(--navy, #07162f), #092c67 58%, var(--blue, #1265d8));
}
.auth-page__card { width: 100%; max-width: 440px; padding: 34px 32px 28px; background: #fff; border-radius: 22px; box-shadow: 0 30px 70px -24px rgba(0,0,0,.5); }
.auth-page__badge { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 18px; font-size: 22px;
    background: var(--yellow, #fabd01); color: var(--navy, #07162f); }
.auth-page__title { margin: 0 0 6px; font-size: 24px; font-weight: 800; letter-spacing: -.01em; color: var(--navy, #07162f); }
.auth-page__sub { margin: 0 0 22px; font-size: 14px; line-height: 1.5; color: var(--slate-500, #64748b); overflow-wrap: anywhere; }
.auth-page__foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--slate-100, #f1f5f9); text-align: center; font-size: 13.5px; color: var(--slate-500, #64748b); }
.auth-page__foot p { margin: 4px 0; }
.auth-page__foot a { color: var(--blue, #1265d8); font-weight: 700; text-decoration: none; }
.auth-page__foot a:hover { text-decoration: underline; }
.auth-page .am-input:not(.am-input--code) { padding-left: 40px; }

@media (max-width: 767px) {
    .auth-modal { align-items: flex-start; padding: 12px; }
    .auth-modal__box { grid-template-columns: minmax(0, 1fr); border-radius: 18px; }
    .auth-modal__brand { display: none; }
    .auth-modal__main { padding: 22px 18px 20px; }
    .auth-modal__close { top: 12px; right: 12px; }
    .auth-modal__tabs { margin-right: 44px; }
    .am-row { grid-template-columns: minmax(0, 1fr); }
    .auth-page { align-items: flex-start; padding: 24px 12px; }
    .auth-page__card { padding: 26px 20px 22px; border-radius: 18px; }
}
