/* ==========================================================================
   BravaAuth — Brava 3.0 design tokens (mirrors Brava.Central.Web brava.css)
   Components reference tokens only; a theme overrides tokens, never components.
   ========================================================================== */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/inter/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/inter/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/inter/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/inter/inter-latin-700-normal.woff2') format('woff2'); }

:root {
    color-scheme: light;
    --brava-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    --brava-mono: ui-monospace, 'Cascadia Code', 'SFMono-Regular', Consolas, monospace;

    --brava-blue: #2563eb;
    --brava-blue-hover: #1d4ed8;
    --brava-blue-soft: color-mix(in srgb, var(--brava-blue) 10%, transparent);
    --link-color: var(--brava-blue);

    --color-success: #059669;
    --color-success-bg: #d1fae5;
    --color-success-text: #065f46;
    --color-danger: #dc2626;
    --color-danger-hover: #b91c1c;
    --color-danger-bg: #fee2e2;
    --color-danger-text: #991b1b;
    --color-warning: #f59e0b;
    --color-warning-bg: #fef3c7;
    --color-warning-text: #92400e;
    --color-info-bg: #dbeafe;
    --color-info-text: #1e40af;

    --surface-app: #f5f7fa;
    --surface-sidebar: #ffffff;
    --surface-topbar: #ffffff;
    --surface-card: #ffffff;
    --surface-elevated: #ffffff;
    --surface-muted: #f9fafb;
    --surface-strong: #f3f4f6;

    --text-primary: #111827;
    --text-secondary: #374151;
    --text-tertiary: #6b7280;
    --text-disabled: #9ca3af;
    --text-inverse: #ffffff;

    --border-light: #e5e7eb;
    --border-medium: #d1d5db;
    --border-dark: #9ca3af;

    --sidebar-width: 248px;
    --topbar-height: 60px;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-2xl: 16px;
    --transition-fast: 0.15s;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px -12px rgba(15, 23, 42, 0.25);
    --focus-ring: 0 0 0 3px color-mix(in srgb, var(--brava-blue) 35%, transparent);
}

