/* File US Taxes portal theme v1 (Atlas -> Keeper, apply only, no redesign).
   Load AFTER /assets/styles.css (one extra <link>, no inline styles, CSP-safe).
   Matches fileustaxes.com: palm-green header/footer, warm cream page, white cards,
   deep-green headings, teal links, gold pill primary button, Segoe UI stack.
   Values taken from the live site (computed styles 2026-11-28) and packages/ui/tokens.css.
   Contrast checked AA: ink #203528 on cream 11.9:1, ink on gold 4.97:1, white on green 7.9:1, teal #0a6e68 on cream 5.5:1. */

:root {
  --bg: #faf3e1;             /* page = website cream */
  --surface: #ffffff;        /* cards, tables */
  --surface-soft: #f3ead0;   /* table header, quiet areas */
  --text: #203528;           /* website ink */
  --muted: #6b6250;
  --primary: #145c3c;        /* palm green (headings, focus) */
  --primary-hover: #0f4a30;
  --primary-text: #ffffff;
  --border: #937d49;         /* strong edge (inputs) */
  --border-soft: #e2d6b3;    /* decorative card edge */
  --focus: #0a6e68;
  --teal: #0a6e68;
  --teal-light: #dff5f1;
  --hdr-bg: #145c3c;
  --hdr-text: #ffffff;
  --gold: #d9901f;
  --gold-hover: #c07f17;
  --ok: #1f7a4d;  --ok-bg: #e6f3ec;
  --error: #b3401f; --error-bg: #fbe8e1;
  --warn: #6b4500; --warn-bg: #fff1d6;
  --info: #0a6e68; --info-bg: #dff5f1;
  --radius: 8px;             /* controls */
  --radius-card: 14px;       /* cards, like the website */
  --radius-pill: 999px;
  --max: 70rem;
}

body { font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }

