/* Accessibility audit by Us — app styles */

@import url("./tokens.css");

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--us-cream);
  color: var(--fg-1);
  font-family: var(--font-body);
  font-weight: 400;
  min-height: 100vh;
  min-height: 100dvh;
}

#root { min-height: 100vh; }

/* ─────  App chrome  ──── */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 244, 229, 0.85);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-bottom: 1px solid var(--border-subtle);
}
.app-header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px calc(32px + env(safe-area-inset-right, 0px)) 14px calc(32px + env(safe-area-inset-left, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--fg-1);
  text-decoration: none;
  cursor: pointer;
}
.brand-logo {
  height: 28px;
  width: auto;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}
.brand-marks {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  color: var(--fg-1);
}
.brand-marks img {
  display: block;
  height: 28px;
  width: 28px;
  object-fit: contain;
}
.brand-text {
  white-space: nowrap;
}
.brand-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--us-grad-iridescent);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.brand-dot::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--us-ink);
}
.brand small {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 12px;
  color: var(--fg-3);
  margin-left: 6px;
  letter-spacing: 0;
}

.nav-crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--fg-3);
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.nav-crumbs .step {
  padding: 6px 10px;
  border-radius: var(--r-pill);
}
.nav-crumbs .step.active {
  background: var(--us-ink);
  color: var(--us-cream);
}
.nav-crumbs .sep { opacity: 0.4; }

.app-main {
  flex: 1;
}

