/* ========================================================
   Establishment Audit Intelligence Platform — sign-in pages
   The dashboard's palette (dash_app/assets/app.css) with the
   CAG emblem's maroon as a formal accent. System fonts only:
   nothing is fetched from the internet.
======================================================== */

:root {
    --bg-app:        #f0f4f9;
    --bg-surface:    #ffffff;
    --bg-soft:       #f6f8fc;
    --border:        #e2e8f0;
    --border-strong: #c5cfe0;
    --text:          #0f172a;
    --text-2:        #475569;
    --text-3:        #64748b;
    --accent:        #2563eb;
    --accent-strong: #1d4ed8;
    --accent-light:  #eff6ff;
    --navy:          #13284b;
    --maroon:        #7a2621;
    --gold:          #b08a3c;
    --radius:        12px;
    --font: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', 'Noto Sans', Arial, sans-serif;
    --font-hi: 'Nirmala UI', 'Kohinoor Devanagari', 'Devanagari Sangam MN', 'Noto Sans Devanagari', var(--font);
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }

html, body { margin: 0; }
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #e6edf7 0, var(--bg-app) 320px) var(--bg-app);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.45;
}

/* ---------------- header ---------------- */

.gov-bar {
    background: var(--bg-surface);
    border-bottom: 3px solid var(--maroon);
    box-shadow: 0 1px 0 var(--gold), 0 2px 10px rgba(15, 23, 42, 0.05);
}
.gov-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.gov-mark { width: 46px; height: 46px; flex: 0 0 auto; }
.gov-names { min-width: 0; }
.gov-hi { font-family: var(--font-hi); font-size: 14px; font-weight: 600; color: var(--maroon); line-height: 1.3; }
.gov-en { font-size: 13px; font-weight: 700; letter-spacing: 0.02em; color: var(--navy); }
.gov-product {
    margin-left: auto;
    font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--text-3); text-align: right;
}

/* ---------------- card ---------------- */

.auth-main {
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 16px 28px;
}

.auth-card {
    width: 100%;
    max-width: 980px;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 18px 40px -18px rgba(19, 40, 75, 0.25);
    overflow: hidden;
}
.auth-card.narrow { max-width: 520px; grid-template-columns: 1fr; }