[data-theme="dark"] {
    color-scheme: dark;
    --brava-blue: #3b82f6;
    --brava-blue-hover: #60a5fa;
    --link-color: color-mix(in srgb, var(--brava-blue) 55%, #ffffff);

    --surface-app: #1e1e1e;
    --surface-sidebar: #262626;
    --surface-topbar: #262626;
    --surface-card: #303030;
    --surface-elevated: #3b3b3b;
    --surface-muted: #2a2a2a;
    --surface-strong: #444444;

    --text-primary: #f3f4f6;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;
    --text-disabled: #6b7280;

    --border-light: #3d3d3d;
    --border-medium: #505050;
    --border-dark: #666666;

    --color-success-bg: rgba(16, 185, 129, 0.15);
    --color-success-text: #6ee7b7;
    --color-danger-bg: rgba(239, 68, 68, 0.15);
    --color-danger-text: #fca5a5;
    --color-warning-bg: rgba(245, 158, 11, 0.15);
    --color-warning-text: #fcd34d;
    --color-info-bg: rgba(59, 130, 246, 0.15);
    --color-info-text: #93c5fd;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 12px 32px -12px rgba(0, 0, 0, 0.7);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--brava-font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--surface-app);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--link-color); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; color: var(--text-primary); }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
code, .mono { font-family: var(--brava-mono); font-size: 0.92em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.muted { color: var(--text-tertiary); }
.small { font-size: 12px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 22px; height: 22px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 38px; padding: 0 16px;
    font: inherit; font-weight: 600; font-size: 14px;
    border-radius: var(--radius-lg); border: 1px solid transparent;
    cursor: pointer; text-decoration: none !important; white-space: nowrap;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
.btn-primary { background: var(--brava-blue); color: var(--text-inverse); }
.btn-primary:hover { background: var(--brava-blue-hover); }
.btn-secondary { background: var(--surface-card); color: var(--text-primary); border-color: var(--border-medium); }
.btn-secondary:hover { background: var(--surface-muted); border-color: var(--border-dark); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--surface-strong); color: var(--text-primary); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-danger:hover { background: var(--color-danger-hover); }
.btn-danger-outline { background: transparent; color: var(--color-danger-text); border-color: color-mix(in srgb, var(--color-danger) 40%, transparent); }
.btn-danger-outline:hover { background: var(--color-danger-bg); }
.btn-block { width: 100%; height: 44px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.field .hint { font-size: 12px; color: var(--text-tertiary); }
.input, .field input[type=text], .field input[type=email], .field input[type=password], .field input[type=url], .field input[type=number], .field input[type=search], .field select, .field textarea {
    width: 100%; height: 42px; padding: 0 12px;
    font: inherit; color: var(--text-primary);
    background: var(--surface-card);
    border: 1px solid var(--border-medium); border-radius: var(--radius-lg);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.field textarea { height: auto; min-height: 120px; padding: 10px 12px; font-family: var(--brava-mono); font-size: 12px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brava-blue); box-shadow: var(--focus-ring); }
.input-code { font-family: var(--brava-mono); font-size: 22px !important; letter-spacing: 0.35em; text-align: center; height: 52px !important; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text-secondary); cursor: pointer; }
.check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--brava-blue); }
.validation-message { color: var(--color-danger-text); font-size: 12px; }
.validation-errors { margin: 0; padding-left: 18px; color: var(--color-danger-text); font-size: 13px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- Alerts / badges ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-lg); font-size: 13px; border: 1px solid transparent; }
.alert .icon { margin-top: 1px; }
.alert-error { background: var(--color-danger-bg); color: var(--color-danger-text); border-color: color-mix(in srgb, var(--color-danger) 25%, transparent); }
.alert-success { background: var(--color-success-bg); color: var(--color-success-text); border-color: color-mix(in srgb, var(--color-success) 25%, transparent); }
.alert-warning { background: var(--color-warning-bg); color: var(--color-warning-text); border-color: color-mix(in srgb, var(--color-warning) 30%, transparent); }
.alert-info { background: var(--color-info-bg); color: var(--color-info-text); border-color: color-mix(in srgb, var(--brava-blue) 25%, transparent); }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-strong); color: var(--text-secondary); white-space: nowrap; }
.badge-success { background: var(--color-success-bg); color: var(--color-success-text); }
.badge-danger { background: var(--color-danger-bg); color: var(--color-danger-text); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning-text); }
.badge-info { background: var(--color-info-bg); color: var(--color-info-text); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* ---------- Sign-in layout ---------- */
.auth-main { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; position: relative; }
.auth-topright { position: absolute; top: 18px; right: 20px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface-card); border: 1px solid var(--border-light); border-radius: var(--radius-xl); box-shadow: var(--shadow-md); padding: 32px; }
.auth-card header { margin-bottom: 20px; }
.auth-card header p { margin-top: 6px; color: var(--text-tertiary); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-tertiary); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; margin: 4px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border-light); }
.auth-links { display: flex; justify-content: space-between; font-size: 13px; }
.user-pill { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface-strong); border-radius: 999px; font-weight: 500; font-size: 13px; width: fit-content; }
@media (max-width: 480px) { .auth-card { border: 0; box-shadow: none; background: transparent; padding: 8px; } }
/* ---------- Portal layout ---------- */
.portal { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) 1fr; grid-template-rows: var(--topbar-height) 1fr; }
.topbar {
    grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 0 20px;
    background: var(--surface-topbar); border-bottom: 1px solid var(--border-light); position: sticky; top: 0; z-index: 20;
}
.topbar .brand-mark { font-size: 18px; color: var(--text-primary); }
.topbar .brand-mark img { width: 30px; height: 30px; padding: 0; background: transparent; }
.topbar .product { color: var(--text-tertiary); font-weight: 500; padding-left: 14px; border-left: 1px solid var(--border-light); }
.sidebar { background: var(--surface-sidebar); border-right: 1px solid var(--border-light); padding: 18px 12px; overflow-y: auto; position: sticky; top: var(--topbar-height); height: calc(100vh - var(--topbar-height)); }
.nav-section { margin-bottom: 18px; }

