/* ── BIS Portal · the Modern look: the rules ───────────────────────────────────
   (2026-11-19, Ricardo approved option B: BIS Next's Modern look, Light and Dark, in the Portal. Port of the prototype proto-portal.css of
   C:\MICS\Documents\planes\2026-11-19-look-apps, whose behavior rows are table-rows.md, section "Portal", P-1..P-13, and the shared rows G-1..G-26.
   Before this date the file held the "style of tones" of 2026-11-06, BIS Next at fbb106fe.)
   Values: bis-skin-tokens.css, a byte-for-byte copy of BIS Next's shared file, loaded right after bis-tokens.css. This file loads LAST, after portal.css,
   because it must win over it.

   What the Modern look is, for the Portal (all approved 2026-11-19):
     D1   --bis-bg is the PAGE (BIS Next's meaning); a box (the sign-in card, the dialog) is --bis-surface.
     D3   The top bar is César's: white with dark text and a 1 px bottom edge (portal.css .bar), on the tile page, the Security page and the error page.
     D4   Dark: the tiles take César's accent #6c9cff with dark ink #0b1220 (portal.css --tile family); the bar's controls follow the top bar.
     D12  No left stripe on the notices (.aviso, .login-required, .login-error), no shadow on the sign-in card.
     Fields are flat: a 1 px edge on all four sides in the 3:1 field line, the focus is the accent edge plus a 2 px accent ring. Radii 12 / 8 / 8.
   "Under development" tiles stay visibly dimmed in both themes: portal.css, --tile-dev.

   Does not declare any --bis-* token (they would silently beat the shared file). The Portal's own tokens (--tile family, --login-field) live in portal.css.
   The sign-in pages (Login, TwoFactor, TwoFactorSetup, Error) write data-theme="light" in their markup: always Light. The tile page starts Light and
   portal.js paints the theme saved in localStorage 'bisTheme'.

   Scope. Every rule sits inside @media (forced-colors: none), so Windows forced colors keeps the borders the controls had (and gets a border on the ones that had none,
   at the end of the file), and under :root:not([data-theme="high-contrast"]): High Contrast would keep a real border on every control (the Portal never sets it today).
   The selectors are flat (no CSS nesting) so that an older embedded browser does not drop the whole file.
   Behavior table: docs/design/nx-skin-behavior.md. Nothing here touches sign-in behavior: only look. */

