/* Clarity auth + error pages. Standalone on purpose: these pages must not
   pull the full portal clarity.css. Tokens mirrored from clarity.css :root
   (keep values in sync if the design system changes). */
:root {
  --midnight: #0D1547;
  --midnight-2: #0a1240;
  --midnight-deep: #070b2e;
  --cobalt: #0E3EAA;
  --green: #76CC3E;
  --cyan: #61DCE2;
  --surface: #ffffff;
  --border: #e7e9ee;
  --ink: #0F1419;
  --text: #39414e;
  --muted: #6b7280;
  --on-dark: #eaecf3;
  --on-dark-mut: #9aa3c4;
  --red-ink: #c81e1e;
  --red-bg: #fdf0f0;
  --red-border: #f6d6d6;
  --green-dark: #447a22;
  --green-bg: #eef7e3;
  --green-border: #d2e8b9;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Inter Tight', system-ui, sans-serif;
  --r: 12px;
  --r-in: 8px;
}

* { box-sizing: border-box; }

.ca-shell {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(1100px 520px at 50% -10%, rgba(14, 62, 170, 0.35), transparent 60%),
    linear-gradient(180deg, var(--midnight) 0%, var(--midnight-deep) 100%);
}

.ca-main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

/* Inline brand lockup: aperture mark beside the wordmark, one line — the same
   lockup the Clarity landing nav uses. Kept deliberately quiet; the atmosphere
   carries the personality and the card carries the page's job. */
.ca-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin-bottom: 24px;
}
/* Clarity aperture logomark — open "C" arc + green centre dot */
.ca-mark {
  width: 32px;
  height: 32px;
  flex: none;
}
.ca-mark-c { stroke: #fff; }
.ca-mark-dot { fill: var(--green); }  /* flat green pupil — brand decision 2026-07-20, no glow */
.ca-wordmark {
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--on-dark-mut);
  line-height: 1;
  white-space: nowrap;
}
.ca-wordmark b { font-weight: 700; color: var(--green); }  /* green wordmark — matches portal sidebar + landing nav */

.ca-card {
  width: min(400px, 100%);
  background: var(--surface);
  border-radius: var(--r);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 50px rgba(4, 8, 34, 0.45);
  padding: 28px;
}

.ca-title {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
}
.ca-hint { margin: 0 0 18px; font-size: 13.5px; color: var(--muted); }
.ca-error-text { color: var(--red-ink); }  /* standalone: also used outside .ca-hint (verify_email errors) */

.ca-field { margin-bottom: 12px; text-align: left; }
.ca-field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.ca-input {
  width: 100%;
  height: 40px;
  padding: 8px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-in);
}
.ca-input:focus {
  outline: none;
  border-color: var(--cobalt);
  box-shadow: 0 0 0 3px rgba(14, 62, 170, 0.14);
}
.ca-req { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

.ca-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0 14px;
  font-size: 13px;
}
.ca-check { display: flex; align-items: center; gap: 6px; color: var(--text); }
/* Links inside the white card use cobalt; links on the dark backdrop
   (.ca-links, below the card) use white so they stay legible on Midnight. */
