/* ============================================================
   Auth pages (Login, Forgot Password) — 2027 template
   Port of DesignIdea/login-redesign.html. Colours come from the
   global tokens in tailwind.css (:root / [data-theme="dark"]).
   ============================================================ */

.auth-body {
    margin: 0; min-height: 100vh; color: var(--text-2); background-color: var(--bg);
    background-image: radial-gradient(var(--brand-ring) 1px, transparent 1px); background-size: 22px 22px;
    display: flex; align-items: center; justify-content: center; padding: 24px 16px;
    -webkit-font-smoothing: antialiased;
}
.auth-body a { text-decoration: none; }

/* ── Shell: two panels in one outlined frame ───────────────── */
.auth-shell {
    width: 100%; max-width: 1200px; display: grid; grid-template-columns: 2fr 1fr; /* 8 : 4 */
    background: var(--surface); border: 1.5px solid var(--brand); border-radius: 20px; overflow: hidden;
    box-shadow: 0 24px 48px -16px rgba(16,24,40,.18);
    animation: auth-rise .4s cubic-bezier(.16,1,.3,1) both;
}
@keyframes auth-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ── Left: brand + quick links ─────────────────────────────── */
.auth-brand { padding: 36px; background: var(--surface-2); border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 26px; }
.auth-logo-row { display: flex; align-items: center; gap: 14px; }
.auth-logo { width: 72px; height: 72px; border-radius: 14px; flex-shrink: 0; border: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; justify-content: center; }
.auth-logo img { height: 60px; width: auto; max-width: 60px; object-fit: contain; }
.auth-org { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); }
.auth-app { font-size: 1.2rem; font-weight: 700; color: var(--text); }
.auth-brand h2 { margin: 0; font-size: 1.55rem; line-height: 1.25; font-weight: 700; color: var(--text); letter-spacing: -.015em; }
.auth-brand h2 span { color: var(--brand); }
.auth-lead { margin: 8px 0 0; font-size: .87rem; color: var(--muted); line-height: 1.55; }
.auth-feat { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.auth-feat li { display: flex; gap: 10px; align-items: center; font-size: .83rem; color: var(--text-2); }
.auth-feat .i { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border-hover); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: .8rem; flex-shrink: 0; background: var(--surface); }
.auth-ql-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.auth-ql-head h3 { margin: 0; font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.auth-ql-head .line { flex: 1; height: 1px; background: var(--border); }
.auth-ql-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.auth-ql { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px; border: 1px solid transparent; font-size: .78rem; color: var(--text-2); font-weight: 500; transition: border-color .15s, background .15s, color .15s; min-width: 0; }
.auth-ql .fa:first-child { width: 16px; text-align: center; color: var(--muted); transition: color .15s; }
.auth-ql span { flex: 1; min-width: 0; line-height: 1.3; overflow-wrap: break-word; }
.auth-ql .fa-external-link { font-size: .65rem; opacity: 0; color: var(--brand); transition: opacity .15s; }
.auth-ql:hover { border-color: var(--border-hover); background: var(--surface); color: var(--brand); }
.auth-ql:hover .fa { color: var(--brand); }
.auth-ql:hover .fa-external-link { opacity: 1; }
.auth-ql:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }

/* ── Right: form ───────────────────────────────────────────── */
.auth-form { padding: 44px 44px 28px; display: flex; flex-direction: column; }
.auth-steps { display: flex; align-items: center; gap: 8px; margin-bottom: 26px; font-size: .72rem; font-weight: 600; color: var(--muted); flex-wrap: wrap; }
.auth-step { display: inline-flex; align-items: center; gap: 7px; }
.auth-step .n { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: .68rem; background: var(--surface); }
.auth-step.on { color: var(--text); }
.auth-step.on .n { border-color: var(--brand); color: var(--brand); }
.auth-step.done .n { border-color: var(--green); color: var(--green); }
.auth-steps .sep { flex: 0 0 28px; height: 1.5px; background: var(--border); }
.auth-form h1 { margin: 0; font-size: 1.5rem; font-weight: 700; color: var(--text); letter-spacing: -.015em; }
.auth-sub { margin: 6px 0 24px; font-size: .87rem; color: var(--muted); }
.auth-sub b { color: var(--text); }

