/* Sign-in pages: login, forgot password, forgot username, reset password */
:root {
    --navy-900: #071a33;
    --navy-800: #0d2a52;
    --navy-700: #143a6e;
    --gold: #f2b93b;
    --gold-deep: #d99a1e;
    --ink: #0f1c2e;
    --muted: #5d6b7e;
    --line: #dfe5ee;
    --field: #f6f8fb;
    --focus: #1f5fbf;
    --danger: #c0392b;
    --radius: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body.auth-body {
    margin: 0;
    font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    color: var(--ink);
    background: #fff;
    -webkit-font-smoothing: antialiased;
}

.auth-shell { display: grid; grid-template-columns: minmax(420px, 46%) 1fr; min-height: 100vh; }
.auth-shell > * { min-width: 0; }
.auth-brand { min-height: 100vh; position: sticky; top: 0; }

/* ---------- Brand panel ---------- */
.auth-brand {
    position: relative; overflow: hidden; color: #fff;
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 44px 56px;
    background: radial-gradient(120% 90% at 0% 0%, #1b4a8a 0%, var(--navy-800) 45%, var(--navy-900) 100%);
}
.auth-grid {
    position: absolute; inset: 0; pointer-events: none; opacity: .14;
    background-image: linear-gradient(rgba(255,255,255,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.35) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(80% 70% at 30% 40%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(80% 70% at 30% 40%, #000 30%, transparent 75%);
}
.auth-orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none; }
.auth-orb-1 { width: 420px; height: 420px; background: #2c6fd1; right: -140px; top: -120px; animation: orb 16s ease-in-out infinite alternate; }
.auth-orb-2 { width: 340px; height: 340px; background: var(--gold-deep); left: -120px; bottom: -140px; opacity: .35; animation: orb 20s ease-in-out infinite alternate-reverse; }
@keyframes orb { from { transform: translate(0, 0) scale(1); } to { transform: translate(-40px, 50px) scale(1.12); } }

.auth-brand-top, .auth-brand-mid, .auth-brand-foot { position: relative; z-index: 1; }
.auth-brand-top { display: flex; align-items: center; gap: 14px; }
.auth-brand-name { font-weight: 800; font-size: 1.35rem; letter-spacing: .01em; line-height: 1.1; }
.auth-brand-sub { font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: rgba(255,255,255,.7); margin-top: 3px; }
.auth-crest { flex: 0 0 auto; filter: drop-shadow(0 6px 14px rgba(0,0,0,.25)); }

.auth-brand-mid { max-width: 500px; }
.auth-kicker {
    display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
    color: var(--gold); background: rgba(242,185,59,.12); border: 1px solid rgba(242,185,59,.35); padding: 6px 12px; border-radius: 999px;
}
.auth-hero { font-size: clamp(2rem, 3.1vw, 2.9rem); font-weight: 800; line-height: 1.12; letter-spacing: -.02em; margin: 22px 0 14px; }
.auth-hero span { color: var(--gold); }
.auth-lead { color: rgba(255,255,255,.78); font-size: 1.02rem; line-height: 1.6; margin: 0 0 26px; }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.auth-points li { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.9); font-weight: 500; }
.auth-points i {
    width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: var(--gold); font-size: .9rem;
}
.auth-brand-foot { font-size: .8rem; color: rgba(255,255,255,.55); }

/* ---------- Form side ---------- */
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 24px 24px; position: relative; background: #fbfcfe; }
.auth-topbar { position: absolute; top: 22px; left: 28px; right: 28px; display: flex; justify-content: space-between; align-items: center; }
.auth-back { color: var(--muted); font-weight: 600; font-size: .9rem; text-decoration: none; display: inline-flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 10px; transition: background .2s, color .2s; }
.auth-back:hover { background: #eef2f8; color: var(--navy-800); text-decoration: none; }
.auth-lang { display: inline-flex; background: #eef2f8; border-radius: 999px; padding: 4px; }
.auth-lang a { font-size: .8rem; font-weight: 700; color: var(--muted); padding: 5px 12px; border-radius: 999px; text-decoration: none; transition: all .2s; }
.auth-lang a.on { background: #fff; color: var(--navy-800); box-shadow: 0 1px 3px rgba(13,42,82,.15); }
.auth-lang a:hover { color: var(--navy-800); text-decoration: none; }

.auth-card { width: 100%; max-width: 410px; animation: rise .6s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.auth-card > * { animation: rise .6s cubic-bezier(.2,.8,.2,1) both; }
.auth-card > *:nth-child(2) { animation-delay: .05s; } .auth-card > *:nth-child(3) { animation-delay: .1s; }
.auth-card > *:nth-child(4) { animation-delay: .15s; } .auth-card > *:nth-child(5) { animation-delay: .2s; } .auth-card > *:nth-child(6) { animation-delay: .25s; }

.auth-mobile-brand { display: none; align-items: center; gap: 10px; font-weight: 800; color: var(--navy-800); margin-bottom: 26px; }
.auth-title { font-size: 1.85rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; color: var(--ink); }
.auth-subtitle { color: var(--muted); margin: 0 0 26px; font-size: .98rem; }

/* Fields */
.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; font-size: .85rem; font-weight: 600; color: #2b3a50; margin-bottom: 7px; }
.auth-input { position: relative; }
.auth-input > i.ico { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #8996a8; font-size: .95rem; pointer-events: none; transition: color .2s; z-index: 2; }
.auth-input input {
    width: 100%; height: 50px; padding: 0 46px 0 44px; font-size: 1rem; font-family: inherit; color: var(--ink);
    background: var(--field); border: 1.5px solid var(--line); border-radius: 12px; outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.auth-input input::placeholder { color: #9aa6b6; }
.auth-input input:hover { border-color: #c9d3e1; }
.auth-input input:focus { background: #fff; border-color: var(--focus); box-shadow: 0 0 0 4px rgba(31,95,191,.12); }
.auth-input:focus-within > i.ico { color: var(--focus); }
.auth-eye {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: transparent;
    color: #7b889b; border-radius: 9px; cursor: pointer; transition: background .2s, color .2s;
}
.auth-eye:hover, .auth-eye:focus-visible { background: #e8eef7; color: var(--navy-800); outline: none; }
.auth-caps { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: #a0640c; margin-top: 7px; }
.auth-caps[hidden] { display: none; }

.auth-row { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 22px; font-size: .88rem; }
.auth-check { display: inline-flex; align-items: center; gap: 8px; color: #3a4a60; cursor: pointer; margin: 0; font-weight: 500; }
.auth-check input { width: 17px; height: 17px; accent-color: var(--navy-700); }
.auth-link { color: var(--focus); font-weight: 600; text-decoration: none; }
.auth-link:hover { color: var(--navy-800); text-decoration: underline; }

.auth-btn {
    position: relative; width: 100%; height: 52px; border: 0; border-radius: 12px; cursor: pointer;
    font-family: inherit; font-size: 1rem; font-weight: 700; letter-spacing: .01em; color: #fff;
    background: linear-gradient(135deg, var(--navy-700), var(--navy-800));
    box-shadow: 0 10px 22px -10px rgba(13,42,82,.65);
    transition: transform .15s, box-shadow .2s, filter .2s;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
.auth-btn:hover { filter: brightness(1.08); box-shadow: 0 14px 26px -10px rgba(13,42,82,.7); }
.auth-btn:active { transform: translateY(1px); }
.auth-btn:focus-visible { outline: 3px solid rgba(242,185,59,.7); outline-offset: 2px; }
.auth-btn .arrow { transition: transform .2s; }
.auth-btn:hover .arrow { transform: translateX(4px); }
.auth-btn.is-busy { pointer-events: none; color: transparent; }
.auth-btn.is-busy::after {
    content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%;
    border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.auth-alt { text-align: center; margin-top: 22px; color: var(--muted); font-size: .9rem; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: #9aa6b6; font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; margin: 24px 0 16px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Messages */
.auth-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: .9rem; margin-bottom: 18px; line-height: 1.45; border: 1px solid; }
.auth-alert i { margin-top: 2px; }
.auth-alert.err { background: #fdf0ee; border-color: #f3c7c0; color: #8e2a1e; animation: shake .4s; }
.auth-alert.info { background: #eef5ff; border-color: #c9dcfb; color: #1c4a8f; }
.auth-alert.ok { background: #ecf8f1; border-color: #bfe5cf; color: #1d6b3f; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

.auth-help { margin: 28px 0 0; font-size: .8rem; color: #8a96a7; text-align: center; max-width: 410px; }

/* Older pages' Bootstrap fields inside the new card */
.auth-card .input-group .form-control { height: 50px; border-radius: 12px 0 0 12px; background: var(--field); border: 1.5px solid var(--line); border-right: 0; font-family: inherit; }
.auth-card .input-group .form-control:focus { background: #fff; border-color: var(--focus); box-shadow: none; }
.auth-card .input-group-text { border-radius: 0 12px 12px 0; background: var(--field); border: 1.5px solid var(--line); border-left: 0; color: #8996a8; }
.auth-card .btn-primary { height: 52px; border-radius: 12px; border: 0; font-weight: 700; background: linear-gradient(135deg, var(--navy-700), var(--navy-800)); }
.auth-card .alert { border-radius: 12px; font-size: .9rem; }
.auth-card .login-box-msg { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-main {
        min-height: 100vh; justify-content: flex-start; padding-top: 96px;
        background: radial-gradient(120% 50% at 50% 0%, #e7eefa 0%, #fbfcfe 60%);
    }
    .auth-mobile-brand { display: flex; }
}
@media (max-width: 420px) {
    .auth-topbar { left: 14px; right: 14px; top: 14px; }
    .auth-main { padding-left: 18px; padding-right: 18px; }
    .auth-title { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