.ca-row a { color: var(--cobalt); text-decoration: none; }
.ca-row a:hover { text-decoration: underline; }
.ca-links a { color: #fff; font-weight: 600; text-decoration: none; }
.ca-links a:hover { text-decoration: underline; }

.ca-btn {
  display: block;
  width: 100%;
  padding: 11px 16px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
  background: var(--cobalt);
  border: none;
  border-radius: var(--r-in);
  cursor: pointer;
}
.ca-btn:hover { background: #0c3593; }
.ca-btn-ghost {
  display: inline-block;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: var(--cobalt);
  text-decoration: underline;
  cursor: pointer;
}

.ca-links { margin-top: 16px; text-align: center; font-size: 13.5px; color: var(--on-dark-mut); }

.ca-alert {
  width: min(400px, 100%);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 11px 14px;
  border-radius: var(--r-in);
  font-size: 13.5px;
}
.ca-alert--ok  { background: var(--green-bg); color: var(--green-dark); border: 1px solid var(--green-border); }
.ca-alert--err { background: var(--red-bg); color: var(--red-ink); border: 1px solid var(--red-border); }
/* Amber "session expired" notice. Renders OUTSIDE .ca-card, directly on the
   dark .ca-shell gradient, so use an OPAQUE light-amber block with the full
   border shorthand (matching the ok/err structure). #92400e on #fdf3e3 ~ 6.4:1,
   passes WCAG AA; there are no amber CSS vars to reuse, so hardcode. */
.ca-alert--warn { background: #fdf3e3; color: #92400e; border: 1px solid #f5d9a8; }
.ca-alert .mdi { font-size: 18px; }

.ca-errcode {
  font-family: var(--mono);
  font-size: 56px;
  font-weight: 500;
  color: var(--on-dark);
  margin: 0 0 2px;
  text-align: center;
}

.ca-footer {
  position: relative;
  z-index: 1;
  padding: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--on-dark-mut);
}

/* ══════════ ATMOSPHERE (Direction A) ══════════
   The landing page's living backdrop behind every auth + error screen:
   masked grid, drifting cobalt/green glow orbs, a faint crosshair, and grain.
   All layers are decorative and non-interactive. */
.ca-atmos {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.ca-glow {
  position: absolute;
  top: 24%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(880px, 120vw);
  height: 680px;
  background: radial-gradient(ellipse at center,
    rgba(14, 62, 170, 0.20) 0%, rgba(118, 204, 62, 0.05) 42%, transparent 70%);
}
.ca-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: radial-gradient(ellipse 85% 78% at 50% 42%, #000 22%, transparent 74%);
  mask-image: radial-gradient(ellipse 85% 78% at 50% 42%, #000 22%, transparent 74%);
}
/* crosshair through the centre */
.ca-atmos::before,
.ca-atmos::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
}
.ca-atmos::before {
  width: 1px;
  height: 130%;
  transform: translate(-50%, -50%);
  background: linear-gradient(to bottom, transparent,
    rgba(118, 204, 62, 0.10) 32%, rgba(118, 204, 62, 0.10) 68%, transparent);
}
.ca-atmos::after {
  width: 130%;
  height: 1px;
  transform: translate(-50%, -50%);
  background: linear-gradient(to right, transparent,
    rgba(14, 62, 170, 0.12) 30%, rgba(14, 62, 170, 0.12) 70%, transparent);
}
.ca-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(52px);
}
.ca-orb--g {
  width: 320px; height: 320px; top: 6%; left: 3%;
  background: radial-gradient(circle, rgba(118, 204, 62, 0.15), transparent 70%);
  animation: ca-drift-g 22s ease-in-out infinite;
}
.ca-orb--c {
  width: 260px; height: 260px; bottom: 6%; right: 5%;
  background: radial-gradient(circle, rgba(14, 62, 170, 0.20), transparent 70%);
  animation: ca-drift-c 27s ease-in-out infinite;
}
@keyframes ca-drift-g {
  0%, 100% { transform: translate(0, 0); }
  40% { transform: translate(28px, -18px); }
  70% { transform: translate(-16px, 22px); }
}
@keyframes ca-drift-c {
  0%, 100% { transform: translate(0, 0); }
  45% { transform: translate(-24px, -26px); }
  75% { transform: translate(18px, 14px); }
}
.ca-grain {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

@media (prefers-reduced-motion: reduce) {
  .ca-orb { animation: none; }
}

/* ══════════ SPLIT LOGIN ══════════
   Sign-in only: dark brand/hero panel on the left, light sign-in pane on the
   right. Every other auth/error screen keeps the centered single-column shell.
   Activated by ca-shell--split on <body> (login.html's shell_mod block). */
.ca-shell--split .ca-main {
  padding: 0;
  display: grid;
  grid-template-columns: 53% 47%;
  align-items: stretch;
}
/* Confine the atmosphere (grid, orbs, crosshair) to the dark hero half. */
.ca-shell--split .ca-atmos { right: 47%; }
/* The hero carries its own copyright line; the global footer returns on
   small screens where the hero collapses to a slim brand band. */
.ca-shell--split .ca-footer { display: none; }

.ca-hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: 40px 56px 32px;
  min-width: 0;
}
.ca-hero .ca-brand { justify-content: flex-start; margin-bottom: 0; }

.ca-hero-mid { margin: auto 0; padding: 48px 0; max-width: 560px; }
.ca-hero-title {
  margin: 0 0 20px;
  font-size: clamp(38px, 4.4vw, 62px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: #fff;
}
.ca-hero-accent { color: var(--green); }
.ca-hero-sub {
  margin: 0 0 26px;
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--on-dark-mut);
  max-width: 42ch;
}
.ca-hero-pills { display: flex; gap: 10px; flex-wrap: wrap; }
.ca-pill {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-dark);
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--r-in);
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}

/* Product tease: one illustrative opportunity card (stage chip + stage
   progress toward proposal + a deal-signals count). Decorative, aria-hidden. */
