/* =====================================================================
   DrSaathi login pages (site/login, site/userlogin)
   Same design language as the homepage and the Polaris admin theme.
   ===================================================================== */
:root {
    --bg: #f1f1f1;
    --surface: #ffffff;
    --surface-2: #f7f7f7;
    --surface-3: #ebebeb;
    --ink: #303030;
    --ink-strong: #1a1a1a;
    --muted: #616161;
    --border: #e3e3e3;
    --border-input: #8a8a8a;
    --frame: #1a1a1a;
    --frame-2: #262626;
    --frame-ink: #e3e3e3;
    --frame-muted: #a8a8a8;
    --link: #005bd3;
    --brand: #29845a;
    --brand-soft: #7ee2ad;
    --focus: #005bd3;
    --ok-bg: #cdfee1; --ok: #0c5132;
    --crit-bg: #fee9e8; --crit: #8e0b21;
    --btn: #303030; --btn-hover: #1a1a1a; --btn-ink: #ffffff;
    --shadow-card: 0 1px 0 0 rgba(26,26,26,.07), inset 0 1px 0 0 rgba(204,204,204,.5), inset 1px 0 0 0 rgba(204,204,204,.5), inset -1px 0 0 0 rgba(204,204,204,.5), inset 0 -1px 0 0 rgba(204,204,204,.5);
    --shadow-btn-primary: inset 0 -1px 0 1px rgba(0,0,0,.8), inset 0 0 0 1px #303030, inset 0 .5px 0 1.5px rgba(255,255,255,.25);
    --r: 8px; --r-md: 10px; --r-lg: 12px;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg: #121212; --surface: #1d1d1d; --surface-2: #242424; --surface-3: #2e2e2e;
        --ink: #e3e3e3; --ink-strong: #ffffff; --muted: #a6a6a6;
        --border: #333333; --border-input: #5c5c5c;
        --frame: #0a0a0a; --frame-2: #1f1f1f;
        --link: #74aefc; --focus: #74aefc;
        --ok-bg: #0e3a26; --ok: #95efc0; --crit-bg: #4a1016; --crit: #ffb3b8;
        --btn: #f1f1f1; --btn-hover: #ffffff; --btn-ink: #1a1a1a;
        --shadow-card: 0 0 0 1px #2e2e2e, 0 1px 0 rgba(0,0,0,.4);
        --shadow-btn-primary: inset 0 0 0 1px #d4d4d4;
    }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.auth { display: grid; grid-template-columns: minmax(360px, 44%) 1fr; min-height: 100%; }

/* ---------- left: dark brand panel ---------- */
.auth-side {
    background: var(--frame);
    color: var(--frame-ink);
    padding: 32px 48px;
    display: flex;
    flex-direction: column;
    gap: 40px;
    position: relative;
    overflow: hidden;
}
.auth-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 17px; letter-spacing: -.02em; text-decoration: none !important; }
.auth-brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; }
.auth-brand small { font-weight: 500; font-size: 13px; color: var(--frame-muted); letter-spacing: 0; }
.auth-pitch { max-width: 460px; margin-top: auto; }
.auth-pitch h1 {
    margin: 0; color: #fff;
    font-size: clamp(30px, 3.4vw, 44px); line-height: 1.05; font-weight: 750; letter-spacing: -.035em;
    text-wrap: balance;
}
.auth-pitch h1 em { font-style: normal; color: var(--brand-soft); }
.auth-pitch p { margin: 14px 0 0; color: var(--frame-muted); font-size: 15.5px; max-width: 46ch; }

