/* ============================================================================
   fAI — legal & pricing documents (fai.prodifylabs.io)
   Same visual language as the landing (styles.css): deep-space dark, teal +
   blue, sparse accent. These pages are READ, not scrolled through — so the
   measure is narrow, the type scale is small, and the only ornament is the
   hairline rule under the document title.
   ========================================================================== */

:root {
  --bg-base:      #000019;
  --bg-card:      #060E1F;
  --bg-surface:   #0A1628;
  --bg-elevated:  #0D1D35;
  --fg-primary:   #FFFFFF;
  --fg-secondary: #E2E8F5;
  --fg-soft:      #C8D5E8;
  --fg-muted:     #8A9BB5;
  --fg-ghost:     #7A8BA8;
  --bd-subtle:    #12213D;
  --bd-strong:    #1A2D4A;
  --teal:         #02F4A8;
  --blue:         #428BF9;
  --grad-hair:    linear-gradient(90deg, var(--teal), var(--blue), transparent);
  --font-sans:    "DM Sans", system-ui, -apple-system, sans-serif;
  --font-display: "Outfit", "DM Sans", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  --ease-soft:    cubic-bezier(.4, 0, .2, 1);
  --dur-fast:     .22s;
  --gutter:       clamp(20px, 5vw, 88px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg-base); }

body {
  margin: 0;
  min-width: 100%;
  background: var(--bg-base);
  color: var(--fg-soft);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 3px; }

/* ── Header, borrowed from the landing so the pages read as one site ────── */

.site-head {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 16px var(--gutter);
  /* Glass: el fondo casi no tapa, el blur y la saturación hacen el trabajo. El
     inset de arriba es el filo iluminado del vidrio; el de abajo, su grosor.
     La saturación importa — sin ella el desenfoque lava el teal y el header
     queda gris sobre una escena de color. */
  background: rgba(6, 14, 31, .55);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    inset 0 -1px 0 rgba(0, 0, 0, .35),
    0 8px 28px -18px rgba(0, 0, 0, .9);
}
/* Sin backdrop-filter no hay vidrio que valga: se vuelve opaco antes que
   ilegible. Safari viejo y Firefox con la flag apagada caen acá. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-head { background: rgba(3, 8, 20, .96); }
}

.wordmark {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 800; font-size: 19px;
  letter-spacing: -.03em; color: var(--fg-primary); text-decoration: none;
}
.wordmark:hover { text-decoration: none; }
.head-nav { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.head-nav a {
  font-size: 14px; color: var(--fg-muted); transition: color var(--dur-fast) var(--ease-soft);
}
.head-nav a:hover { color: var(--teal); text-decoration: none; }
.head-nav a[aria-current="page"] { color: var(--fg-primary); }

/* ── Document shell ──────────────────────────────────────────────────────── */

.doc {
  max-width: 74ch;
  margin: 0 auto;
  padding: 64px var(--gutter) 96px;
}
.doc-wide { max-width: 1200px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--teal);
}
.doc h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(32px, 5vw, 46px); line-height: 1.06; letter-spacing: -.035em;
  color: var(--fg-primary); margin: 14px 0 0; text-wrap: balance;
}
.doc-rule { height: 1px; background: var(--grad-hair); margin: 26px 0 10px; border: 0; }
.doc-meta {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--fg-ghost);
  display: flex; flex-wrap: wrap; gap: 6px 22px; margin-bottom: 46px;
}

.doc h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: 22px; letter-spacing: -.025em; color: var(--fg-primary);
  margin: 46px 0 0;
}
.doc h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 17px; letter-spacing: -.015em; color: var(--fg-secondary);
  margin: 30px 0 0;
}
.doc p { margin: 14px 0 0; }
.doc ul, .doc ol { margin: 14px 0 0; padding-left: 22px; }
.doc li { margin-top: 8px; }
.doc li::marker { color: var(--fg-ghost); }
.doc strong { color: var(--fg-secondary); font-weight: 600; }
.doc code {
  font-family: var(--font-mono); font-size: .88em;
  background: var(--bg-surface); border: 1px solid var(--bd-subtle);
  border-radius: 4px; padding: 1px 5px; color: var(--fg-soft);
}

/* The one call-out these documents use: the promise that has to be impossible
   to miss (the unconditional refund, the freeze-with-export rule). */
.callout {
  margin: 26px 0 0; padding: 18px 22px;
  background: var(--bg-card);
  border: 1px solid var(--bd-strong);
  border-left: 2px solid var(--teal);
  border-radius: 0 8px 8px 0;
}
.callout p:first-child { margin-top: 0; }

/* A value the operator must fill in before this page is public. Loud on
   purpose — it must never survive to production unnoticed. */