.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; font-size: .78rem; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.auth-ctl { position: relative; }
.auth-ctl > .fa:first-child { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .9rem; pointer-events: none; }
.auth-ctl input {
    width: 100%; height: 46px; padding: 0 44px 0 40px; border-radius: 11px; border: 1px solid var(--border);
    background: var(--surface-2); color: var(--text); font: inherit; font-size: .9rem; outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.auth-ctl input::placeholder { color: var(--muted); opacity: .7; }
.auth-ctl input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); background: var(--surface); }
.auth-ctl input[readonly] { color: var(--muted); }
.auth-eye { all: unset; cursor: pointer; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.auth-eye:hover { color: var(--text); background: var(--surface); }
.auth-eye:focus-visible { box-shadow: 0 0 0 3px var(--brand-ring); }
.auth-hint { font-size: .72rem; margin-top: 6px; display: none; align-items: center; gap: 6px; color: var(--amber); font-weight: 500; }
.auth-hint.show { display: flex; }
.auth-err, .auth-field .field-validation-error { font-size: .72rem; margin-top: 6px; color: var(--danger); font-weight: 500; display: block; }
.auth-field.invalid input { border-color: var(--danger); background: var(--surface); }

.auth-seg-label { font-size: .78rem; font-weight: 600; color: var(--text-2); margin-bottom: 6px; display: block; }
.auth-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 4px; }
.auth-seg input { position: absolute; opacity: 0; pointer-events: none; }
.auth-seg label { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 11px; cursor: pointer; font-size: .83rem; font-weight: 500; color: var(--text-2); transition: border-color .15s, background .15s; }
.auth-seg label .fa { color: var(--muted); width: 16px; text-align: center; }
.auth-seg input:checked + label { border-color: var(--brand); background: var(--brand-soft); color: var(--text); }
.auth-seg input:checked + label .fa { color: var(--brand); }
.auth-seg input:focus-visible + label { box-shadow: 0 0 0 3px var(--brand-ring); }

.auth-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 4px 0 20px; font-size: .8rem; flex-wrap: wrap; }
.auth-row a { color: var(--brand); font-weight: 600; }
.auth-row a:hover { text-decoration: underline; }
.auth-row .muted { color: var(--muted); display: flex; gap: 6px; align-items: center; }

.auth-btn {
    width: 100%; height: 48px; border-radius: 11px; border: 1.5px solid var(--brand); background: var(--brand); color: #fff;
    font: 600 .9rem Inter, sans-serif; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: background .15s, transform .1s, box-shadow .15s;
}
.auth-btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.auth-btn:active { transform: scale(.99); }
.auth-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--brand-ring); }
.auth-btn .fa { transition: transform .15s; }
.auth-btn:hover .fa-arrow-right { transform: translateX(3px); }
.auth-btn-ghost { background: transparent; color: var(--text-2); border-color: var(--border); margin-top: 10px; height: 42px; font-weight: 500; font-size: .83rem; }
.auth-btn-ghost:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }

.auth-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 11px; font-size: .82rem; line-height: 1.45; margin-bottom: 18px; border: 1px solid; }
.auth-alert.danger  { color: var(--danger); border-color: var(--danger-border); background: var(--danger-soft); }
.auth-alert.info    { color: var(--blue);  border-color: var(--border);       background: var(--blue-soft); }
.auth-alert.warning { color: var(--amber); border-color: var(--border);       background: var(--amber-soft); }
.auth-alert.success { color: var(--green); border-color: var(--border);       background: var(--green-soft); }
.auth-alert .fa { margin-top: 2px; }
.auth-alert ul { margin: 0; padding-left: 16px; }
.auth-alert .validation-summary-valid { display: none; }

/* OTP: #authOtp is the real field; JS swaps in the six boxes */
.auth-otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.auth-otp[hidden] { display: none; }
.auth-otp input {
    width: 100%; height: 54px; text-align: center; font: 700 1.35rem Inter, sans-serif; color: var(--text);
    border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s; padding: 0;
}
.auth-otp input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); background: var(--surface); }
.auth-otp input.filled { border-color: var(--border-hover); background: var(--surface); }
.auth-otp-plain { letter-spacing: .5em; text-align: center; font-weight: 700; font-size: 1.2rem !important; padding: 0 12px !important; }

.auth-foot { margin-top: auto; padding-top: 26px; display: flex; justify-content: space-between; align-items: center; font-size: .72rem; color: var(--muted); gap: 10px; flex-wrap: wrap; }
.auth-foot .sec { display: flex; gap: 6px; align-items: center; }
.auth-foot .sec .fa { color: var(--green); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .auth-shell { grid-template-columns: 1.4fr 1fr; }
    .auth-ql-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
    .auth-shell { grid-template-columns: 1fr; max-width: 480px; }
    /* Brand panel dissolves so its parts can be ordered around the form:
       logo row on top, then the form, then quick links. */
    .auth-brand { display: contents; }
    .auth-logo-row { order: 0; padding: 24px 24px 0; }
    .auth-form { order: 1; padding: 20px 24px 22px; }
    .auth-ql-wrap { order: 2; padding: 24px; background: var(--surface-2); border-top: 1px solid var(--border); }
    .auth-pitch, .auth-feat { display: none; }
}
@media (max-width: 400px) {
    .auth-otp { gap: 5px; }
    .auth-otp input { height: 48px; font-size: 1.15rem; }
    .auth-ql-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .auth-shell, .auth-shell * { animation: none !important; transition: none !important; }
}