.ca-tease {
  align-self: flex-end;
  width: min(300px, 100%);
  margin-bottom: 30px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r);
  backdrop-filter: blur(4px);
}
.ca-tease-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.ca-tease-name { font-size: 15px; font-weight: 600; color: #fff; }
.ca-tease-chip {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--green);
  padding: 3px 10px;
  border: 1px solid rgba(118, 204, 62, 0.45);
  border-radius: 999px;
}
.ca-tease-bar {
  height: 4px;
  margin-bottom: 12px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.ca-tease-bar i {
  display: block;
  height: 100%;
  width: 67%; /* POC = stage 4 of the 6-stage lifecycle */
  border-radius: 2px;
  background: linear-gradient(90deg, var(--cobalt), var(--green));
}
.ca-tease-foot { display: flex; justify-content: space-between; align-items: baseline; }
.ca-tease-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-dark-mut);
}
.ca-tease-val { font-family: var(--mono); font-size: 18px; font-weight: 500; color: #fff; }

.ca-hero-foot { font-family: var(--mono); font-size: 11.5px; color: var(--on-dark-mut); }

/* Light sign-in pane */
.ca-pane {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: linear-gradient(180deg, #f6f7fa 0%, #edeff4 100%);
}
.ca-shell--split .ca-card {
  width: min(420px, 100%);
  padding: 34px;
  border-color: var(--border);
  box-shadow: 0 24px 60px rgba(13, 21, 71, 0.12);
}
.ca-shell--split .ca-alert { width: min(420px, 100%); }
.ca-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cobalt);
  margin-bottom: 8px;
}
.ca-shell--split .ca-title { font-size: 24px; }
/* Links below the card sit on the light pane here, not on Midnight. */
.ca-shell--split .ca-links { color: var(--muted); }
.ca-shell--split .ca-links a { color: var(--cobalt); }

/* Wide desktop treatment. The split panes continue to fill the viewport, so
   their contents need to grow with them instead of remaining laptop-sized in
   the middle of a 2K/4K canvas. Keep the existing dimensions below this
   breakpoint, and require enough height for the taller request-access form. */