.auth-points { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 10px; }
.auth-points li { display: flex; gap: 10px; align-items: center; color: #e3e3e3; font-size: 14px; }
.auth-points svg { width: 18px; height: 18px; color: var(--brand-soft); flex-shrink: 0; }

/* notices from the hospital CMS, shown as cards */
.auth-news { display: grid; gap: 10px; max-width: 480px; }
.auth-news-title { font-size: 12px; font-weight: 650; color: var(--frame-muted); letter-spacing: .04em; text-transform: uppercase; margin: 0 0 2px; }
.auth-news-list { display: grid; gap: 8px; max-height: 320px; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; scrollbar-color: #4a4a4a transparent; }
.auth-news-item { background: var(--frame-2); border: 1px solid #333; border-radius: var(--r-lg); padding: 12px 14px; }
.auth-news-item h4 { margin: 0; color: #fff; font-size: 14px; font-weight: 650; }
.auth-news-item p { margin: 4px 0 0; color: var(--frame-muted); font-size: 13px; line-height: 1.5; }
.auth-news-item a { color: var(--brand-soft); font-weight: 550; }
.auth-foot { margin-top: auto; color: #7d7d7d; font-size: 12.5px; }
.auth-side .auth-foot { margin-top: 0; }

/* soft token display in the corner, the product's own motif */
.auth-token {
    position: absolute; right: -30px; top: 90px;
    font-weight: 800; font-size: 220px; line-height: 1; letter-spacing: -.06em;
    color: rgba(255,255,255,.035); pointer-events: none; user-select: none;
    font-variant-numeric: tabular-nums;
}

/* ---------- right: form ---------- */
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card {
    width: 100%; max-width: 420px;
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-card);
    padding: 28px;
}
.auth-logo { display: flex; align-items: center; min-height: 36px; margin-bottom: 20px; }
.auth-logo img { max-height: 40px; max-width: 220px; width: auto; height: auto; }
.auth-card h2 { margin: 0; font-size: 22px; font-weight: 700; color: var(--ink-strong); letter-spacing: -.02em; }
.auth-sub { margin: 4px 0 20px; color: var(--muted); font-size: 14px; }

.auth-alert { border-radius: var(--r-md); padding: 10px 12px; font-size: 13.5px; margin-bottom: 16px; }
.auth-alert-error { background: var(--crit-bg); color: var(--crit); }
.auth-alert-ok { background: var(--ok-bg); color: var(--ok); }

.auth-field { display: grid; gap: 6px; margin-bottom: 14px; }
.auth-field label { font-size: 13px; font-weight: 550; color: var(--ink); }
.auth-input-wrap { position: relative; }
.auth-input {
    width: 100%; height: 40px;
    padding: 8px 12px;
    font: 450 14px var(--sans);
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border-input);
    border-radius: var(--r);
    transition: border-color .12s, background .12s;
}
.auth-input:hover { border-color: #616161; }
.auth-input:focus { outline: none !important; outline-offset: 1px; border-color: var(--border-input); }
.auth-input::placeholder { color: #8a8a8a; }
.auth-input-wrap .auth-input { padding-right: 44px; }
.auth-eye {
    position: absolute; right: 4px; top: 4px;
    width: 32px; height: 32px; border: 0; border-radius: 6px;
    background: transparent; color: var(--muted); cursor: pointer;
    display: grid; place-items: center;
}
.auth-eye:hover { background: var(--surface-3); color: var(--ink); }
.auth-eye svg { width: 18px; height: 18px; }
.auth-error, .auth-field .text-danger { color: var(--crit); font-size: 12.5px; }
.auth-error:empty, .auth-field .text-danger:empty { display: none; }
.auth-error p, .auth-field .text-danger p { margin: 0; }

.auth-captcha { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: end; margin-bottom: 14px; }
.auth-captcha-img { display: flex; align-items: center; gap: 6px; }
.auth-captcha-img img { border-radius: var(--r); border: 1px solid var(--border); display: block; }
.auth-refresh {
    width: 32px; height: 32px; border: 0; border-radius: 6px; background: var(--surface-3);
    color: var(--ink); cursor: pointer; display: grid; place-items: center;
}
.auth-refresh:hover { background: var(--border); }
.auth-refresh svg { width: 16px; height: 16px; }

.auth-row { display: flex; justify-content: flex-end; margin: -4px 0 18px; }
.auth-row a { font-size: 13px; font-weight: 550; }

.auth-submit {
    width: 100%; min-height: 42px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 0; border-radius: var(--r);
    background: linear-gradient(180deg, rgba(48,48,48,0) 63.53%, rgba(255,255,255,.15) 100%), var(--btn);
    color: var(--btn-ink);
    box-shadow: var(--shadow-btn-primary);
    font: 600 14.5px var(--sans);
    cursor: pointer;
    transition: background .15s, transform .1s;
}
.auth-submit:hover { background: var(--btn-hover); }
.auth-submit:active { transform: translateY(.5px); }
.auth-submit[disabled] { opacity: .7; cursor: progress; }

.auth-switch {
    margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    font-size: 13px; color: var(--muted);
}
.auth-switch a {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px; border-radius: var(--r);
    background: var(--surface-3); color: var(--ink); font-weight: 550;
}
.auth-switch a:hover { background: var(--border); text-decoration: none; }
.auth-legal { margin-top: 16px; text-align: center; font-size: 12px; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .auth-side { padding: 20px 20px 28px; gap: 20px; }
    .auth-pitch { margin-top: 0; }
    .auth-pitch p, .auth-points, .auth-token, .auth-side .auth-foot { display: none; }
    .auth-news-list { max-height: 200px; }
    .auth-main { padding: 24px 16px 40px; align-items: flex-start; }
}
@media (max-width: 420px) {
    .auth-card { padding: 22px 18px; }
    .auth-captcha { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}

/* logo fallback when the uploaded logo file is missing */
.auth-logo-text { font-size: 15px; font-weight: 650; color: var(--ink-strong); padding: 6px 10px; border-radius: var(--r); background: var(--surface-3); }

/* phones: short brand strip, then the form (notices hidden) */
@media (max-width: 900px) {
    .auth { grid-template-rows: auto 1fr; }
    .auth-side .auth-news { display: none; }
}

/* multi-hospital: chosen hospital + code field */
.auth-hospital {
    display: flex; align-items: center; gap: 10px;
    margin: -6px 0 18px; padding: 8px 10px;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md);
}
.auth-hospital-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.auth-hospital-name { display: grid; min-width: 0; line-height: 1.25; }
.auth-hospital-name b { font-size: 13.5px; color: var(--ink-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auth-hospital-name small { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.auth-hospital a { margin-left: auto; font-size: 13px; font-weight: 550; }
.auth-input-code { text-transform: uppercase; letter-spacing: .08em; font-weight: 600; font-size: 16px; height: 46px; }
.auth-input-code::placeholder { letter-spacing: .08em; font-weight: 450; }
