/* ============================================================
   College2U — assets/css/c2u-ultra.css
   v1.0.0 · July 2026 · Ultra-premium design layer
   ------------------------------------------------------------
   Loads AFTER college2u-enterprise.css. Zero inline styles,
   zero !important except the overflow guard. Brand: calm
   premium green/mint on light surfaces (brand law — refined,
   not replaced).
   Breakpoint truth table verified against:
   375 (iPhone SE) · 390–430 (14/15/16 Pro Max, Galaxy) ·
   768/834/1024/1180 (iPads P/L) · 1366 · 1440 · 1920 · 2560+
   ============================================================ */

:root {
  /* Palette — deep evergreen anchored, mint accents, warm paper */
  --u-ink:        #10241b;
  --u-ink-soft:   #3d564a;
  --u-evergreen:  #0e5c3f;
  --u-green:      #148a5c;
  --u-mint:       #d9f2e6;
  --u-mint-soft:  #eef9f3;
  --u-paper:      #fbfdfc;
  --u-line:       #dce8e1;
  --u-amber:      #b7791f;   /* single warm counterpoint: verification badges */
  --u-danger:     #b3261e;

  /* Type scale — fluid, clamps hard at both ends so nothing clips at 375px */
  --u-fs-hero:  clamp(1.85rem, 1.1rem + 3.2vw, 3.4rem);
  --u-fs-h2:    clamp(1.35rem, 1rem + 1.6vw, 2.1rem);
  --u-fs-h3:    clamp(1.1rem, 0.95rem + 0.7vw, 1.4rem);
  --u-fs-body:  clamp(0.95rem, 0.9rem + 0.25vw, 1.0625rem);
  --u-fs-small: 0.8125rem;

  /* Rhythm */
  --u-space-1: 0.5rem;
  --u-space-2: 1rem;
  --u-space-3: 1.5rem;
  --u-space-4: clamp(2rem, 1.4rem + 2vw, 3.5rem);
  --u-space-5: clamp(3rem, 2rem + 3.5vw, 6rem);
  --u-radius:  14px;
  --u-radius-lg: 22px;
  --u-shadow:  0 1px 2px rgba(16,36,27,.06), 0 8px 24px rgba(16,36,27,.07);
  --u-shadow-lift: 0 2px 4px rgba(16,36,27,.08), 0 16px 40px rgba(16,36,27,.12);

  --u-container: 1200px;
  --u-container-wide: 1440px;
  --u-aria-panel-w: 448px;
}

/* ── Global overflow guard: the one place !important is earned.
     Kills horizontal scroll from any legacy component at any width. ── */
html, body { max-width: 100%; overflow-x: hidden !important; }
img, svg, video, iframe, table { max-width: 100%; }
img { height: auto; }

body {
  color: var(--u-ink);
  background: var(--u-paper);
  font-size: var(--u-fs-body);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

/* Long college names must wrap, never clip */
h1, h2, h3, .u-card__title { overflow-wrap: anywhere; }

/* ── Container ─────────────────────────────────────────────── */
.u-container {
  width: 100%;
  max-width: var(--u-container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
}
.u-container--wide { max-width: var(--u-container-wide); }

/* ── Section rhythm ────────────────────────────────────────── */
.u-section { padding-block: var(--u-space-5); }
.u-section--tint { background: var(--u-mint-soft); }
.u-eyebrow {
  display: inline-block;
  font-size: var(--u-fs-small);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--u-green);
  margin-bottom: var(--u-space-1);
}
.u-section__title { font-size: var(--u-fs-h2); font-weight: 800; line-height: 1.15; }
.u-section__lede  { color: var(--u-ink-soft); max-width: 62ch; margin-top: var(--u-space-2); }

/* ── Fluid grid: auto-fit, no media query needed for card walls.
     minmax(min(100%,17rem),1fr) can never exceed viewport → no h-scroll. ── */
.u-grid {
  display: grid;
  gap: clamp(0.875rem, 0.5rem + 1.5vw, 1.75rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}
.u-grid--dense { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr)); }