.auth-intro {
    padding: 36px 40px;
    background: linear-gradient(160deg, #fbfcfe 0%, var(--bg-soft) 55%, #eef3fb 100%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.auth-logo { width: 150px; height: auto; align-self: center; margin-bottom: 18px; }

h1 {
    margin: 0;
    font-size: 26px;
    line-height: 1.2;
    font-weight: 750;
    letter-spacing: -0.02em;
    color: var(--navy);
}
.title-row { display: flex; align-items: center; gap: 16px; align-self: stretch; }
.title-divider { width: 4px; align-self: stretch; min-height: 56px; background: #1e3a8a; border-radius: 2px; flex: 0 0 4px; }
.title-state {
    font-size: 24px; font-weight: 750; letter-spacing: -0.01em; color: var(--maroon); line-height: 1.2;
    white-space: nowrap;
}
.rule {
    width: 56px; height: 3px; margin: 14px 0 12px;
    background: linear-gradient(90deg, var(--maroon) 0 70%, var(--gold) 70% 100%);
    border-radius: 2px;
}
.tagline { margin: 0 0 18px; color: var(--text-2); font-size: 14px; }

.points { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.points li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); font-size: 13px; }
.points svg { width: 20px; height: 20px; flex: 0 0 20px; color: var(--accent-strong); margin-top: 1px; }

.steps { margin: 0 0 12px; padding-left: 20px; color: var(--text-2); font-size: 13px; display: grid; gap: 8px; }
.small { font-size: 12px; color: var(--text-3); margin: 6px 0 0; }

/* ---------------- form ---------------- */

.auth-form { padding: 36px 40px 30px; }
.auth-form.center { text-align: center; }
h2 { margin: 0 0 6px; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; color: var(--text); }
.sub { margin: 0 0 22px; color: var(--text-3); font-size: 13.5px; line-height: 1.5; }

.form { display: flex; flex-direction: column; }
label {
    font-size: 11px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase;
    color: #334155; margin: 18px 0 8px;
}
label .opt { text-transform: none; letter-spacing: 0; font-weight: 500; }
input[type=text], input[type=password] {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    font: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    transition: border-color 120ms, box-shadow 120ms;
}
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }

.pw { position: relative; }
.pw input { padding-right: 70px; }
.pw-toggle {
    position: absolute; right: 6px; top: 6px; height: 30px; padding: 0 10px;
    font: inherit; font-size: 12px; font-weight: 600; color: var(--accent-strong);
    background: var(--accent-light); border: 1px solid #dbeafe; border-radius: 6px; cursor: pointer;
}
.pw-toggle:hover { background: #dbeafe; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.hint { font-size: 12px; color: var(--text-3); margin-top: 7px; line-height: 1.45; }
.caps { font-size: 12px; color: #92400e; margin-top: 5px; font-weight: 600; }

.btn-primary {
    display: inline-flex; align-items: center; justify-content: center;
    margin-top: 26px; height: 44px; padding: 0 20px;
    font: inherit; font-size: 14px; font-weight: 650; color: #fff; text-decoration: none;
    background: var(--accent); border: 1px solid var(--accent); border-radius: 8px; cursor: pointer;
    transition: background 120ms, border-color 120ms;
}
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.form .btn-primary { width: 100%; }
.actions { display: flex; gap: 10px; align-items: center; }
.actions .btn-primary { flex: 1; }
.btn-plain {
    margin-top: 22px; height: 44px; padding: 0 18px; display: inline-flex; align-items: center;
    color: var(--text-2); text-decoration: none; border: 1px solid var(--border-strong); border-radius: 8px;
    font-weight: 600;
}
.btn-plain:hover { border-color: var(--accent); color: var(--accent); }
.link-button {
    background: none; border: none; padding: 0; margin-top: 14px; cursor: pointer;
    font: inherit; font-size: 13px; color: var(--accent-strong); text-decoration: underline;
}
.signout-inline { text-align: center; }

.help { margin: 16px 0 0; font-size: 12.5px; color: var(--text-3); text-align: center; }

.msg { border-radius: 8px; padding: 10px 12px; font-size: 13px; margin: 4px 0 10px; border: 1px solid; line-height: 1.45; }
.msg-info  { background: var(--accent-light); border-color: #bfdbfe; color: #1e3a8a; }
.msg-warn  { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.msg-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

.tick {
    width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0;
}

/* ---------------- footer ---------------- */

.auth-foot {
    flex: 0 0 auto;
    padding: 14px 16px 22px;
    text-align: center;
    font-size: 12px;
    color: var(--text-3);
}
.foot-lock { display: inline-block; vertical-align: -2px; margin-right: 4px; color: var(--maroon); }

/* ---------------- narrow screens ---------------- */

@media (max-width: 820px) {
    .auth-card { grid-template-columns: 1fr; }
    .auth-intro { border-right: none; border-bottom: 1px solid var(--border); padding: 26px 22px; align-items: center; text-align: center; }
    .title-row { justify-content: center; }
    .auth-logo { width: 104px; margin-bottom: 12px; }
    .rule { margin-left: auto; margin-right: auto; }
    .points, .steps { text-align: left; }
    .auth-form { padding: 26px 22px 24px; }
    h1 { font-size: 22px; }
    .title-state { font-size: 19px; }
    .gov-product { display: none; }
}
@media (max-width: 480px) {
    .gov-inner { padding: 8px 16px; }
    .gov-hi { font-size: 12.5px; }
    .gov-en { font-size: 12px; }
    .two { grid-template-columns: 1fr; gap: 0; }
    .auth-main { padding: 18px 12px; }
}

/* ---------------- signed-in devices ---------------- */

.auth-card.narrow.wide { max-width: 760px; }
.sessions { width: 100%; border-collapse: collapse; font-size: 13px; margin: 6px 0 4px; }
.sessions th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
               color: var(--text-3); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.sessions td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.sessions tr.current td { background: var(--bg-soft); }
.tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 10px; font-size: 11px; font-weight: 600;
       background: var(--accent-light); color: var(--accent-strong); border: 1px solid #dbeafe; }
.inline { display: inline; margin: 0; }
.btn-small { font: inherit; font-size: 12px; font-weight: 600; padding: 4px 10px; cursor: pointer;
             color: #991b1b; background: #fff; border: 1px solid #fecaca; border-radius: 6px; }
.btn-small:hover { background: #fef2f2; }
@media (max-width: 560px) { .sessions th:nth-child(3), .sessions td:nth-child(3) { display: none; } }
