/* NovaGrid sign-in pages (login, 2FA, company choice, invitation, password reset).
   Self-contained: no Tailwind classes, fonts served from /static/fonts. */
@font-face { font-family: 'Instrument Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/instrument-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-weight: 500; font-style: normal; font-display: swap; src: url('../fonts/instrument-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/instrument-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/instrument-sans-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Serif'; font-weight: 400; font-style: italic; font-display: swap; src: url('../fonts/instrument-serif-latin-400-italic.woff2') format('woff2'); }

:root {
    --ink: #0A1020; --ink-2: #1C2433; --line-dark: #1B2740; --tile: #24314D; --tile-2: #3A4C72;
    --paper: #F5F6F8; --card: #FFFFFF; --muted: #556074; --muted-2: #6B7586; --border: #CDD3DD; --soft: #EBEEF3;
    --accent: #F2B544; --accent-ring: rgba(242, 181, 68, .45); --link: #1F3B73;
    --danger-bg: #FDECEC; --danger: #9B1C1C; --ok-bg: #E7F6EE; --ok: #11603A; --warn-bg: #FFF4DB; --warn: #7A4D00; --info-bg: #E8F0FB; --info: #1E3A6E;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body.ng-auth { min-height: 100vh; font-family: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--ink); background: var(--ink); -webkit-font-smoothing: antialiased; }
.ng-auth a { color: var(--link); font-weight: 500; text-decoration: none; }
.ng-auth a:hover { color: var(--ink); text-decoration: underline; }
.ng-auth :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- two-panel shell ---------- */
.ng-shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.ng-brand { flex: 1 1 560px; min-width: 0; position: relative; overflow: hidden; background: var(--ink); color: #E8ECF3;
            padding: 56px 64px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.ng-brand-art { position: absolute; right: -180px; bottom: -160px; width: 720px; height: 720px; pointer-events: none; }
.ng-logo { position: relative; display: flex; align-items: center; gap: 12px; color: #fff; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.ng-logo svg { width: 34px; height: 34px; flex: none; }
.ng-hero { position: relative; max-width: 540px; display: flex; flex-direction: column; gap: 24px; }
.ng-hero h2 { margin: 0; font-size: 56px; line-height: 1.04; font-weight: 600; letter-spacing: -.03em; color: #fff; }
.ng-hero p { margin: 0; font-size: 18px; line-height: 1.55; color: #A9B4C6; }
.ng-serif { font-family: 'Instrument Serif', Georgia, serif; font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.ng-accent { color: var(--accent); }
.ng-trust { position: relative; margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 10px 28px; font-size: 13px; color: #8E9AB0; }
.ng-trust li { display: flex; align-items: center; gap: 8px; }
.ng-trust svg { width: 16px; height: 16px; flex: none; }

.ng-panel { flex: 1 1 480px; min-width: 0; background: var(--paper); display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 56px 24px; }
.ng-box { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 24px; }
.ng-title { display: flex; flex-direction: column; gap: 8px; }
.ng-title h1 { margin: 0; font-size: 32px; line-height: 1.15; font-weight: 600; letter-spacing: -.02em; color: var(--ink); }
.ng-title p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.ng-copyright { margin: 0; font-size: 12px; color: var(--muted-2); }

/* ---------- forms ---------- */
.ng-form { display: flex; flex-direction: column; gap: 18px; }
.ng-field { display: flex; flex-direction: column; gap: 8px; }
.ng-field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ng-field label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.ng-field-head a { font-size: 13px; }
.ng-input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--card);
            font: inherit; font-size: 16px; color: var(--ink); transition: border-color .12s, box-shadow .12s; }
.ng-input::placeholder { color: #8A93A3; }
.ng-input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent-ring); }
.ng-input-code { font-size: 22px; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.ng-pw { position: relative; display: flex; }
.ng-pw .ng-input { padding-right: 70px; }
.ng-pw-toggle { position: absolute; right: 4px; top: 4px; height: 40px; min-width: 56px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent;
                font: inherit; font-size: 13px; font-weight: 600; color: #3A4659; cursor: pointer; }
.ng-pw-toggle:hover { background: var(--soft); }
.ng-hint { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }

.ng-btn { height: 50px; width: 100%; border-radius: 10px; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
          display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; transition: transform .06s, background .12s; }
.ng-btn:active { transform: translateY(1px); }
.ng-btn svg { width: 19px; height: 19px; flex: none; }
.ng-btn-primary { border: 0; background: var(--ink); color: #fff; }
.ng-btn-primary:hover { background: #18213A; }
.ng-btn-secondary { border: 1px solid var(--border); background: var(--card); color: var(--ink); }
.ng-btn-secondary:hover { border-color: var(--ink); }
.ng-btn[disabled] { opacity: .6; cursor: wait; }
a.ng-btn:hover { text-decoration: none; color: inherit; }
.ng-btn-primary:hover, a.ng-btn-primary:hover { color: #fff; }
.ng-or { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted-2); }
.ng-or::before, .ng-or::after { content: ''; flex: 1; height: 1px; background: #DCE0E7; }
.ng-note { margin: 0; padding: 14px 16px; border-radius: 10px; background: var(--soft); font-size: 13px; line-height: 1.5; color: #3F4A5C; }
.ng-passkey-area { display: flex; flex-direction: column; gap: 24px; }
.ng-passkey-area[hidden] { display: none; }

.ng-alert { margin: 0; padding: 12px 14px; border-radius: 10px; font-size: 14px; line-height: 1.45; }
.ng-alert-danger { background: var(--danger-bg); color: var(--danger); }
.ng-alert-success { background: var(--ok-bg); color: var(--ok); }
.ng-alert-warning { background: var(--warn-bg); color: var(--warn); }
.ng-alert-info { background: var(--info-bg); color: var(--info); }
.ng-qr { display: flex; justify-content: center; }
.ng-qr svg { width: 200px; height: 200px; }
.ng-key { word-break: break-all; font-size: 12px; color: var(--muted); }
.ng-key code { font-size: 12px; color: var(--ink); background: var(--soft); padding: 2px 6px; border-radius: 6px; }

/* ---------- company choice ---------- */
body.ng-auth.ng-light { background: var(--paper); }
.ng-topbar { background: var(--ink); color: #fff; padding: 16px 40px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.ng-topbar .ng-logo { font-size: 19px; }
.ng-topbar .ng-logo svg { width: 28px; height: 28px; }
.ng-who { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; font-size: 14px; color: #C9D2E0; }
.ng-who svg { width: 16px; height: 16px; }
.ng-who span { display: inline-flex; align-items: center; gap: 8px; }
.ng-auth .ng-who a { color: #fff; font-weight: 600; padding: 8px 12px; border: 1px solid #2C3A57; border-radius: 8px; }
.ng-auth .ng-who a:hover { border-color: var(--accent); text-decoration: none; }
.ng-choose { width: 100%; max-width: 1040px; margin: 0 auto; padding: 56px 40px; display: flex; flex-direction: column; gap: 28px; }
.ng-choose-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
.ng-choose-head h1 { margin: 0; font-size: 40px; line-height: 1.1; font-weight: 600; letter-spacing: -.025em; }
.ng-choose-head p { margin: 8px 0 0; font-size: 16px; color: var(--muted); }
.ng-search { flex: 0 1 320px; }
.ng-search-wrap { position: relative; display: flex; }
.ng-search-wrap svg { position: absolute; left: 14px; top: 15px; width: 18px; height: 18px; }
.ng-search-wrap .ng-input { padding-left: 42px; }
.ng-companies { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.ng-company { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 84px; padding: 16px 18px; border: 2px solid #E2E6EC; border-radius: 14px;
              background: var(--card); font: inherit; color: var(--ink); text-align: left; cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .06s; }
.ng-company:hover, .ng-company:focus-visible { border-color: var(--ink); box-shadow: 0 0 0 4px var(--accent-ring); outline: none; }
.ng-company:active { transform: translateY(1px); }
.ng-company[hidden] { display: none; }
.ng-mono { width: 48px; height: 48px; flex: none; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; letter-spacing: .02em; color: var(--ink); }
.ng-tint-0 { background: #FBE7B8; } .ng-tint-1 { background: #CFE3F7; } .ng-tint-2 { background: #D8F0E4; }
.ng-tint-3 { background: #F3DCD3; } .ng-tint-4 { background: #E3DEF5; } .ng-tint-5 { background: #DDE7EE; }
.ng-company-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ng-company-name { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.ng-company-meta { font-size: 13px; color: var(--muted); }
.ng-badge { flex: none; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: #EEF1F5; color: #2B3546; }
.ng-badge-admin { background: #FBE7B8; color: #5C3D00; }
.ng-foot { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.ng-foot svg { width: 16px; height: 16px; flex: none; }
.ng-empty { padding: 24px; border: 1px dashed var(--border); border-radius: 14px; text-align: center; color: var(--muted); }

/* ---------- small screens / installed app ---------- */
@media (max-width: 1020px) {
    .ng-brand { flex-basis: 100%; padding: 40px 32px 32px; gap: 24px; }
    .ng-brand-art { width: 420px; height: 420px; right: -150px; bottom: auto; top: -90px; }
    .ng-hero h2 { font-size: 40px; }
    .ng-hero p { font-size: 16px; }
    .ng-panel { flex-basis: 100%; justify-content: flex-start; padding: 32px 24px 40px; }
}
@media (max-width: 640px) {
    .ng-brand { padding: 40px 24px 28px; }
    .ng-brand-art { right: -250px; top: -150px; opacity: .55; }
    .ng-hero h2 { font-size: 32px; line-height: 1.08; }
    .ng-hero p, .ng-trust { display: none; }
    .ng-title h1 { font-size: 26px; }
    .ng-box { gap: 20px; }
    .ng-signin { display: flex; flex-direction: column; gap: 20px; }
    .ng-passkey-area { order: -1; flex-direction: column-reverse; }   /* phones: fingerprint / Face ID first */
    .ng-topbar { padding: 14px 20px; }
    .ng-choose { padding: 32px 20px; }
    .ng-choose-head h1 { font-size: 30px; }
    .ng-companies { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .ng-btn, .ng-company, .ng-input { transition: none; } }