@media (min-width: 1600px) and (min-height: 900px) {
  .ca-hero {
    padding:
      clamp(48px, 3vw, 96px)
      clamp(64px, 4vw, 128px)
      clamp(40px, 2.5vw, 80px);
  }
  .ca-hero .ca-brand { gap: clamp(11px, 0.7vw, 16px); }
  .ca-hero .ca-mark {
    width: clamp(32px, 1.9vw, 42px);
    height: clamp(32px, 1.9vw, 42px);
  }
  .ca-hero .ca-wordmark { font-size: clamp(19px, 1.15vw, 25px); }

  .ca-hero-mid {
    max-width: 720px;
    padding: clamp(56px, 4vw, 88px) 0;
  }
  .ca-hero-title {
    margin-bottom: clamp(20px, 1.3vw, 30px);
    font-size: clamp(62px, 3.25vw, 88px);
  }
  .ca-hero-sub {
    margin-bottom: clamp(26px, 1.6vw, 36px);
    font-size: clamp(16.5px, 1vw, 21px);
  }
  .ca-hero-pills { gap: clamp(10px, 0.65vw, 14px); }
  .ca-pill {
    padding: clamp(7px, 0.45vw, 10px) clamp(14px, 0.8vw, 20px);
    font-size: clamp(11.5px, 0.62vw, 13.5px);
  }

  .ca-tease {
    width: min(clamp(300px, 16vw, 400px), 100%);
    margin-bottom: clamp(30px, 2vw, 48px);
    padding: clamp(16px, 1vw, 22px) clamp(18px, 1.1vw, 26px);
  }
  .ca-tease-name { font-size: clamp(15px, 0.85vw, 18px); }
  .ca-tease-val { font-size: clamp(18px, 1vw, 22px); }
  .ca-hero-foot { font-size: clamp(11.5px, 0.62vw, 13.5px); }

  /* Centered auth and error surfaces: password/email states, sign-out, and
     403/404/429/500. These retain the atmospheric single-column composition
     while gaining the same legibility and visual weight as the split pages. */
  .ca-shell:not(.ca-shell--split) .ca-main {
    padding:
      clamp(48px, 5vh, 96px)
      clamp(24px, 3vw, 72px);
  }
  .ca-shell:not(.ca-shell--split) .ca-brand {
    gap: clamp(11px, 0.7vw, 16px);
    margin-bottom: clamp(24px, 1.6vw, 36px);
  }
  .ca-shell:not(.ca-shell--split) .ca-mark {
    width: clamp(32px, 1.9vw, 42px);
    height: clamp(32px, 1.9vw, 42px);
  }
  .ca-shell:not(.ca-shell--split) .ca-wordmark {
    font-size: clamp(19px, 1.15vw, 25px);
  }
  .ca-shell:not(.ca-shell--split) .ca-card {
    width: min(clamp(440px, 25vw, 560px), 100%);
    padding: clamp(30px, 1.8vw, 44px);
  }
  .ca-shell:not(.ca-shell--split) .ca-alert {
    width: min(clamp(440px, 25vw, 560px), 100%);
    gap: clamp(10px, 0.65vw, 14px);
    padding: clamp(11px, 0.8vw, 16px) clamp(14px, 1vw, 20px);
    font-size: clamp(13.5px, 0.78vw, 16px);
  }
  .ca-shell:not(.ca-shell--split) .ca-alert .mdi {
    font-size: clamp(18px, 1.1vw, 24px);
  }
  .ca-shell:not(.ca-shell--split) .ca-title {
    margin-bottom: clamp(4px, 0.35vw, 8px);
    font-size: clamp(22px, 1.35vw, 30px);
  }
  .ca-shell:not(.ca-shell--split) .ca-hint {
    margin-bottom: clamp(18px, 1.2vw, 26px);
    font-size: clamp(13.5px, 0.78vw, 16px);
  }
  .ca-shell:not(.ca-shell--split) .ca-field {
    margin-bottom: clamp(12px, 0.8vw, 17px);
  }
  .ca-shell:not(.ca-shell--split) .ca-field label {
    margin-bottom: clamp(4px, 0.3vw, 7px);
    font-size: clamp(12.5px, 0.7vw, 14.5px);
  }
  .ca-shell:not(.ca-shell--split) .ca-input {
    height: clamp(40px, 2.5vw, 50px);
    padding: 10px clamp(12px, 0.8vw, 16px);
    font-size: clamp(14px, 0.8vw, 16px);
  }
  .ca-shell:not(.ca-shell--split) .ca-btn {
    padding: clamp(11px, 0.75vw, 15px) 18px;
    font-size: clamp(14.5px, 0.82vw, 16.5px);
  }
  .ca-shell:not(.ca-shell--split) .ca-btn-ghost,
  .ca-shell:not(.ca-shell--split) .ca-req {
    font-size: clamp(12px, 0.7vw, 14px);
  }
  .ca-shell:not(.ca-shell--split) .ca-links {
    margin-top: clamp(16px, 1vw, 22px);
    font-size: clamp(13.5px, 0.78vw, 16px);
  }
  .ca-shell:not(.ca-shell--split) .ca-errcode {
    margin-bottom: clamp(2px, 0.4vw, 8px);
    font-size: clamp(64px, 4vw, 92px);
  }
  .ca-shell:not(.ca-shell--split) .ca-footer {
    padding: clamp(18px, 1.2vw, 26px);
    font-size: clamp(12px, 0.68vw, 14px);
  }

  .ca-pane {
    padding:
      clamp(48px, 4vh, 72px)
      clamp(32px, 3vw, 80px);
  }
  .ca-shell--split .ca-card {
    width: min(clamp(480px, 27vw, 600px), 100%);
    padding: clamp(34px, 2vw, 48px);
  }
  .ca-shell--split .ca-alert {
    width: min(clamp(480px, 27vw, 600px), 100%);
  }
  .ca-eyebrow {
    margin-bottom: clamp(8px, 0.5vw, 12px);
    font-size: clamp(11px, 0.62vw, 13px);
  }
  .ca-shell--split .ca-title {
    font-size: clamp(24px, 1.4vw, 30px);
  }
  .ca-shell--split .ca-hint {
    margin-bottom: clamp(18px, 1.2vw, 26px);
    font-size: clamp(13.5px, 0.78vw, 16px);
  }
  .ca-shell--split .ca-field {
    margin-bottom: clamp(12px, 0.8vw, 17px);
  }
  .ca-shell--split .ca-field label {
    margin-bottom: clamp(4px, 0.3vw, 7px);
    font-size: clamp(12.5px, 0.7vw, 14.5px);
  }
  .ca-shell--split .ca-input {
    height: clamp(40px, 2.5vw, 50px);
    padding: 10px clamp(12px, 0.8vw, 16px);
    font-size: clamp(14px, 0.8vw, 16px);
  }
  .ca-shell--split .ca-row {
    margin-bottom: clamp(14px, 0.9vw, 20px);
    font-size: clamp(13px, 0.75vw, 15px);
  }
  .ca-shell--split .ca-btn {
    padding: clamp(11px, 0.75vw, 15px) 18px;
    font-size: clamp(14.5px, 0.82vw, 16.5px);
  }
  .ca-shell--split .ca-links {
    margin-top: clamp(16px, 1vw, 22px);
    font-size: clamp(13.5px, 0.78vw, 16px);
  }
}

@media (max-width: 940px) {
  .ca-shell--split .ca-main { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .ca-shell--split .ca-atmos { display: none; }
  /* Hero collapses to a slim dark brand band above the sign-in pane. */
  .ca-hero { padding: 18px 24px; }
  .ca-hero-mid, .ca-tease, .ca-hero-foot { display: none; }
  .ca-shell--split .ca-footer { display: block; }
}