/* Release number: readable, but you have to look for it. */
.app-version { font-size: 11px; line-height: 1; letter-spacing: 0.02em; color: var(--text-tertiary); opacity: 0.8; user-select: all; }
/* Directly under the sign-in card, whatever the window height. */
.app-version--auth { width: 100%; max-width: 400px; margin-top: 14px; text-align: center; }
.app-version--sidebar { padding: 12px 12px 4px; }
.app-version--content { display: none; padding-top: 28px; text-align: center; }
.sidebar { display: flex; flex-direction: column; }
.sidebar .app-version--sidebar { margin-top: auto; }
.nav-title { font-size: 11px; font-weight: 700; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.08em; padding: 0 12px 6px; }
.nav-link { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border-radius: var(--radius-lg); color: var(--text-secondary); font-weight: 500; text-decoration: none !important; }
.nav-link:hover { background: var(--surface-strong); color: var(--text-primary); }
.nav-link.active { background: var(--brava-blue-soft); color: var(--brava-blue); }
[data-theme="dark"] .nav-link.active { color: var(--link-color); }
.content { padding: 28px 32px 56px; min-width: 0; }
.content-inner { max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-header p { color: var(--text-tertiary); margin-top: 4px; }
.breadcrumb { font-size: 13px; color: var(--text-tertiary); margin-bottom: 6px; }

@media (max-width: 860px) {
    .portal { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; display: flex; gap: 4px; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--border-light); }
    .nav-section { display: flex; gap: 4px; margin: 0; }
    .nav-title { display: none; }
    .sidebar { flex-direction: row; }
    .sidebar .app-version--sidebar { display: none; }
    .app-version--content { display: block; }
    .content { padding: 20px 16px 40px; }
    .topbar .product { display: none; }
}

/* ---------- Cards ---------- */
.card { background: var(--surface-card); border: 1px solid var(--border-light); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border-light); flex-wrap: wrap; }
.card-header p { color: var(--text-tertiary); font-size: 13px; margin-top: 2px; }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border-light); background: var(--surface-muted); border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 980px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.stat { padding: 18px 20px; display: flex; gap: 14px; align-items: center; }
.stat .stat-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brava-blue-soft); color: var(--brava-blue); }
.stat .stat-value { font-size: 24px; font-weight: 700; line-height: 1.1; }
.stat .stat-label { font-size: 13px; color: var(--text-tertiary); }

/* Method rows (security page) */
.method { display: flex; align-items: center; gap: 16px; padding: 18px 20px; }
.method + .method { border-top: 1px solid var(--border-light); }
.method .method-icon { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--surface-strong); color: var(--text-secondary); }
.method.on .method-icon { background: var(--color-success-bg); color: var(--color-success-text); }
.method h3 { display: flex; align-items: center; gap: 8px; }
.method p { color: var(--text-tertiary); font-size: 13px; margin-top: 2px; }

/* Lists & tables */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; }
.list-item + .list-item { border-top: 1px solid var(--border-light); }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 600; color: var(--text-tertiary); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 16px; background: var(--surface-muted); border-bottom: 1px solid var(--border-light); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-muted); }
.table .actions { text-align: right; white-space: nowrap; }
.empty { padding: 40px 20px; text-align: center; color: var(--text-tertiary); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .input { height: 38px; max-width: 320px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--border-light); font-size: 13px; color: var(--text-tertiary); }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 10px 16px; font-size: 13px; }
.kv dt { color: var(--text-tertiary); }
.kv dd { margin: 0; word-break: break-word; }

/* Avatar */
.avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: linear-gradient(135deg, var(--brava-blue), #7c3aed); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-xl { width: 96px; height: 96px; font-size: 32px; box-shadow: 0 0 0 4px var(--surface-card), 0 0 0 5px var(--border-light); }

/* Profile menu */
.menu { position: relative; margin-left: auto; }
.menu > summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 999px; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover { background: var(--surface-strong); }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: var(--surface-elevated); border: 1px solid var(--border-light); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 8px; z-index: 30; }
.menu-panel .menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border-light); margin-bottom: 6px; }
.menu-panel a, .menu-panel button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-md); color: var(--text-secondary); background: none; border: 0; font: inherit; cursor: pointer; text-decoration: none !important; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-strong); color: var(--text-primary); }
.theme-switch { display: flex; gap: 4px; padding: 6px 10px; }
.theme-switch button { justify-content: center; flex: 1; padding: 6px; border: 1px solid var(--border-light); }
.theme-switch button[aria-pressed="true"] { border-color: var(--brava-blue); color: var(--brava-blue); background: var(--brava-blue-soft); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--border-light); background: var(--surface-card); color: var(--text-secondary); cursor: pointer; }
.icon-btn:hover { color: var(--text-primary); background: var(--surface-strong); }

/* Recovery codes, secrets, QR */
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 16px; background: var(--surface-muted); border: 1px dashed var(--border-medium); border-radius: var(--radius-lg); font-family: var(--brava-mono); font-size: 15px; }
.secret { font-family: var(--brava-mono); padding: 10px 12px; background: var(--surface-strong); border-radius: var(--radius-md); word-break: break-all; user-select: all; }
.qr { width: 196px; height: 196px; padding: 10px; background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border-light); }
.qr svg { width: 100%; height: 100%; display: block; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.steps > li { counter-increment: step; display: grid; grid-template-columns: 32px 1fr; gap: 14px; }
.steps > li::before { content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brava-blue-soft); color: var(--brava-blue); font-weight: 700; font-size: 13px; }