@media (forced-colors: none) {

/* ── Page, text, font ── */
:root:not([data-theme="high-contrast"]),
:root:not([data-theme="high-contrast"]) body,
:root:not([data-theme="high-contrast"]) body.login-page {
    background-color: var(--bis-page-bg);
}
:root:not([data-theme="high-contrast"]) body {
    font-family: var(--bis-font);
    font-size: 14px;
    color: var(--bis-fg);
}
/* Inter's digits are proportional: the figures line up digit under digit. */
:root:not([data-theme="high-contrast"]) :is(.login-input, .recovery-codes, .setup-key, .tile-badge) { font-variant-numeric: tabular-nums; }

/* ── The top bar (colors in portal.css .bar): its controls are César's .ib and .btn (K:49, K:53) ── */
:root:not([data-theme="high-contrast"]) .theme { border-radius: var(--bis-radius-btn); }
:root:not([data-theme="high-contrast"]) .quit {
    border-radius: var(--bis-radius-btn);
    min-height: var(--bis-btn-sm-h);
    padding: .3rem .8rem;
    font-weight: 500;
}
:root:not([data-theme="high-contrast"]) :is(.theme, .quit):focus-visible { outline: 2px solid var(--bis-focus); outline-offset: 2px; }

/* ── Tiles: rounded, no border; colors in portal.css (--tile, --tile-dev) ── */
:root:not([data-theme="high-contrast"]) .tile { border: 0; border-radius: var(--bis-radius-box); }
/* The old white halo was invisible on a light page: an outline in the focus color, which also survives forced colors. */
:root:not([data-theme="high-contrast"]) .tile:focus-visible {
    box-shadow: none;
    outline: 3px solid var(--bis-focus);
    outline-offset: 3px;
}
:root:not([data-theme="high-contrast"]) .empty { color: var(--bis-muted); }

/* ── "Under development" dialog: a dialog box, the box edge, 12 px, the shadow ink at 30 % (S:331, S:335) ── */
:root:not([data-theme="high-contrast"]) .notice {
    border: 1px solid var(--bis-box-edge);
    border-radius: var(--bis-radius-box);
    background-color: var(--bis-surface);
    color: var(--bis-text);
    box-shadow: 0 12px 36px color-mix(in srgb, var(--bis-shadow) 30%, transparent);
}
/* The primary button: his .pri with its 1 px edge in the accent (S:162-164, S:215). The text is the accent's INK (dark in Dark), read straight from César's key and
   not through --bis-accent-fg, which bis-tokens.css also sets (#ffffff) under [data-theme="dark"]: if the shared file maps it at a lower specificity, the white
   would win and give 2.6:1 on #6c9cff. Same reason the dialog reads --bis-surface / --bis-text, not --bis-dialog-bg / -fg. */
:root:not([data-theme="high-contrast"]) .notice-ok {
    border: 1px solid var(--bis-accent);
    border-radius: var(--bis-radius-btn);
    min-height: var(--bis-btn-h);
    background-color: var(--bis-accent);
    color: var(--bis-accent-ink);
    font-weight: 500;
}
:root:not([data-theme="high-contrast"]) .notice-ok:hover { background-color: var(--bis-accent-hover); border-color: var(--bis-accent-hover); }
:root:not([data-theme="high-contrast"]) .notice-ok:focus-visible { outline: 2px solid var(--bis-focus); outline-offset: 2px; }

/* ── The card of the sign-in pages: the surface, the box edge, 12 px, no shadow (S:72-76; K:69; D1, D12) ── */
:root:not([data-theme="high-contrast"]) .login-card {
    border: 1px solid var(--bis-box-edge);
    border-radius: var(--bis-radius-box);
    background-color: var(--bis-surface);
    color: var(--bis-fg);
    box-shadow: none;
}
:root:not([data-theme="high-contrast"]) .login-card .brand { color: var(--bis-heading); }
:root:not([data-theme="high-contrast"]) .login-title,
:root:not([data-theme="high-contrast"]) .error-title { color: var(--bis-heading); }
:root:not([data-theme="high-contrast"]) .login-hint,
:root:not([data-theme="high-contrast"]) .error-text,
:root:not([data-theme="high-contrast"]) .error-code { color: var(--bis-muted); opacity: 1; }
:root:not([data-theme="high-contrast"]) .login-hint a { color: var(--bis-link); }

/* Labels: 13 px, 600, muted; Title Case comes from the captions, never text-transform. */
:root:not([data-theme="high-contrast"]) .login-label {
    font-size: var(--bis-label-size);
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--bis-muted);
    opacity: 1;
    margin-bottom: 4px;
}
:root:not([data-theme="high-contrast"]) .login-check { font-size: 14px; color: var(--bis-fg); }

/* ── Fields: FLAT, a 1 px edge on all four sides in the 3:1 field line (W3C 1.4.11), 8 px, 34 px; the focus is the accent edge and a 2 px ring
   in the accent (S:101-132). Until 2026-11-19 a tone with a bottom line drawn as an inset shadow, border 0. ── */
