/* IronsideMenu — Ironside Brand System 2026 (IronsideWeb/handover/docs/BRAND-GUIDE.md §4).
   Loaded after the Menu's own stylesheet (injected by backend/firm.py). The Menu's theme provider
   toggles `.dark` on <html>; light is the default. Both blocks below re-declare EVERY token the Menu
   defines (frontend-react/src/index.css), because Ironside's :root comes later than Armada's .dark at
   equal specificity: a token missing from the .dark block below would leak the light value into dark.
   Every text/ground pair is computed to WCAG AA (table in .superpowers/sdd/menu-fix-2026-10-06.md). */

@font-face { font-family: "Montserrat"; src: url("/brand/fonts/Montserrat-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Radiant Charisma"; src: url("/brand/fonts/RadiantCharisma-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Radiant Charisma"; src: url("/brand/fonts/RadiantCharisma-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Radiant Charisma"; src: url("/brand/fonts/RadiantCharisma-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }

/* LIGHT — cream ground (the guide's light surface), white cards, charcoal ink, plum tint as the
   secondary/hover surface. Gold #DAB96C is 1.9:1 on white, so text and links use a darkened gold
   (#80621C, 5.7:1 on white); gold stays a FILL behind charcoal text on primary buttons (9.7:1). */
:root {
	--font-sans: "Montserrat", system-ui, -apple-system, sans-serif;
	--font-display: "Radiant Charisma", "Bodoni Moda", Georgia, serif;

	--background: #F5F2EB;          /* cream */
	--foreground: #141613;          /* charcoal */
	--card: #FFFFFF;
	--card-foreground: #141613;
	--popover: #FFFFFF;
	--popover-foreground: #141613;
	--primary: #80621C;             /* dark gold: links, active nav, switches, badges */
	--primary-foreground: #FFFFFF;
	--secondary: #EFE7EC;           /* plum tint */
	--secondary-foreground: #2B1629;/* plum */
	--muted: #EEEAE2;
	--muted-foreground: #57554F;
	--accent: #EFE7EC;              /* plum tint — hover surface */
	--accent-foreground: #2B1629;
	--destructive: #AC3328;
	--destructive-foreground: #FFFFFF;
	--border: #DDD7CC;
	--input: #D3CDC1;
	--ring: #80621C;

	--bg-0: #F5F2EB;
	--bg-1: #FFFFFF;
	--bg-2: #EEEAE2;
	--bg-3: #E2DCD1;
	--border-soft: #E9E4DA;
	--ink: #141613;
	--ink-muted: #4A4944;
	--ink-dim: #625F59;
	--accent-hover: #6A5117;
	--accent-soft: #F3ECDC;
	--ok: #3D6A2E;                  /* sage, darkened for text on cream */
	--warn: #85570A;
	--err: #AC3328;

	--chart-pos: #2E5A7A;           /* navy-blue */
	--chart-neg: #8E3B5E;           /* plum-rose */
	--lang-1: #80621C;
	--lang-2: #2E5A7A;
	--lang-3: #4F7A3E;
	--lang-4: #6B2A5F;
	--lang-5: #B4692A;
	--lang-other: #A19D95;
}

/* DARK — charcoal/navy grounds, plum/dusk surfaces, gold accent used sparingly (60/30/10). */
.dark {
	--background: #141613;          /* charcoal — the 60% */
	--foreground: #F5F2EB;          /* cream */
	--card: #16202A;                /* navy */
	--card-foreground: #F5F2EB;
	--popover: #16202A;
	--popover-foreground: #F5F2EB;
	--primary: #DAB96C;             /* gold — the 10%: buttons, focus, active nav */
	--primary-foreground: #141613;
	--secondary: #2B1629;           /* plum — the lead primary of the guide, as surface */
	--secondary-foreground: #F5F2EB;
	--muted: #1D2833;
	--muted-foreground: #B9B5AE;    /* steel lifted to AA for body text */
	--accent: #332731;              /* dusk — hover surface */
	--accent-foreground: #F5F2EB;
	--destructive: #F37068;
	--destructive-foreground: #141613;
	--border: #2E3742;
	--input: #2E3742;
	--ring: #DAB96C;

	--bg-0: #141613;
	--bg-1: #16202A;
	--bg-2: #1D2833;
	--bg-3: #332731;
	--border-soft: #222A33;
	--ink: #F5F2EB;
	--ink-muted: #B9B5AE;
	--ink-dim: #A3A19D;
	--accent-hover: #E6C985;
	--accent-soft: #2B1629;
	--ok: #7EA16B;                  /* sage, from the guide */
	--warn: #DAB96C;
	--err: #F37068;                 /* 4.97:1 even on the dusk hover surface */

	--chart-pos: #7FA7C9;
	--chart-neg: #C77DA6;
	--lang-1: #DAB96C;
	--lang-2: #6F9CC4;
	--lang-3: #7EA16B;
	--lang-4: #B07BA8;
	--lang-5: #D08C5A;
	--lang-other: #5A5F66;
}

html, body { background: var(--background); color: var(--foreground); }

/* ── Login (2026-10-06 redesign) ─────────────────────────────────────────────────
   Calm like the new ArmadaChat shell: one plain surface (white, per Kruz), the form floating free, roomy
   rounded fields. The one bold element is the brand panel: the guide's "plum brushed"
   ground (§4.4: #2B1629 highlights → #070408, brushed streak, fine grain) with the mark
   crisp, not ghosted. Gold is the 10%: the passkey button and focus rings only.
   Tailwind v4 utilities sit in @layer utilities; these rules are unlayered, so they win
   without !important. Armada's login never loads this file. */

/* Brand panel */
.login-brandpanel, .dark .login-brandpanel {
	color: #F5F2EB;
	background:
		url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
		linear-gradient(112deg, rgba(245, 242, 235, 0) 38%, rgba(245, 242, 235, 0.045) 47%, rgba(245, 242, 235, 0) 56%),
		radial-gradient(90% 70% at 18% 8%, #3A1E37 0%, rgba(58, 30, 55, 0) 60%),
		linear-gradient(180deg, #2B1629 0%, #120A12 62%, #070408 100%);
}
.login-panel-mark, .dark .login-panel-mark {
	opacity: 0.42;
	right: -14%;
	bottom: -10%;
	width: min(620px, 86%);
	-webkit-mask-image: linear-gradient(200deg, #000 30%, transparent 92%);
	mask-image: linear-gradient(200deg, #000 30%, transparent 92%);
	filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.55));
}
.login-wordmark { font-family: var(--font-display); font-weight: 500; letter-spacing: 0.005em; }
@media (min-width: 1024px) {
	.login-wordmark { font-size: 60px; }
	.login-wordmark + p { font-size: 17px; opacity: 0.72; max-width: 24ch; }
}
/* The small mark leads only on phones, where the large one is cropped away (see the media query). */
.login-wordmark::before {
	content: "";
	display: none;
	width: 52px;
	height: 52px;
	margin-bottom: 28px;
	background: url("/brand/img/ironside-mark.webp") center / contain no-repeat;
}
.login-brandpanel > p:last-child { color: #A3A19D; opacity: 1; }

/* Form side: plain white in BOTH themes (Kruz 2026-10-06); no grid, no theme toggle on the login. */
.login-ground, .dark .login-ground {
	background: #FFFFFF;
	color-scheme: light;
	/* Light tokens for the form side, so it stays white even when the saved theme is dark. */
	--foreground: #141613;
	--card-foreground: #141613;
	--muted-foreground: #5F5E5A;   /* 6.4:1 on white */
	--border: #E4E0D8;
	--input: #D6D1C7;
	--ring: #B8964A;
	--err: #B4382C;                /* 5.9:1 on white; the dark palette's #F0625A is 3:1 here */
	color: #141613;
}
.login-grid, .dark .login-grid { display: none; }
.login-ground > .absolute.right-4.top-4 { display: none; }

/* The form floats: no card frame. */
.login-ground [data-slot="card"] {
	background: transparent;
	border: 0;
	box-shadow: none;
	padding-top: 0;
	padding-bottom: 0;
}
.login-ground [data-slot="card-content"] { padding-left: 0; padding-right: 0; }
.login-ground .relative.w-full { max-width: 368px; }
.login-ground h1 {
	font-family: var(--font-display);
	font-weight: 500;
	font-size: 38px;
	line-height: 1.05;
	letter-spacing: 0.005em;
}
.login-ground h1 + p { color: #5F5E5A; font-size: 14px; margin-top: 10px; }
.login-ground [data-slot="card-content"] > div:first-child { margin-bottom: 30px; }
.login-ground form { display: flex; flex-direction: column; gap: 18px; }
.login-ground form > * { margin: 0 !important; }   /* space-y-4 margins → the flex gap above */

/* Fields */
.login-ground [data-slot="label"] { font-size: 13px; font-weight: 500; color: #2A2C28; }
.login-ground .space-y-1\.5 > * + * { margin-top: 8px; }
.login-ground [data-slot="input"] {
	height: 46px;
	border-radius: 10px;
	padding: 0 14px;
	font-size: 15px;
	color: #141613;
	background: #FFFFFF;
	border: 1px solid #D6D1C7;
	box-shadow: none;
	transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}
.login-ground [data-slot="input"]::placeholder { color: #8E8C87; }
.login-ground [data-slot="input"]:hover { border-color: #BDB7AB; }
.login-ground [data-slot="input"]:focus-visible {
	border-color: #B8964A;
	box-shadow: 0 0 0 3px rgba(218, 185, 108, 0.28);
	background: #FFFFFF;
}
.login-ground [data-slot="input"]:-webkit-autofill {
	-webkit-text-fill-color: #141613;
	box-shadow: 0 0 0 100px #FFFFFF inset;
	caret-color: #141613;
}

/* "or use your password": sentence case in the body face, not mono caps. */
.login-ground form > div[style*="font-mono"] {
	font-family: var(--font-sans) !important;
	text-transform: none;
	letter-spacing: 0;
	font-size: 12.5px;
	color: #6E6D69;
}
.login-ground form > div[style*="font-mono"] > span { background: #E9E5DE; }

/* Remember me */
.login-ground #remember {
	appearance: none;
	-webkit-appearance: none;
	flex: none;
	width: 18px;
	height: 18px;
	margin: 0;
	border-radius: 5px;
	border: 1px solid #BDB7AB;
	background: #FFFFFF;
	cursor: pointer;
	transition: background-color 120ms ease, border-color 120ms ease;
}
.login-ground #remember:checked {
	border-color: #DAB96C;
	background: #DAB96C url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23141613' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / 12px no-repeat;
}
.login-ground #remember:focus-visible { outline: 2px solid #B8964A; outline-offset: 2px; }
.login-ground label:has(#remember) { gap: 10px; color: #4A4A46; font-size: 13.5px; }

/* Buttons: gold for the passkey (the recommended path), quiet outline for password. */
.login-ground [data-slot="button"][data-variant="default"],
.login-ground [data-slot="button"][data-variant="outline"] {
	height: 46px;
	border-radius: 10px;
	font-size: 14.5px;
	font-weight: 600;
	letter-spacing: 0.005em;
	transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.login-ground [data-slot="button"][data-variant="default"] { background: #DAB96C; color: #141613; border: 0; }
.login-ground [data-slot="button"][data-variant="default"]:hover { background: #E6C985; }
.login-ground [data-slot="button"][data-variant="outline"] { background: #FFFFFF; color: #141613; border: 1px solid #CFC9BE; box-shadow: none; }
.login-ground [data-slot="button"][data-variant="outline"]:hover { background: #F5F2EB; border-color: #B5AEA1; }
.login-ground [data-slot="button"]:focus-visible { outline: 2px solid #B8964A; outline-offset: 3px; }
.login-ground [data-slot="button"]:disabled { opacity: 0.55; }

/* Fine print */
.login-ground form > p.border-t { border-top-color: #ECE8E1; padding-top: 18px; color: #6E6D69; }
.login-ground > .relative > p:last-child { color: #6E6D69; }

/* Phone: the panel becomes a compact header; the mark leads it. */
@media (max-width: 1023px) {
	.login-panel-mark, .dark .login-panel-mark { width: 300px; right: -70px; bottom: -150px; opacity: 0.3; }
	.login-wordmark::before { display: block; width: 40px; height: 40px; margin-bottom: 18px; }
	.login-ground h1 { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
	.login-ground * { transition: none !important; }
}

/* ── App surfaces (2026-10-06 light-mode pass) ─────────────────────────────────── */

/* Light: the primary button is a gold FILL with charcoal text (9.7:1), not the dark text-gold. */
html:not(.dark) [data-slot="button"][data-variant="default"] { background: #DAB96C; color: #141613; }
html:not(.dark) [data-slot="button"][data-variant="default"]:hover { background: #CBA957; }

/* Firewall: zero-hit detection rules were dimmed to 45% (2.4-2.7:1). 90% keeps them quieter
   than live rules and still clears AA in both themes. */
tr.opacity-45 { opacity: 0.9; }

/* New-user dialog: the build's placeholder names another firm's domain; hide it here (the Email label
   stays). Platform ids without a label in the build ("drive") read capitalised like their siblings. */
#u-email::placeholder { color: transparent; }
[data-enabled] span.min-w-20 { text-transform: capitalize; }