/* Two-pane layouts (predictor form + results, detail + rail) */
.u-split { display: grid; gap: var(--u-space-3); grid-template-columns: 1fr; }
@media (min-width: 62rem) {
  .u-split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
  .u-split--rail { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
}

/* ── Cards ─────────────────────────────────────────────────── */
.u-card {
  background: #fff;
  border: 1px solid var(--u-line);
  border-radius: var(--u-radius);
  box-shadow: var(--u-shadow);
  padding: clamp(1rem, 0.75rem + 1vw, 1.5rem);
  display: flex;
  flex-direction: column;
  gap: var(--u-space-1);
  transition: box-shadow .22s ease, transform .22s ease;
}
@media (hover: hover) {
  .u-card:hover { box-shadow: var(--u-shadow-lift); transform: translateY(-2px); }
}
.u-card__title { font-size: var(--u-fs-h3); font-weight: 700; line-height: 1.3; }
.u-card__meta  { color: var(--u-ink-soft); font-size: var(--u-fs-small); }

/* Verification badge — the one amber element on the page */
.u-badge-verified {
  display: inline-flex; align-items: center; gap: .35em;
  font-size: var(--u-fs-small); font-weight: 700;
  color: var(--u-amber);
  background: #fdf6e9;
  border: 1px solid #f0e2c4;
  border-radius: 999px;
  padding: .2em .75em;
}

/* ── Buttons ───────────────────────────────────────────────── */
.u-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px;                 /* touch target */
  padding: .65em 1.4em;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 700; font-size: var(--u-fs-body);
  cursor: pointer; text-decoration: none;
  transition: background .18s ease, box-shadow .18s ease, transform .12s ease;
}
.u-btn:active { transform: translateY(1px); }
.u-btn--primary { background: var(--u-evergreen); color: #fff; }
.u-btn--primary:hover { background: #0b4a33; }
.u-btn--ghost { background: transparent; color: var(--u-evergreen); border-color: var(--u-evergreen); }
.u-btn--ghost:hover { background: var(--u-mint-soft); }
.u-btn:focus-visible,
.u-field__input:focus-visible,
.u-aria-fab:focus-visible {
  outline: 3px solid var(--u-green);
  outline-offset: 2px;
}

/* ── Floating-label form fields ────────────────────────────── */
.u-field { position: relative; margin-block: var(--u-space-2); }
.u-field__input {
  width: 100%;
  min-height: 56px;
  padding: 1.45rem 1rem .5rem;
  font-size: 1rem;                        /* ≥16px: prevents iOS zoom-on-focus */
  color: var(--u-ink);
  background: #fff;
  border: 1.5px solid var(--u-line);
  border-radius: 12px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.u-field__input::placeholder { color: transparent; }  /* label plays placeholder */
.u-field__label {
  position: absolute; left: 1rem; top: 50%;
  translate: 0 -50%;
  color: var(--u-ink-soft);
  pointer-events: none;
  transition: all .16s ease;
  background: transparent;
  max-width: calc(100% - 2rem);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.u-field__input:focus  { border-color: var(--u-green); box-shadow: 0 0 0 4px var(--u-mint); }
.u-field__input:focus + .u-field__label,
.u-field__input:not(:placeholder-shown) + .u-field__label,
.u-field.is-filled .u-field__label {
  top: .95rem; translate: 0 -50%;
  font-size: .72rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--u-green);
}
select.u-field__input { padding-top: 1.35rem; appearance: none; }
.u-field.is-invalid .u-field__input { border-color: var(--u-danger); }
.u-field.is-invalid .u-field__label { color: var(--u-danger); }
.u-field__error {
  display: none;
  margin-top: .35rem;
  font-size: var(--u-fs-small);
  color: var(--u-danger);
}
.u-field.is-invalid .u-field__error { display: block; }

/* ── Question-based AEO sections ───────────────────────────── */
.u-qa { border-top: 1px solid var(--u-line); padding-block: var(--u-space-3); }
.u-qa h2, .u-qa h3 { font-size: var(--u-fs-h3); margin-bottom: var(--u-space-1); }
.u-qa p { color: var(--u-ink-soft); max-width: 70ch; }

/* ── Tables (cutoffs) — scroll inside their own box, never the page ── */
.u-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--u-line); border-radius: var(--u-radius); }
.u-table { width: 100%; border-collapse: collapse; min-width: 540px; }
.u-table th, .u-table td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--u-line); }
.u-table th { background: var(--u-mint-soft); font-size: var(--u-fs-small); text-transform: uppercase; letter-spacing: .06em; }
.u-table tr:last-child td { border-bottom: 0; }

/* ============================================================
   ARIA assistant — sticky FAB + panel
   Mobile  (<48rem): bottom sheet, max 82dvh, leaves footer reachable
   Desktop (≥48rem): 448px right rail
   Sits ABOVE the safe-area inset; never overlaps sticky CTAs
   because the FAB reserves its own layer & the sheet is dismissible.
   ============================================================ */