.fillme {
  background: #3A1010; color: #FFD2D2;
  border: 1px dashed #FF6B6B; border-radius: 4px;
  padding: 1px 6px; font-family: var(--font-mono); font-size: .86em;
}


/* Conspicuous warranty disclaimer. UCC 2-316 requires a disclaimer of the
   implied warranty of merchantability to name it AND be conspicuous — body
   text in the same face as everything around it has been held unenforceable.
   Bold + contrasting frame + an all-caps lead line, rather than a wall of
   caps nobody reads. */
.disclaimer {
  margin: 26px 0 0; padding: 20px 22px;
  background: var(--bg-surface);
  border: 1px solid var(--teal);
  border-radius: 8px;
  color: var(--fg-secondary);
  font-weight: 500;
}
.disclaimer p { margin-top: 12px; }
.disclaimer p:first-child { margin-top: 0; }
.disclaimer .caps {
  display: block; margin-bottom: 4px;
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--teal);
}

/* ── Pricing ─────────────────────────────────────────────────────────────── */

.lede {
  font-size: 18px; color: var(--fg-soft); max-width: 62ch; margin-top: 18px;
}
.billing-note {
  margin-top: 34px; font-size: 14px; color: var(--fg-muted);
  display: flex; flex-wrap: wrap; gap: 8px 26px;
}
.billing-note span { display: flex; align-items: center; gap: 8px; }
.billing-note span::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--teal); flex: none;
}

.tiers {
  margin-top: 30px;
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(202px, 1fr));
  align-items: stretch;
}
.tier {
  display: flex; flex-direction: column;
  background: var(--bg-card); border: 1px solid var(--bd-subtle);
  border-radius: 10px; padding: 24px 22px 26px;
}
.tier.is-featured { border-color: var(--bd-strong); background: var(--bg-surface); }
.tier-name {
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
  letter-spacing: -.02em; color: var(--fg-primary);
}
.tier-price {
  font-family: var(--font-display); font-weight: 800;
  font-size: 40px; line-height: 1.1; letter-spacing: -.04em;
  color: var(--fg-primary); margin-top: 12px;
  font-variant-numeric: tabular-nums;
}
.tier-price small {
  font-family: var(--font-sans); font-size: 14px; font-weight: 500;
  letter-spacing: 0; color: var(--fg-muted);
}
.tier-year {
  font-family: var(--font-mono); font-size: 12px; color: var(--fg-ghost); margin-top: 6px;
}
.tier-for { font-size: 14px; color: var(--fg-muted); margin-top: 14px; }
.tier-adds {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--bd-subtle);
  font-size: 14px; color: var(--fg-soft);
}

/* Buy buttons (self-checkout). Two per card: monthly / yearly. Sit at the
   bottom of the card whatever the copy length (the card is a flex column). */