:root:not([data-theme="high-contrast"]) .login-input {
    border: 1px solid var(--bis-field-line);
    border-radius: var(--bis-radius-field);
    min-height: var(--bis-field-h);
    padding: .45rem var(--bis-field-pad-x);
    background-color: var(--bis-field-bg);
    color: var(--bis-fg);
    box-shadow: none;
    font-size: 14px;
}
:root:not([data-theme="high-contrast"]) .login-input::placeholder { color: var(--bis-muted); opacity: 1; }
:root:not([data-theme="high-contrast"]) .login-input:hover:not(:focus, :disabled, [readonly]) { background-color: var(--bis-field-hover-bg); }
:root:not([data-theme="high-contrast"]) .login-input:focus {
    background-color: var(--bis-field-focus-bg);
    border-color: var(--bis-focus);
    box-shadow: none;
    outline: var(--bis-field-ring-w) solid var(--bis-focus);
    outline-offset: var(--bis-field-ring-offset);
}
/* Read-only / disabled: the second surface with the light edge (S:140-145). */
:root:not([data-theme="high-contrast"]) .login-input:is(:disabled, [readonly]) {
    background-color: var(--bis-surface2);
    border-color: var(--bis-field-edge-color);
    color: var(--bis-muted);
}
/* Chrome's autofill paints its own near-white fill and dark text with !important, so a background here does nothing: it is covered with a big inner shadow in the
   field's tone. The edge is the border now, so no line has to be drawn in the shadow. The two selector lists stay separate: one the browser does not know would void
   its whole list. */
:root:not([data-theme="high-contrast"]) .login-input:-webkit-autofill,
:root:not([data-theme="high-contrast"]) .login-input:-webkit-autofill:hover,
:root:not([data-theme="high-contrast"]) .login-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--bis-fg);
    -webkit-box-shadow: 0 0 0 100px var(--bis-field-bg) inset;
            box-shadow: 0 0 0 100px var(--bis-field-bg) inset;
    caret-color: var(--bis-fg);
}
:root:not([data-theme="high-contrast"]) .login-input:autofill,
:root:not([data-theme="high-contrast"]) .login-input:autofill:hover,
:root:not([data-theme="high-contrast"]) .login-input:autofill:focus {
    -webkit-text-fill-color: var(--bis-fg);
    -webkit-box-shadow: 0 0 0 100px var(--bis-field-bg) inset;
            box-shadow: 0 0 0 100px var(--bis-field-bg) inset;
    caret-color: var(--bis-fg);
}

/* The eye that shows the password: the muted tone on the field. */
:root:not([data-theme="high-contrast"]) .bis-eye { color: var(--bis-muted); opacity: 1; border-radius: var(--bis-radius-field); }
:root:not([data-theme="high-contrast"]) .bis-eye:hover { color: var(--bis-fg); background-color: var(--bis-hover-bg); }
:root:not([data-theme="high-contrast"]) .bis-eye:focus-visible { outline: 2px solid var(--bis-focus); outline-offset: 1px; }

