/* Imvori Cloud: brand layer on top of app.css (the console styles shared with the on-premises
   server). Same design language as imvori.com: console navy #1a2236, signal blue #4f9cf9,
   green only for completed, Manrope 800 headings + Inter text. */

@font-face { font-family: "Inter"; src: url("fonts/inter-latin.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/manrope-latin.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }

:root {
    --navy: #1a2236;
    --navy2: #141b2e;
    --navy3: #263350;
    --blue: #4f9cf9;
    --blue-ink: #2266c2;   /* blue for text on light backgrounds (4.9:1 on white) */
    --ok: #22c55e;
    --font-text: Inter, system-ui, "Segoe UI", sans-serif;
    --font-display: Manrope, Inter, system-ui, sans-serif;
}
[data-theme="dark"] { --blue-ink: #6aaefc; }

html, body { font-family: var(--font-text); }
.page-title, .card-title, .dash-tile dd, .acct-title, .acct-claim { font-family: var(--font-display); letter-spacing: -0.02em; }
.page-title { font-weight: 800; }

/* Helpers the console pages use */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.table-wrap { overflow-x: auto; }
.field-error { display: block; color: var(--danger-text, #b91c1c); font-size: 0.85rem; margin-top: 4px; }
.top-bar-user { color: var(--text-faint); font-size: 0.875rem; max-width: 24ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signout-form { display: inline; margin: 0; }
.theme-toggle { display: inline-grid; place-items: center; min-width: 40px; min-height: 40px; color: var(--text-heading); }
@media (max-width: 600px) { .top-bar-user { display: none; } }

/* ── Sign-in, invitation and two-factor pages ─────────────────────────────── */
.acct { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr); background: var(--body-bg); color: var(--text-heading); }
.acct-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 40px; padding: 40px clamp(28px, 4vw, 56px); color: #e8edf5;
    background: radial-gradient(120% 80% at 100% 0%, rgba(79,156,249,0.16) 0%, rgba(79,156,249,0) 60%), linear-gradient(180deg, var(--navy) 0%, var(--navy2) 100%); }
.acct-logo { align-self: flex-start; display: block; border-radius: 6px; }
.acct-logo img { height: 40px; width: auto; display: block; }
.acct-logo:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.acct-pitch { margin-top: auto; max-width: 30rem; }
.acct-kicker { margin: 0 0 10px; color: var(--blue); font-weight: 600; font-size: 0.875rem; letter-spacing: 0.08em; text-transform: uppercase; }
.acct-claim { margin: 0; font-size: clamp(1.9rem, 3vw, 2.6rem); font-weight: 800; line-height: 1.1; color: #fff; text-wrap: balance; }
.acct-sub { margin: 14px 0 0; color: #b8c4d8; font-size: 1rem; line-height: 1.6; }
.acct-motif { display: grid; gap: 2px; max-width: 30rem; background: rgba(15,20,32,0.55); border: 1px solid #2a3550; border-radius: 10px; padding: 6px 16px; font-size: 0.875rem; }
.acct-dep { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) 3em; gap: 4px 12px; align-items: center; padding: 10px 0; border-top: 1px solid #2a3550; }
.acct-dep:first-child { border-top: 0; }
.acct-dep .n { font-weight: 600; color: #fff; white-space: nowrap; }
.acct-dep .s { color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-dep .p { text-align: right; color: #fff; font-variant-numeric: tabular-nums; }
.acct-dep .bar { grid-column: 1 / -1; height: 6px; background: var(--navy3); border-radius: 3px; overflow: hidden; }
.acct-dep .bar i { display: block; height: 100%; background: var(--blue); border-radius: 3px; animation: acct-grow 1.6s ease-out both; }
.acct-dep.done .bar i { background: var(--ok); }
.acct-dep.done .p { color: var(--ok); }
@keyframes acct-grow { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }
.acct-foot { margin: 0; color: #64748b; font-size: 0.8125rem; }

.acct-main { display: flex; align-items: center; justify-content: center; padding: 48px clamp(20px, 5vw, 64px); }
.acct-panel { width: 100%; max-width: 420px; }
.acct-title { margin: 0; font-size: 2rem; font-weight: 800; line-height: 1.15; color: var(--text-heading); }
.acct-lede { margin: 8px 0 28px; color: var(--text-faint); font-size: 1rem; line-height: 1.55; }
.acct-form { display: grid; gap: 18px; }
.acct-field { display: grid; gap: 6px; }
.acct-field label { font-size: 0.875rem; font-weight: 600; color: var(--text-heading); }
.acct-field input { width: 100%; min-height: 46px; padding: 10px 14px; font: inherit; font-size: 1rem; color: var(--text-heading); background: var(--input-bg); border: 1px solid var(--border); border-radius: 8px; }
.acct-field input:hover { border-color: #94a3b8; }
.acct-field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(79,156,249,0.25); }
.acct-field input[readonly] { background: var(--surface-alt); color: var(--text-faint); }
.acct-field input.invalid { border-color: #dc2626; }
.acct-field-error { color: #b91c1c; font-size: 0.875rem; }
[data-theme="dark"] .acct-field-error { color: #fca5a5; }
.acct-hint { color: var(--text-faint); font-size: 0.8125rem; }
.acct-code { font-family: "Cascadia Code", Consolas, monospace !important; font-size: 1.4rem !important; letter-spacing: 0.25em; text-align: center; }
.acct-check { display: flex; align-items: center; gap: 10px; font-size: 0.9375rem; color: var(--text-body-color); cursor: pointer; min-height: 44px; }
.acct-check input { width: 18px; height: 18px; accent-color: var(--blue); }
.acct-btn { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; padding: 0 22px; border: 1px solid transparent; border-radius: 8px;
    background: var(--blue); color: #06142b; font: 600 1rem var(--font-text); text-decoration: none; cursor: pointer; transition: background 0.15s ease; }
.acct-btn:hover { background: #7ab4fb; }
.acct-btn:focus-visible, .acct-link:focus-visible, .acct-note a:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.acct-alert { margin: 0 0 20px; padding: 12px 14px; border-radius: 8px; border: 1px solid #fecaca; background: #fef2f2; color: #991b1b; font-size: 0.9375rem; }
[data-theme="dark"] .acct-alert { background: #3b1219; border-color: #7f1d1d; color: #fecaca; }
.acct-note { margin: 18px 0 0; color: var(--text-faint); font-size: 0.875rem; line-height: 1.5; }
.acct-note a, .acct-link { color: var(--blue-ink); font-weight: 600; }
.acct-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; min-height: 24px; }
.acct-steps { margin: 0 0 24px; padding-left: 1.25rem; display: grid; gap: 12px; color: var(--text-body-color); line-height: 1.5; }
.acct-qr { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 12px; }
.acct-qr-img { width: 168px; height: 168px; padding: 8px; background: #fff; border-radius: 8px; border: 1px solid var(--border); }
.acct-key { display: block; margin-top: 4px; font-family: "Cascadia Code", Consolas, monospace; font-size: 0.95rem; color: var(--text-heading); word-break: break-all; max-width: 18ch; user-select: all; }
.acct-codes { list-style: none; margin: 0 0 24px; padding: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 8px; }
.acct-codes code { font-family: "Cascadia Code", Consolas, monospace; font-size: 0.95rem; color: var(--text-heading); user-select: all; }

@media (max-width: 900px) {
    .acct { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
    .acct-logo img { height: 30px; }
    .acct-brand { gap: 16px; padding: 20px 20px 24px; }
    .acct-pitch { margin-top: 0; }
    .acct-claim { font-size: 1.5rem; }
    .acct-sub, .acct-motif, .acct-foot { display: none; }
    .acct-main { align-items: flex-start; padding: 32px 20px 48px; }
}
@media (prefers-reduced-motion: reduce) { .acct-dep .bar i { animation: none; } }

/* ── Console pages ────────────────────────────────────────────────────────── */
.cloud-empty { padding: 28px; display: grid; gap: 12px; justify-items: start; max-width: 60ch; }
.cloud-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 700px) { .cloud-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cloud-site-list { display: grid; }
.cloud-site-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) 6rem 7rem; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.cloud-site-row:first-child { border-top: 0; }
.cloud-site-name { display: grid; }
.cloud-site-stat { display: grid; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-heading); }
@media (max-width: 600px) { .cloud-site-row { grid-template-columns: 14px minmax(0, 1fr) 5rem; } .cloud-site-row .cloud-site-stat:last-child { display: none; } }
.cloud-dot { width: 10px; height: 10px; border-radius: 50%; }
.cloud-dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(34,197,94,0.2); }
.cloud-dot.off { background: #94a3b8; }
.cloud-code-card { border-color: var(--blue); }
.cloud-steps { margin: 0 0 14px; padding-left: 1.25rem; display: grid; gap: 8px; }
.cloud-code { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.cloud-code code { font-family: "Cascadia Code", Consolas, monospace; font-size: 1.6rem; font-weight: 700; letter-spacing: 0.08em; color: var(--text-heading); padding: 10px 16px; background: var(--surface-alt); border: 2px dashed var(--border); border-radius: 8px; user-select: all; }
.cloud-link code { font-size: 0.9rem; font-weight: 400; letter-spacing: 0; word-break: break-all; max-width: 100%; }
.cloud-actions { white-space: nowrap; text-align: right; }
.cloud-actions .btn + .btn { margin-left: 6px; }
.cloud-actions span { margin-right: 8px; }
.cloud-inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cloud-inline-form .form-control { max-width: 240px; }
.cloud-role { max-width: 140px; }
.cloud-disk { width: 140px; height: 8px; background: var(--surface-alt-hover); border-radius: 4px; overflow: hidden; margin-bottom: 4px; }
.cloud-disk i { display: block; height: 100%; background: var(--blue); }
.cloud-disk i.warn { background: var(--warning, #f59e0b); }
.cloud-invite-form { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.cloud-invite-form .form-group { margin: 0; min-width: 220px; }
.cloud-invite-form .btn { min-height: 38px; }
.cloud-roles { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 20px 0 0; color: var(--text-faint); font-size: 0.875rem; }
.cloud-roles dt { font-weight: 600; color: var(--text-heading); }
.cloud-roles dd { margin: 0; }

/* Space between stacked cards on console pages. */
.content-area .card { margin-bottom: 16px; }