.tier-buy {
  margin-top: auto; padding-top: 18px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.tier-buy button, .tier-buy a {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 12px; border-radius: 8px;
  font-family: var(--font-sans); font-size: 13.5px; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  border: 1px solid var(--bd-strong); background: transparent; color: var(--fg-soft);
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.tier-buy button[data-cadence="year"] {
  background: var(--teal); color: #00160E; border-color: transparent;
}
.tier-buy button:hover:not(:disabled), .tier-buy a:hover {
  border-color: rgba(2, 244, 168, .5); color: var(--fg-primary);
}
.tier-buy button[data-cadence="year"]:hover:not(:disabled) { color: #00160E; filter: brightness(1.06); }
.tier-buy button:disabled {
  cursor: default; opacity: .55; background: transparent; color: var(--fg-muted);
  border-color: var(--bd-subtle);
}
.tier-buy button.is-busy { opacity: .7; }
.tier-buy button:focus-visible, .tier-buy a:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.tier-buy-contact { grid-template-columns: 1fr; }
.checkout-note {
  margin-top: 16px; font-size: 14px; color: var(--fg-soft);
  border: 1px solid var(--bd-subtle); border-radius: 8px; padding: 12px 14px;
}
.checkout-note[hidden] { display: none; }

.matrix-wrap { margin-top: 44px; overflow-x: auto; }
table.matrix {
  width: 100%; min-width: 720px; border-collapse: collapse;
  font-size: 14.5px;
}
table.matrix th, table.matrix td {
  border-bottom: 1px solid var(--bd-subtle);
  padding: 13px 14px; text-align: left; vertical-align: top;
}
table.matrix thead th {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--fg-muted);
  border-bottom-color: var(--bd-strong); white-space: nowrap;
}
table.matrix tbody th { font-weight: 400; color: var(--fg-soft); }
table.matrix td { text-align: center; width: 108px; color: var(--fg-ghost); }
table.matrix td.yes { color: var(--teal); }
body:has(.tiers) table.matrix td.yes { font-size: 0; vertical-align: middle; }
body:has(.tiers) table.matrix td.yes::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid rgba(2, 244, 168, .35);
  border-radius: 50%;
  background: rgba(2, 244, 168, .1);
  color: var(--teal);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}
body:has(.tiers) table.matrix tbody tr:hover { background: rgba(66, 139, 249, .055); }
body:has(.tiers) table.matrix tbody th { line-height: 1.55; }
table.matrix caption {
  caption-side: top; text-align: left; padding-bottom: 14px;
  font-size: 14px; color: var(--fg-muted);
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.site-foot {
  border-top: 1px solid var(--bd-subtle);
  padding: 34px var(--gutter) 46px;
  display: flex; flex-wrap: wrap; gap: 24px 40px;
  align-items: flex-start; justify-content: space-between;
}
.mono-tag {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--fg-muted);
}
.foot-left p { margin-top: 10px; font-size: 13px; color: var(--fg-ghost); max-width: 42em; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.foot-nav a { font-size: 13.5px; color: var(--fg-muted); }
.foot-nav a:hover { color: var(--teal); text-decoration: none; }

@media (max-width: 720px) {
  .doc { padding-top: 44px; }
  .head-nav { gap: 16px; }
  .head-nav .hide-sm { display: none; }
}

/* ── Legal pages ----------------------------------------------------------- */
body:not(:has(.tiers)) {
  background:
    radial-gradient(760px 420px at 12% 0%, rgba(66, 139, 249, .1), transparent 70%),
    var(--bg-base);
}

body:not(:has(.tiers)) .doc {
  max-width: 860px;
  padding-top: clamp(56px, 8vw, 100px);
}

body:not(:has(.tiers)) .doc h1 {
  max-width: 18ch;
  font-size: clamp(40px, 6vw, 64px);
}

body:not(:has(.tiers)) .doc-meta {
  margin-bottom: 54px;
}

body:not(:has(.tiers)) .doc > p:not(.eyebrow):not(.doc-meta),
body:not(:has(.tiers)) .doc > ul,
body:not(:has(.tiers)) .doc > ol {
  max-width: 72ch;
}

body:not(:has(.tiers)) .doc h2 {
  margin-top: 68px;
  padding-top: 18px;
  border-top: 1px solid var(--bd-subtle);
  position: relative;
}

body:not(:has(.tiers)) .doc h2::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 72px;
  height: 1px;
  background: var(--teal);
}

body:not(:has(.tiers)) .doc h3 {
  margin-top: 34px;
  color: var(--teal);
}

body:not(:has(.tiers)) .callout {
  margin-top: 34px;
  padding: 26px 28px;
  border-left-width: 3px;
  background: linear-gradient(120deg, rgba(10, 22, 40, .94), rgba(6, 14, 31, .7));
  box-shadow: 0 24px 70px rgba(0, 0, 25, .24);
}

body:not(:has(.tiers)) .doc li { padding-left: 4px; }
body:not(:has(.tiers)) .doc li::marker { color: var(--teal); }

@media (max-width: 720px) {
  body:not(:has(.tiers)) .doc h1 { max-width: 13ch; }
  body:not(:has(.tiers)) .doc h2 { margin-top: 52px; }
  body:not(:has(.tiers)) .callout { padding: 20px; }
}

/* Pricing cards need room for both cadence buttons. Keep the four-column
   desktop layout, but collapse before cards become cramped instead of relying
   on horizontal overflow. */
@media (max-width: 1080px) {
  .tiers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .tiers { grid-template-columns: 1fr; }
  .tier { padding-inline: 18px; }
}

/* ── Pricing polish --------------------------------------------------------
   Pricing is the action surface, so it gets a little more atmosphere than
   the legal documents without changing the shared visual language. */
body:has(.tiers) {
  background:
    radial-gradient(900px 420px at 8% 0%, rgba(66, 139, 249, .14), transparent 68%),
    radial-gradient(760px 460px at 94% 18%, rgba(2, 244, 168, .08), transparent 70%),
    var(--bg-base);
}

body:has(.tiers) .doc {
  padding-top: clamp(58px, 8vw, 104px);
}

body:has(.tiers) .doc h1 {
  max-width: 15ch;
  font-size: clamp(42px, 6vw, 72px);
  line-height: .98;
  letter-spacing: -.055em;
}

body:has(.tiers) .doc-rule {
  margin-top: 34px;
  opacity: .8;
}

body:has(.tiers) .billing-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 8px 0 0;
  padding: 4px;
  border: 1px solid var(--bd-strong);
  border-radius: 999px;
  background: rgba(6, 14, 31, .72);
}