/* The check box: the light tone with the field line, the tick in the accent (G-21: rules unchanged). */
:root:not([data-theme="high-contrast"]) .login-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    flex: none;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 0;
    border-radius: 4px;
    background-color: var(--bis-check-bg);
    box-shadow: inset 0 0 0 1px var(--bis-field-line);   /* A 1 px line, the border width stays 0 (Ricardo, 2026-11-06: the tone alone is 1.4:1, W3C asks 3:1). */
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
}
:root:not([data-theme="high-contrast"]) .login-check input[type="checkbox"]:hover:not(:checked) { background-color: var(--bis-field-hover-bg); }
:root:not([data-theme="high-contrast"]) .login-check input[type="checkbox"]:checked {
    background-color: var(--bis-accent);
    box-shadow: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
:root:not([data-theme="high-contrast"]) .login-check input[type="checkbox"]:focus-visible { outline: 2px solid var(--bis-focus); outline-offset: 2px; }

/* ── Buttons: the primary is his .pri, the accent with a 1 px edge in the accent, 36 px, 8 px corners (S:162-164, S:215) ── */
:root:not([data-theme="high-contrast"]) .login-button {
    border: 1px solid var(--bis-accent);
    border-radius: var(--bis-radius-btn);
    min-height: var(--bis-btn-h);
    background-color: var(--bis-accent);
    color: var(--bis-accent-ink);
    font-size: 14px;
    font-weight: 500;
}
:root:not([data-theme="high-contrast"]) .login-button:hover { background-color: var(--bis-accent-hover); border-color: var(--bis-accent-hover); }
:root:not([data-theme="high-contrast"]) .login-button:focus-visible { outline: 2px solid var(--bis-focus); outline-offset: 2px; }
/* The same class is an <a> on the "Back" buttons: centred in its 36 px. */
:root:not([data-theme="high-contrast"]) a.login-button { display: flex; align-items: center; justify-content: center; text-decoration: none; }

/* ── Messages: BIS Next's tone pairs, no edge, no stripe, 8 px (S:342-353; D12). The message text and role="alert" / "status" say what it is. ── */
:root:not([data-theme="high-contrast"]) .login-error {
    border: 0;
    border-radius: 8px;
    box-shadow: none;
    padding: 12px 14px;
    background-color: var(--bis-bad-bg);
    color: var(--bis-bad-text);
    font-weight: 500;
}
:root:not([data-theme="high-contrast"]) .login-ok {
    border: 0;
    border-radius: 8px;
    padding: 12px 14px;
}
/* "Required" notice: the warn pair; its amber stripe is gone (D12). */
:root:not([data-theme="high-contrast"]) .login-required {
    border: 0;
    border-radius: 8px;
    box-shadow: none;
    padding: 12px 14px;
    background-color: var(--bis-warn-bg);
    color: var(--bis-warn-text);
}
/* The divider between the operations of the security page: the row line, not a box border. */
:root:not([data-theme="high-contrast"]) .setup-sep { border-top-color: var(--bis-line); opacity: 1; }

/* ── The key, the recovery codes, an error id: read-only boxes, the light edge on the second surface (S:140-145), monospaced as before ── */
:root:not([data-theme="high-contrast"]) .setup-key,
:root:not([data-theme="high-contrast"]) .recovery-codes,
:root:not([data-theme="high-contrast"]) .error-code code {
    border: 1px solid var(--bis-field-edge-color);
    background-color: var(--bis-surface2);
    color: var(--bis-fg);
    border-radius: var(--bis-radius-field);
}
:root:not([data-theme="high-contrast"]) .setup-qr { border-radius: var(--bis-radius-field); box-shadow: 0 0 0 1px var(--bis-box-edge); }

}

/* Phone width: the bar (brand, theme, name, Security, Sign out) came to about 455 px and pushed the page 80 px wider than a 375 px screen (measured before this file too).
   It becomes two rows: the brand and the theme button on top, the name and the two buttons below. Layout only; no control is removed or renamed. */
@media (max-width: 640.98px) {
    .bar { flex-wrap: wrap; gap: .5rem .5rem; padding: .6rem 1rem; }
    .bar > .brand { flex: 1 1 auto; min-width: calc(100% - 3.2rem); }
    .bar > .theme { margin-left: 0; }
    .bar > .who { order: 3; flex: 1 1 auto; min-width: 0; margin-left: 0; }
    .bar > .quit, .bar > .quit-form { order: 3; }
    .bar > .who + .quit-form { margin-left: 0; }
    .bar > .theme + .quit, .bar > .brand + .quit-form { margin-left: auto; }
}

/* Windows forced colors drops fills and shadows, so a control drawn by a tone would disappear: every control and box gets a real border, in every theme. */
@media (forced-colors: active) {
    .login-input, .login-button, .quit, .theme, .tile, .notice-ok, .login-check input[type="checkbox"], .bis-eye { border: 1px solid ButtonText; }
    .login-card, .notice, .aviso, .login-error, .login-ok, .login-required, .setup-key, .recovery-codes, .tile-badge { border: 1px solid CanvasText; }
}