/* Type */
h1, h2, h3 { color: #145c3c; line-height: 1.25; }
h1 { font-size: clamp(1.75rem, 3.2vw, 2.25rem); margin: 0 0 1rem; }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); }
h3 { font-size: 1.15rem; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: #08524e; text-decoration: underline; }
.lead { font-size: 1.15rem; color: #3a4d40; max-width: 40rem; }
.muted, .help { color: var(--muted); }

/* Header: same green bar as the website, 64 px */
.site-header { background: #145c3c; box-shadow: 0 1px 0 rgba(0,0,0,.08); }
.wordmark, span.wordmark, span.wordmark[aria-current="page"] { font-size: 1.15rem; opacity: 1; color: #fff; }
.hdr-nav a[aria-current="page"], .hdr-nav span[aria-current="page"] { background: rgba(255,255,255,.16); }
.hdr-nav a:hover, .hdr-signin:hover, .hdr-lang:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.hdr-lang { text-decoration: underline; font-weight: 600; }
.btn-cta { background: var(--gold); color: #203528; font-weight: 700; border-radius: var(--radius-pill); padding: 0 1.4rem; }
.btn-cta:hover { background: var(--gold-hover); color: #203528; text-decoration: none; }
.hdr-burger, .menu-toggle { background: rgba(255,255,255,.15); border-radius: 8px; color: #fff; }
.hdr-drawer { background: #145c3c; border-radius: 0 0 var(--radius-card) var(--radius-card); }

/* Banner and status: soft teal strip like the site's prelaunch banner */
.banner { background: var(--teal-light); color: #203528; font-weight: 500; font-size: .9rem; padding: .4rem 1rem; }
.status-strip { background: var(--teal-light); color: #203528; }

/* Content */
main { padding: 2rem 1.5rem 3rem; }
.page-body { margin-top: 1rem; }

/* Buttons: gold pill is the one primary, ghost/secondary = outlined pill */
.btn { border-radius: var(--radius-pill); border: 2px solid #145c3c; color: #145c3c; background: transparent; font-weight: 700; padding: .65rem 1.5rem; }
.btn:hover { background: #145c3c; color: #fff; text-decoration: none; }
.btn-primary, .btn-lg.btn-primary { background: var(--gold); border-color: var(--gold); color: #203528; }
.btn-primary:hover { background: var(--gold-hover); border-color: var(--gold-hover); color: #203528; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--teal); }
.btn-ghost:hover { background: var(--teal-light); color: #08524e; }
.btn-lg { min-height: 52px; font-size: 1.05rem; }

/* Forms */
input, select, textarea { background: #fff; color: var(--text); border: 1px solid #b9a770; border-radius: var(--radius); max-width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: 3px solid rgba(10,110,104,.25); outline-offset: 0; }
.field label, .auth-card label, .qn-q legend, .hf-field label { font-weight: 600; color: var(--text); display: block; margin-bottom: .25rem; }
.help { font-size: .92rem; }
.error-box, .qn-error { background: var(--error-bg); color: var(--error); border-radius: var(--radius); }

/* Cards: white, 14 px radius, soft warm edge, light shadow (website cards) */
.auth-card, .role-card, .ow-card, .wb-card, .wb-dialog, .ow-dialog, .info-box, .yr-item, .bank-offer {
  background: #fff; border: 1px solid var(--border-soft); border-radius: var(--radius-card); box-shadow: 0 2px 10px rgba(32,53,40,.06); }
.auth-card { padding: 2rem 1.75rem; }
.role-card:hover, .role-card:focus { border-color: var(--teal); box-shadow: 0 4px 16px rgba(10,110,104,.15); }
.info-box { background: var(--teal-light); color: #203528; box-shadow: none; }
.ow-card, .wb-card { padding: 1rem 1.25rem; }
.ow-card h3, .wb-card-label { color: var(--muted); font-size: .9rem; font-weight: 600; }
.wb-card-count { color: #145c3c; font-size: 1.9rem; font-weight: 700; }

/* Tables and badges */
.table-wrap, .wb-table-wrap { background: #fff; border: 1px solid var(--border-soft); border-radius: var(--radius-card); overflow: auto; }
th { background: var(--surface-soft); color: #145c3c; }
th, td { border-bottom: 1px solid var(--border-soft); }
.badge-ok { color: #1f7a4d; background: var(--ok-bg); border-color: transparent; }
.badge-warn { color: #6b4500; background: var(--warn-bg); border-color: transparent; }
.badge-error { color: #b3401f; background: var(--error-bg); border-color: transparent; }
.badge-info, .badge-neutral { color: #0a6e68; background: var(--teal-light); border-color: transparent; }
progress { accent-color: #145c3c; }

/* Footer: same green band as the website, light text */
.site-footer { background: #145c3c; color: #cfd9dd; border-top: 0; padding: 1.5rem; }
.site-footer a { color: #fff; }
.site-footer p { margin: 0 auto; max-width: var(--max); padding: 0 1.5rem; }
.site-footer { padding: 1.5rem 0; }

/* Focus */
:focus-visible { outline: 3px solid #0a6e68; outline-offset: 2px; }
.hdr-inner :focus-visible, .site-footer :focus-visible { outline-color: #ffffff; }

@media (max-width: 599px) {
  main { padding: 1.25rem 1rem 2rem; }
  .auth-card { padding: 1.5rem 1.25rem; }
}

/* Phone header: fits 390 px with no sideways scroll (Sign in + language live in the drawer) */
@media (max-width: 899px) {
  .btn-cta { padding: 0 1rem; font-size: .88rem; }
  .hdr-inner { gap: .75rem; padding: 0 1rem; }
}
@media (max-width: 480px) {
  .hdr-signin { display: none; }
  .hdr-right { margin-left: auto; }
}
@media (max-width: 420px) {
  .wordmark, span.wordmark, span.wordmark[aria-current="page"] { font-size: 1rem; }
  #site-header .brand { font-size: 0.875rem; } /* F44: prevent brand overflow at 390px */
  .btn-cta { padding: 0 .8rem; font-size: .84rem; }
  .hdr-inner { gap: .5rem; }
}

/* Role picker: 3 + 2 on desktop, 2 on tablet, 1 on phone (no lonely fifth card in a row of four) */
.role-cards { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.role-card { min-height: 8rem; }
@media (max-width: 899px) { .role-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 599px) { .role-cards { grid-template-columns: 1fr; } }

/* New element for the home page eyebrow (small label above the h1), same as the website's "REFER & EARN" */
.eyebrow { color: #0a6e68; font-size: .85rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 .5rem; }

/* ── App header: single-row flex layout (targets /app index.html, not public pages) ── */
#site-header {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  padding: 0 1.5rem;
  gap: 1rem;
  min-height: 56px;
}
#site-header .brand { flex-shrink: 0; }
#site-header .site-nav { flex: 1; overflow-x: auto; overflow-y: visible; min-width: 0; }
#site-header .nav-list { flex-direction: row; flex-wrap: nowrap; }
#site-header .nav-list a { background: rgba(255,255,255,.12); border-radius: 6px; padding: 0.35rem 0.9rem; color: #fff; font-size: 0.95rem; white-space: nowrap; }
#site-header .nav-list a[aria-current="page"] { background: rgba(255,255,255,.24); font-weight: 600; }
#site-header .nav-list a:hover { background: rgba(255,255,255,.18); text-decoration: none; }
#site-header .header-actions { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; flex-wrap: nowrap; }

/* ── Partner stats cards (REQ-1757) ── */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 1.25rem 0;
}
.card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: 0 1px 4px rgba(32,53,40,.06);
}
.card-label {
  font-size: 0.75rem;
  color: #476b3d;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.card-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #145c3c;
  line-height: 1.1;
}

/* ── Partner dashboard: weekly chart SVG (REQ-1416 R3, label fix REQ-1757) ── */
/* max-width: cap the SVG so date labels don't scale to giant size on wide screens */
.chart { display: block; max-width: 420px; height: auto; overflow: visible; }
section[aria-labelledby="partner-chart-heading"] { max-width: 480px; }
.chart .axis { stroke: #c8d5c0; stroke-width: 1; }
.chart .bar.bar-signups { fill: #145c3c; }
.chart .bar.bar-filed { fill: #d9901f; }
/* Chart legend color swatches */
.legend { display: flex; gap: 1rem; margin: 0.5rem 0 1rem; align-items: center; }
.bar-key {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--text);
}
.bar-key::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}
.bar-key.bar-signups::before { background: #145c3c; }
.bar-key.bar-filed::before { background: #d9901f; }
/* Chart empty-state note */
.chart-empty { color: var(--muted); font-size: 0.9rem; margin: 0.5rem 0; }

/* ── Partner code/link display (REQ-1757) ── */
.code-url-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin: 0.25rem 0 0.5rem; }
.code-url { font-family: "Courier New", monospace; font-size: 0.9rem; color: #145c3c; word-break: break-all; }
.code-copy { font-size: 0.8rem; }

/* ── Partner dashboard: QR tile (REQ-1416 R3) — constrain width so it doesn't go full-bleed */
.kit-qr-tile { max-width: 220px; }
.kit-qr-tile svg { width: 100%; height: auto; display: block; }
/* ── QR caption from Atlas qr-caption.json (REQ-0230/REQ-1426) ── */
.kit-qr-points-headline { font-size: 0.9rem; font-weight: 600; color: var(--text, #1a2820); margin: 0.5rem 0 0.25rem; }
.kit-qr-points { margin: 0 0 0 1rem; padding: 0; list-style: disc; font-size: 0.85rem; color: var(--muted, #476b3d); }
.kit-qr-points li { margin: 0.1rem 0; }

/* ── Responsive: tablet + phone header + 2-column cards (REQ-1901) ── */
@media (max-width: 899px) {
  /* Tablet / phone: hide email label (too long for narrow header), shrink brand text */
  #site-header { padding: 0 1rem; gap: 0.75rem; min-height: 48px; }
  #site-header .user-label { display: none !important; }
  #site-header .brand { flex-shrink: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
  #site-header .header-actions { flex-shrink: 0; gap: 0.4rem; }
  #site-header .header-actions .btn { font-size: 0.82rem; padding: 0.3rem 0.6rem; min-height: 36px; white-space: nowrap; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .card-value { font-size: 1.25rem; }
}
@media (max-width: 599px) {
  /* Phone: single-row header (brand + Menu + lang + sign-out) at 390px, no sideways scroll.
     Site-nav hidden by default; Menu button toggles .nav-open -> dropdown below header. */
  #site-header { padding: 0 0.875rem; gap: 0.5rem; position: relative; }
  /* Hide the tab nav from the header row on phone */
  #site-header .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: #0f4f33;
    z-index: 200;
    padding: 0.5rem 0.875rem;
    overflow-x: auto;
  }
  /* Reveal as a full-width dropdown when Menu is clicked */
  #site-header.nav-open .site-nav { display: flex; }
  /* Stack tabs vertically in the drawer for readability */
  #site-header .nav-list { flex-direction: column; gap: 0.25rem; }
  #site-header .nav-list a { font-size: 0.9rem; padding: 0.4rem 0.75rem; }
  /* Shrink brand text to leave room for Menu + lang + sign-out */
  #site-header .brand { max-width: none; font-size: 0.875rem; }
  /* Shrink Menu toggle button */
  #site-header #menu-toggle { font-size: 0.8rem; padding: 0.25rem 0.65rem; min-height: 30px; }
  /* Shrink action buttons (lang / sign-out) — critical for ES ("Cerrar sesión" is long) */
  #site-header .header-actions { gap: 0.25rem; }
  #site-header .header-actions .btn { font-size: 0.75rem; padding: 0.25rem 0.5rem; min-height: 30px; white-space: nowrap; }
  /* Partner stats cards */
  .cards { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .card { padding: 0.6rem 0.75rem; }
  .card-value { font-size: 1.1rem; }
  .chart { max-width: 100%; }
  section[aria-labelledby="partner-chart-heading"] { max-width: 100%; }
}

/* Mobile nav: ensure menu-toggle icon (hamburger ☰) is always white on the green header */
.menu-toggle, .hdr-burger { color: #fff !important; border: none; }
button.menu-toggle[aria-expanded] { background: rgba(255,255,255,.18); }

/* Focus: remove blue ring on programmatic focus of main/section (keyboard nav keeps :focus-visible) */
main:focus { outline: none; }
/* Suppress browser default focus ring on elements focused programmatically (tabindex="-1"):
   keyboard users keep :focus-visible which uses our teal color above. */
[tabindex="-1"]:focus { outline: none !important; }

/* BRIEF-013 item 8: sign-in page — bright blue highlight box around the main heading */
.sign-in-box {
  background: #1a73e8;
  color: #fff;
  border-radius: 10px;
  padding: 1.5rem 2rem;
  margin: 0 0 1.75rem;
  display: inline-block;
  min-width: min(100%, 420px);
}
.sign-in-box h1 {
  margin: 0;
  color: inherit;
  font-size: 2rem;
  line-height: 1.2;
}
@media (max-width: 600px) {
  .sign-in-box { padding: 1rem 1.25rem; }
  .sign-in-box h1 { font-size: 1.5rem; }
}

/* REQ-2215 item 8: share kit message_* copy blocks */
.kit-msg-item { margin-bottom: 1.25rem; }
.kit-msg-label { font-weight: 600; margin: 0 0 0.25rem; font-size: 0.95rem; color: var(--color-text); }
.kit-msg-text { width: 100%; font-family: inherit; font-size: 0.9rem; line-height: 1.5; padding: 0.5rem 0.75rem; border: 1px solid var(--color-border); border-radius: 6px; resize: vertical; background: var(--color-bg-alt, #f8f9fa); color: var(--color-text); box-sizing: border-box; }
.kit-msg-item .btn-sm { margin-top: 0.4rem; font-size: 0.85rem; padding: 0.3rem 0.75rem; }

/* REQ-1426: dashboard layout — center column, full width use */
.page-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 0.5rem;
}
.dashboard-section {
  margin-bottom: 2rem;
}
/* summary-card aliases to the existing .card system (REQ-1426 label+value spacing) */
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin: 1.25rem 0; }
.summary-card { background: #fff; border: 1px solid var(--border-soft); border-radius: var(--radius-card); padding: 0.875rem 1rem; display: flex; flex-direction: column; gap: 0.25rem; box-shadow: 0 1px 4px rgba(32,53,40,.06); }
@media (max-width: 899px) { .summary-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 599px) { .summary-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; } .summary-card { padding: 0.6rem 0.75rem; } }

/* REQ-1426: eye toggle for password fields */
.pw-field-wrap { position: relative; display: flex; align-items: center; }
.pw-field-wrap input { flex: 1; padding-right: 2.5rem; }
.pw-eye-btn { position: absolute; right: 0.5rem; background: none; border: none; cursor: pointer; color: #476b3d; font-size: 1rem; padding: 0; line-height: 1; }

/* REQ-1426: password rules hint */
.pw-rules { font-size: 0.8rem; color: var(--muted, #6b7584); margin: 0.25rem 0 0; list-style: none; padding: 0; }
.pw-rules li { margin: 0; padding: 0; }
.pw-rules li.ok { color: #145c3c; }
.pw-rules li.ok::before { content: "✓ "; }
.pw-rules li.fail::before { content: "• "; }

/* REQ-1426: secure notice — no emoji dependency */
.fut-secure-notice { font-size: 0.8rem; color: #145c3c; background: #f0f7f2; border: 1px solid #c8e0d0; border-radius: 6px; padding: 0.4rem 0.75rem; margin: 0.5rem 0 1rem; display: flex; align-items: center; gap: 0.4rem; }
.fut-secure-icon { width: 14px; height: 14px; flex-shrink: 0; }