body:has(.tiers) .pricing-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 42px;
  padding: 14px 16px 14px 18px;
  border: 1px solid var(--bd-subtle);
  border-radius: 12px;
  background: rgba(6, 14, 31, .5);
}

body:has(.tiers) .pricing-controls-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--fg-secondary);
}

body:has(.tiers) .billing-toggle-label {
  margin: 0 10px 0 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-ghost);
}

body:has(.tiers) .billing-choice {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  background: transparent;
  color: var(--fg-muted);
  font: 600 13px var(--font-sans);
  cursor: pointer;
}

body:has(.tiers) .billing-choice span {
  margin-left: 4px;
  color: var(--teal);
  font-size: 11px;
}

body:has(.tiers) .billing-choice.is-active {
  background: var(--teal);
  color: #00160E;
}

body:has(.tiers) .billing-choice.is-active span { color: #064B38; }

body:has(.tiers) .lede {
  max-width: 58ch;
  font-size: clamp(17px, 1.8vw, 20px);
  line-height: 1.55;
}

body:has(.tiers) .callout {
  max-width: 820px;
  margin-top: 34px;
  padding: 22px 26px;
  background: linear-gradient(115deg, rgba(10, 22, 40, .92), rgba(6, 14, 31, .72));
  border-color: rgba(66, 139, 249, .34);
  border-left: 3px solid var(--teal);
  box-shadow: 0 24px 70px rgba(0, 0, 25, .28);
}

body:has(.tiers) .tiers {
  gap: 18px;
  margin-top: 16px;
}

body:has(.tiers) .tier {
  position: relative;
  min-height: 370px;
  padding: 28px 24px 24px;
  border-radius: 14px;
  background: linear-gradient(155deg, rgba(10, 22, 40, .96), rgba(6, 14, 31, .9));
  box-shadow: 0 18px 42px rgba(0, 0, 25, .2);
  transition: transform .28s var(--ease-soft), border-color .28s var(--ease-soft), box-shadow .28s var(--ease-soft);
}

body:has(.tiers) .tier:hover {
  transform: translateY(-6px);
  border-color: rgba(2, 244, 168, .42);
  box-shadow: 0 28px 60px rgba(0, 0, 25, .36);
}

body:has(.tiers) .tier.is-featured {
  border-color: rgba(2, 244, 168, .55);
  background: linear-gradient(155deg, rgba(13, 35, 49, .98), rgba(6, 19, 32, .94));
  box-shadow: 0 24px 68px rgba(2, 244, 168, .1);
}

body:has(.tiers) .tier.is-featured::before {
  content: "Recommended";
  position: absolute;
  top: 14px;
  right: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--teal);
}

body:has(.tiers) .tier-price {
  margin-top: 18px;
  font-size: clamp(42px, 4vw, 54px);
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 6px;
}

body:has(.tiers) .tier-price small {
  white-space: nowrap;
  font-size: clamp(12px, 1.25vw, 14px);
}

body:has(.tiers) .tier-for {
  max-width: 28ch;
  line-height: 1.55;
}

body:has(.tiers) .tier-buy {
  padding-top: 24px;
  gap: 10px;
}

body:has(.tiers) .tier-buy button,
body:has(.tiers) .tier-buy a {
  height: 46px;
  border-radius: 9px;
  font-size: 13px;
  transition: transform .2s var(--ease-soft), background .2s var(--ease-soft), border-color .2s var(--ease-soft);
}

body:has(.tiers) .tier-buy button:hover:not(:disabled),
body:has(.tiers) .tier-buy a:hover {
  transform: translateY(-2px);
}

body:has(.tiers) .billing-note {
  max-width: 980px;
  margin-top: 30px;
  padding: 16px 18px;
  border-top: 1px solid var(--bd-subtle);
  border-bottom: 1px solid var(--bd-subtle);
}

@media (max-width: 720px) {
  body:has(.tiers) { overflow-x: hidden; }
  body:has(.tiers) .doc { width: 100%; max-width: 100%; }
  body:has(.tiers) .doc h1 { max-width: 11ch; }
  body:has(.tiers) .tier { min-height: 0; }
  body:has(.tiers) .tier.is-featured::before { position: static; display: block; margin-bottom: 8px; }
  body:has(.tiers) .billing-toggle { width: 100%; justify-content: space-between; }
  body:has(.tiers) .billing-toggle-label { margin-left: 8px; }
  body:has(.tiers) .billing-choice { padding-inline: 11px; }
  body:has(.tiers) .pricing-controls { align-items: stretch; flex-direction: column; gap: 10px; }
  body:has(.tiers) .pricing-controls-title { font-size: 14px; }
}