/* ─────  Common  ──── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 calc(32px + env(safe-area-inset-right, 0px)) 0 calc(32px + env(safe-area-inset-left, 0px));
}
.container-narrow {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 calc(32px + env(safe-area-inset-right, 0px)) 0 calc(32px + env(safe-area-inset-left, 0px));
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--us-lilac-deep);
}

/* ─────  Buttons  ──── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  font-family: var(--font-button);
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--us-ink);
  color: var(--us-cream);
}
.btn-primary:hover { background: #000; }
.btn-secondary {
  background: transparent;
  color: var(--fg-1);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--us-ink); color: var(--us-cream); }
.btn-ghost {
  background: transparent;
  color: var(--fg-2);
}
.btn-ghost:hover { background: rgba(0,0,0,0.05); }
.btn-cream {
  background: var(--us-cream);
  color: var(--us-ink);
}
.btn-lg { padding: 18px 32px; font-size: 16px; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

.btn-grad {
  background: var(--us-grad-iridescent);
  color: var(--us-ink);
  font-weight: 600;
  position: relative;
}

/* ─────  Form fields  ──── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-1);
  display: flex;
  align-items: center;
  gap: 8px;
}
.field-hint { font-size: 12px; color: var(--fg-3); line-height: 1.5; }
.field-error {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--us-peach-text);
  line-height: 1.45;
}
.input[aria-invalid="true"],
.textarea[aria-invalid="true"],
.select[aria-invalid="true"] {
  border-color: var(--us-peach-text);
}
.input, .textarea, .select {
  width: 100%;
  padding: 13px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  background: var(--us-white);
  border: 1px solid var(--border-default);
  border-radius: var(--r-sm);
  color: var(--fg-1);
  transition: border-color .15s ease, box-shadow .15s ease;
  outline: none;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--us-lilac-deep);
  box-shadow: 0 0 0 3px rgba(98, 87, 232, 0.18);
}
.textarea {
  min-height: 110px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
}
.input::placeholder, .textarea::placeholder { color: var(--fg-3); }

.file-field {
  position: relative;
}
.file-input-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.file-input-ui {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 12px;
  background: var(--us-white);
  border: 1px solid var(--border-default);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.file-input-native:focus-visible + .file-input-ui {
  border-color: var(--us-lilac-deep);
  box-shadow: 0 0 0 3px rgba(98, 87, 232, 0.18);
}
.file-input-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--us-ink);
  background: var(--us-ink);
  color: var(--us-cream);
  font-family: var(--font-button);
  font-size: 14px;
  font-weight: 500;
}
.file-input-name {
  font-size: 14px;
  color: var(--fg-3);
}

.run-hero-title {
  font-size: clamp(40px, 5.4vw, 68px);
  margin-top: 14px;
  margin-bottom: 12px;
}

/* file drop */
.drop {
  border: 1.5px dashed var(--border-default);
  border-radius: var(--r-md);
  padding: 28px 20px;
  text-align: center;
  background: var(--us-white);
  transition: border-color .15s ease, background .15s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.drop:hover, .drop.dragging {
  border-color: var(--us-lilac-deep);
  background: #FAFAFE;
}
.drop.has-file { border-style: solid; border-color: var(--us-mint-text); background: #F0FFF7; }

/* checkbox */
.check {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--fg-2);
  line-height: 1.5;
}
.check input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.check input:focus-visible + .box {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.check .box {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 5px;
  border: 1.5px solid var(--border-default);
  background: var(--us-white);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  transition: all .15s ease;
}
.check input:checked + .box {
  background: var(--us-ink);
  border-color: var(--us-ink);
}
.check input:checked + .box::after {
  content: "";
  width: 10px;
  height: 6px;
  border: 2px solid var(--us-cream);
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg) translate(0, -1px);
}

/* ─────  Cards  ──── */
.card {
  background: var(--us-white);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
}
.card-flat {
  background: var(--us-white);
  border-radius: var(--r-lg);
  padding: 24px;
  border: 1px solid var(--border-subtle);
}

/* ─────  Pills / tags  ──── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-body);
}
.tag-error    { background: #FCE8E5; color: var(--us-peach-text); }
.tag-warning  { background: var(--us-peach); color: var(--us-peach-text); }
.tag-success  { background: var(--us-mint); color: var(--us-mint-text); }
.tag-info     { background: var(--us-sky); color: var(--us-sky-text); }
.tag-lilac    { background: var(--us-lilac); color: var(--us-lilac-text); }
.tag-pink     { background: var(--us-pink); color: var(--us-pink-text); }
.tag-ink      { background: var(--us-ink); color: var(--us-cream); }
.tag-outline  { background: transparent; border: 1px solid var(--border-decor); color: var(--fg-2); }

/* dot indicator */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dot-error    { background: var(--us-peach-text); }
.dot-warning  { background: var(--us-peach); }
.dot-success  { background: var(--us-mint-text); }
.dot-info     { background: var(--us-lilac-deep); }

/* ─────  Stat cards  ──── */
.stat {
  background: var(--us-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--stat-label);
  font-weight: 600;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat-sub {
  font-size: 12px;
  color: var(--fg-3);
}

/* ─────  Tabs  ──── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 32px), transparent);
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 32px), transparent);
}
.tab {
  scroll-snap-align: start;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-3);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-body);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color .15s ease, border-color .15s ease;
}
.tab:hover { color: var(--fg-1); }
.tab.active {
  color: var(--fg-1);
  border-bottom-color: var(--us-ink);
}
.tab .count {
  background: var(--us-n-30);
  color: var(--fg-2);
  padding: 1px 8px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.tab.active .count { background: var(--us-ink); color: var(--us-cream); }

/* ─────  Table-like list  ──── */
.list-row {
  display: grid;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--us-white);
  transition: background .15s ease;
}
.list-row:hover { background: var(--us-n-10); }
.list-row:last-child { border-bottom: 0; }

/* ─────  Animations  ──── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float-y {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes drift {
  0%   { transform: translate(0, 0) rotate(0deg); }
  33%  { transform: translate(30px, -20px) rotate(8deg); }
  66%  { transform: translate(-20px, 15px) rotate(-6deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}
@keyframes pulse-soft {
  0%,100% { opacity: .6; }
  50%     { opacity: 1; }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up { animation: fade-up .4s ease both; }

@media (prefers-reduced-motion: reduce) {
  .fade-up,
  .motion-drift {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
  .progress-fill,
  .orb,
  .ring,
  .swirl,
  .halo,
  .orbit-dot {
    animation: none !important;
  }
}

@media (min-width: 481px) {
  .app-header-nav:not([open]) > .app-header-chrome {
    display: flex;
  }
}

/* ─────  Misc helpers  ──── */
.hr { height: 1px; background: var(--border-subtle); border: 0; margin: 24px 0; }
.muted { color: var(--fg-3); }
.mono { font-family: var(--font-mono); font-size: 13px; }
.break-anywhere { overflow-wrap: anywhere; word-break: break-word; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 100001;
  padding: 10px 16px;
  background: var(--us-ink);
  color: var(--us-cream);
  border-radius: var(--r-sm);
  text-decoration: none;
  font-weight: 600;
  transform: translateY(-160%);
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: none;
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

/* ─────  Marquee for grading bar  ──── */
.grade-bar {
  height: 8px;
  background: var(--us-n-30);
  border-radius: var(--r-pill);
  overflow: hidden;
  position: relative;
}
.grade-bar > .fill {
  height: 100%;
  border-radius: var(--r-pill);
  transition: width .8s cubic-bezier(.5,0,.2,1);
}

.app-header-inner {
  position: relative;
}
.app-header-nav {
  flex-shrink: 0;
}
.app-header-chrome {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.app-header-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--fg-1);
  cursor: pointer;
}
.app-header-menu-toggle:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.wcag-session-bar {
  display: inline-flex;
  align-items: center;
}
.wcag-session-bar[hidden] {
  display: none !important;
}
.wcag-session-logout {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(25, 25, 27, 0.12);
  background: rgba(255, 255, 255, 0.85);
  color: var(--fg-1);
  cursor: pointer;
}
.wcag-session-logout:hover {
  filter: brightness(0.97);
  border-color: rgba(25, 25, 27, 0.2);
}
.wcag-session-logout:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ─────  Responsive / small screens  ──── */
@media (max-width: 720px) {
  .app-header-inner {
    padding: 12px calc(16px + env(safe-area-inset-right, 0px)) 12px calc(16px + env(safe-area-inset-left, 0px));
    flex-wrap: wrap;
    row-gap: 10px;
  }
  .brand {
    font-size: 16px;
    min-width: 0;
  }
  .brand-text {
    font-size: 15px;
  }
  .app-header-chrome .muted {
    display: none;
  }
  .container,
  .container-narrow {
    padding: 0 calc(16px + env(safe-area-inset-right, 0px)) 0 calc(16px + env(safe-area-inset-left, 0px));
  }
}

.nav-host-hint {
  display: none;
}
@media (min-width: 520px) {
  .nav-host-hint {
    display: inline;
  }
}

@media (max-width: 480px) {
  .btn {
    white-space: normal;
    text-align: center;
  }
  .stat-value {
    font-size: clamp(28px, 12vw, 40px);
  }
  .app-header-menu-toggle {
    display: inline-flex;
  }
  .app-header-nav:not([open]) .app-header-chrome {
    display: none;
  }
  .app-header-nav[open] .app-header-chrome {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: calc(100% - 4px);
    right: calc(8px + env(safe-area-inset-right, 0px));
    left: auto;
    min-width: min(240px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    padding: 12px;
    background: var(--us-cream);
    border: 1px solid var(--border-decor);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-pop);
    z-index: 60;
  }
  .app-header-nav[open] .app-header-chrome .btn,
  .app-header-nav[open] .app-header-chrome .wcag-session-logout {
    width: 100%;
    justify-content: flex-start;
  }
}

.page-article {
  padding-block: clamp(32px, 5vw, 56px) clamp(48px, 8vw, 96px);
}
.page-article h1 {
  font-size: clamp(32px, 4vw, 48px);
  margin: 0 0 12px;
}
.prose-lead {
  margin: 0 0 24px;
  max-width: 620px;
}
.stack-form {
  display: grid;
  gap: 16px;
  padding: 28px 32px;
}
.stack-form-spaced {
  margin-top: 8px;
}
.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}
.mt-1 { margin-top: 8px; }
button.linklike {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.teaser-cta {
  padding: 0 32px 80px;
}
.teaser-unlock {
  padding: 28px 32px;
  margin-bottom: 24px;
}
.guest-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.account-section {
  margin-top: 20px;
}
.account-section h2 {
  font-size: 18px;
  margin: 0 0 8px;
}
.account-form {
  display: grid;
  gap: 12px;
}
.account-form label:not(.legal-check) {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}
.account-form input {
  font: inherit;
  font-weight: 400;
  padding: 10px 12px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  background: #fff;
}
.account-form-row {
  display: grid;
  gap: 12px;
}
@media (min-width: 560px) {
  .account-form-row {
    grid-template-columns: 1fr 1fr;
  }
}
.usage-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(25, 25, 27, 0.08);
  overflow: hidden;
}
.usage-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--us-mint, #8DFFB7);
}
.table-wrap {
  overflow-x: auto;
}
.account-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.account-table th,
.account-table td {
  text-align: left;
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.pricing-grid {
  display: grid;
  gap: 20px;
  margin-top: 28px;
}
@media (min-width: 900px) {
  .pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.pricing-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
}
.pricing-price {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.pricing-price span {
  font-size: 16px;
  font-weight: 500;
  color: var(--fg-3);
}
.pricing-cta {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.pricing-packs {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--fg-2);
}
.site-legal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 16px 40px;
  font-size: 13px;
  text-align: center;
}
.site-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}
.site-legal a {
  color: var(--fg-2);
}
.site-legal-identity {
  margin: 0;
  max-width: 720px;
  color: var(--fg-3);
  line-height: 1.45;
}
.legal-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--fg-2);
}
.legal-check input {
  margin-top: 3px;
  flex-shrink: 0;
}
.pricing-price-excl {
  display: block;
  font-size: 16px;
  font-weight: 500;
  color: var(--fg-3);
  margin-top: 4px;
}
.guest-lead-privacy {
  font-size: 13px;
  margin: 0 0 16px;
}