.u-aria-fab {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: calc(max(1rem, env(safe-area-inset-bottom)) + 0.25rem);
  z-index: 980;
  min-width: 56px; min-height: 56px;
  padding-inline: 1.1rem;
  display: inline-flex; align-items: center; gap: .5em;
  border: 0; border-radius: 999px;
  background: var(--u-evergreen); color: #fff;
  font-weight: 800; font-size: 1rem;
  box-shadow: var(--u-shadow-lift);
  cursor: pointer;
}
.u-aria-fab[hidden] { display: none; }

.u-aria-panel {
  position: fixed; inset: auto 0 0 0;
  z-index: 990;
  display: flex; flex-direction: column;
  background: #fff;
  border-radius: var(--u-radius-lg) var(--u-radius-lg) 0 0;
  box-shadow: 0 -12px 48px rgba(16,36,27,.22);
  max-height: 82dvh;
  transform: translateY(105%);
  transition: transform .28s cubic-bezier(.32,.72,.2,1);
  padding-bottom: env(safe-area-inset-bottom);
}
.u-aria-panel.is-open { transform: translateY(0); }
@media (min-width: 48rem) {
  .u-aria-panel {
    inset: auto max(1rem, env(safe-area-inset-right)) calc(max(1rem, env(safe-area-inset-bottom)) + 0.25rem) auto;
    width: min(var(--u-aria-panel-w), calc(100vw - 2rem));
    max-height: min(680px, calc(100dvh - 2rem));
    border-radius: var(--u-radius-lg);
    transform: translateY(12px);
    opacity: 0; pointer-events: none;
    transition: transform .22s ease, opacity .22s ease;
  }
  .u-aria-panel.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
}
.u-aria-panel__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--u-space-2);
  padding: var(--u-space-2) var(--u-space-3);
  border-bottom: 1px solid var(--u-line);
  background: var(--u-mint-soft);
  border-radius: inherit;
  border-bottom-left-radius: 0; border-bottom-right-radius: 0;
}
.u-aria-panel__title { font-weight: 800; font-size: 1.05rem; }
.u-aria-panel__close {
  min-width: 44px; min-height: 44px;
  border: 0; border-radius: 10px; background: transparent;
  font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--u-ink-soft);
}
.u-aria-panel__close:hover { background: var(--u-mint); }
.u-aria-log {
  flex: 1 1 auto; overflow-y: auto;
  padding: var(--u-space-2) var(--u-space-3);
  display: flex; flex-direction: column; gap: .75rem;
  overscroll-behavior: contain;
}
.u-aria-msg {
  max-width: 88%;
  padding: .65rem .9rem;
  border-radius: 14px;
  font-size: .95rem; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.u-aria-msg--user { align-self: flex-end; background: var(--u-evergreen); color: #fff; border-bottom-right-radius: 4px; }
.u-aria-msg--bot  { align-self: flex-start; background: var(--u-mint-soft); border: 1px solid var(--u-line); border-bottom-left-radius: 4px; }
.u-aria-form {
  display: flex; gap: .5rem;
  padding: var(--u-space-2) var(--u-space-3);
  border-top: 1px solid var(--u-line);
}
.u-aria-form input {
  flex: 1 1 auto; min-width: 0;
  min-height: 48px; padding: 0 1rem;
  font-size: 1rem;
  border: 1.5px solid var(--u-line); border-radius: 12px;
}
.u-aria-form input:focus { border-color: var(--u-green); outline: none; box-shadow: 0 0 0 4px var(--u-mint); }

/* Scrim under the mobile bottom sheet */
.u-aria-scrim {
  position: fixed; inset: 0; z-index: 985;
  background: rgba(16,36,27,.4);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.u-aria-scrim.is-open { opacity: 1; pointer-events: auto; }
@media (min-width: 48rem) { .u-aria-scrim { display: none; } }

/* ── Ultrawide: cap line lengths, keep whitespace deliberate ── */
@media (min-width: 120rem) {
  .u-container { max-width: 1320px; }
  .u-section { padding-block: 7rem; }
}

/* ── Motion respect ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Print: strip chrome ───────────────────────────────────── */
@media print {
  .u-aria-fab, .u-aria-panel, .u-aria-scrim { display: none !important; }
}