/* Error / empty states */
.state { max-width: 520px; margin: 10vh auto; text-align: center; padding: 0 20px; }
.state .state-icon { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 18px; display: grid; place-items: center; background: var(--brava-blue-soft); color: var(--brava-blue); }
.state p { color: var(--text-tertiary); margin: 8px 0 22px; }

.state-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--brava-blue-soft); color: var(--brava-blue); }

.row-top { align-items: flex-start; flex-wrap: wrap; }
.btn.disabled { opacity: 0.5; pointer-events: none; }

.brand-mark { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; color: inherit; text-decoration: none !important; }
.brand-mark img { width: 30px; height: 30px; border-radius: 50%; }

.empty .state-icon { margin: 0 auto 12px; }

.toolbar .input { width: auto; min-width: 220px; }
.toolbar form, form.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.passkey-note { margin-top: 8px; text-align: center; }

.nav-lock { width: 12px; height: 12px; vertical-align: -1px; margin-left: 4px; }
.admin-mfa-banner { align-items: center; }

.auth-logo { display: flex; justify-content: center; margin-bottom: 28px; }
.auth-logo img { display: block; max-width: 100%; max-height: 64px; object-fit: contain; }
.topbar .brand-mark img { width: auto; height: 32px; max-width: 220px; border-radius: 0; object-fit: contain; }

/* Same dark-mode treatment as Brava 3.0's header logo: render it white for contrast. */
[data-theme="dark"] .auth-logo img,
[data-theme="dark"] .brand-mark img { filter: brightness(0) invert(1); }


/* ---------- Mobile: no zoom ---------- */
/* No double-tap zoom, and no text inflation when a phone rotates. */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* iOS zooms into any focused field under 16px; keep fields at 16px on small screens so tapping one never resizes the page. */
@media (max-width: 768px) {
    input, select, textarea, .input, .field input, .field select, .field textarea { font-size: 16px !important; }
}

/* ---------- Pull to refresh ---------- */
/* The browser's own pull-to-refresh is switched off; bravaauth.js drags the page down instead, holding a spinner in
   the revealed gap until the refresh finishes. */
html, body { overscroll-behavior-y: none; }
#ptr-root { position: relative; z-index: 1; min-height: 100vh; background: var(--surface-app); will-change: transform; }
#ptr-indicator { position: fixed; top: 0; left: 0; right: 0; height: 64px; z-index: 0; display: flex; align-items: center; justify-content: center; }
.ptr-spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--border-medium); border-top-color: var(--brava-blue); opacity: 0; transition: opacity 0.15s ease; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* Profile: where the picture comes from (Brava's User entity; no uploads). */
.profile-picture-source { display: inline-flex; align-items: center; gap: 8px; }

/* One-time code: one box per digit (code-entry element). Without JavaScript the plain .input-code field shows. */
code-entry { display: block; }
code-entry.is-enhanced .code-entry-source { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.code-entry-boxes { display: flex; align-items: center; justify-content: center; gap: 8px; }
code-entry input.code-box, .field code-entry input.code-box {
    flex: 1 1 0; min-width: 0; max-width: 52px; width: auto; height: 56px; padding: 0;
    font-family: var(--brava-mono); font-size: 24px !important; font-weight: 600; text-align: center; line-height: 56px;
    color: var(--text-primary); background: var(--surface-card); caret-color: var(--brava-blue);
    border: 1px solid var(--border-medium); border-radius: var(--radius-lg);
    transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}
code-entry input.code-box:hover { border-color: var(--border-dark); }
code-entry input.code-box:focus, .field code-entry input.code-box:focus { outline: none; border-color: var(--brava-blue); box-shadow: var(--focus-ring); }
code-entry input.code-box:not(:placeholder-shown) { border-color: var(--border-dark); }
.code-entry-gap { flex: 0 0 10px; height: 2px; border-radius: 1px; background: var(--border-medium); }
code-entry.is-complete input.code-box { border-color: var(--brava-blue); }
code-entry.is-submitting input.code-box { opacity: 0.6; }
@media (max-width: 380px) { .code-entry-boxes { gap: 6px; } code-entry input.code-box, .field code-entry input.code-box { height: 50px; line-height: 50px; font-size: 22px !important; } }
@media (prefers-reduced-motion: reduce) { code-entry input.code-box { transition: none; } }
