/* Document pages (pricing, privacy, cookies, terms) and the admin panel. Uses the tokens of style.css. */

body.site { overflow-y: auto; height: auto; min-height: 100%; }
.site-head {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 14px max(16px, env(safe-area-inset-right, 0px)) 14px max(16px, env(safe-area-inset-left, 0px));
  background: rgba(245, 247, 250, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.site-head .logo { margin-right: auto; }
.site-head nav { display: flex; gap: 2px; flex-wrap: wrap; }
.site-head nav a[aria-current="page"] { color: var(--brand-400); background: var(--brand-50); }
.site-head .btn { height: 40px; padding: 0 16px; font-size: 14px; text-decoration: none; }

.doc {
  max-width: 760px; margin: 0 auto;
  padding: 56px max(16px, env(safe-area-inset-right, 0px)) 80px max(16px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 20px; color: var(--text-2); font-size: 16px; line-height: 1.65;
}
.doc h1 { font-size: clamp(34px, 6vw, 48px); line-height: 1.05; color: var(--text); letter-spacing: -0.03em; }
.doc h2 { font-size: 22px; color: var(--text); margin-top: 18px; }
.doc h3 { font-size: 17px; color: var(--text); font-family: var(--font); font-weight: 600; letter-spacing: 0; }
.doc p, .doc ul, .doc ol { margin: 0; }
.doc ul, .doc ol { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.doc a { color: var(--brand-400); }
.doc .lead { font-size: 19px; color: var(--text-2); max-width: 62ch; }
.doc .updated { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.doc table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.doc th { font-weight: 600; color: var(--text); background: var(--surface-2); }
.doc code { font-family: var(--mono); font-size: 13.5px; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.table-wrap table th:first-child, .table-wrap table td:first-child { padding-left: 16px; }

.placeholder { background: #fdf1dc; color: var(--amber-ink); border-radius: 6px; padding: 0 6px; font-weight: 600; }
.draft-note {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-sm);
  background: #fdf1dc; color: var(--amber-ink); font-size: 14.5px; line-height: 1.5;
}
.draft-note::before { content: ""; flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--orange); }

/* pricing */
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.how > div { padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.how b { font-family: var(--font); font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: 0; }
.how > div > span { font-size: 14.5px; line-height: 1.5; }
.packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.pack { position: relative; padding: 28px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.pack-name { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.pack-price { font-family: var(--display); font-weight: 800; font-size: 44px; line-height: 1; color: var(--text); letter-spacing: -0.03em; }
.pack-min { font-size: 16px; color: var(--text); font-weight: 600; }
.pack-sub { font-size: 14px; color: var(--muted); }
.pack-rate { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.buy { padding: 22px; border-radius: var(--r-lg); background: var(--brand-700); color: #e3e8ef; display: flex; flex-direction: column; gap: 10px; }
.buy h2 { color: #fff; margin: 0; }
.buy a { color: #ffd38a; }
.faq { display: flex; flex-direction: column; gap: 4px; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; color: var(--text); list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
/* A chevron that turns as the answer slides open (the height animation is ui.js smoothDetails). */
.faq summary::after {
  content: ""; flex: none; margin-left: auto; width: 8px; height: 8px; border: solid var(--muted); border-width: 0 2px 2px 0;
  transform: translateY(-2px) rotate(45deg); transition: transform var(--t-ui) var(--ease);
}
.faq details[open]:not(.is-closing) summary::after { transform: translateY(2px) rotate(225deg); }
.faq summary:hover { color: var(--brand-400); }
.faq details p { padding-top: 8px; margin: 0; }
.pack--skel { min-height: 300px; }
.pack--skel .skel { display: block; border-radius: 8px; }

.site-foot {
  border-top: 1px solid var(--line); padding: 24px max(16px, env(safe-area-inset-right, 0px)) 32px max(16px, env(safe-area-inset-left, 0px));
  display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; font-size: 14px; color: var(--muted);
}
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--brand-400); }

@media (max-width: 640px) { .how { grid-template-columns: 1fr; } .site-head nav { order: 3; width: 100%; } }

.pack-buy { margin-top: 10px; height: 44px; }
.pack-buy:disabled { background: var(--soft); color: var(--muted); box-shadow: none; }
.buy-note { margin: 0; min-height: 0; font-size: 15px; }
.buy-note:empty { display: none; }
.buy-note.is-ok { padding: 12px 16px; border-radius: var(--r-sm); background: #e6f4ec; color: #14532d; }
.buy-note.is-warn { padding: 12px 16px; border-radius: var(--r-sm); background: #fdf1dc; color: var(--amber-ink); }

/* ---------- Pricing and documents (from the canvas) ---------- */
.price-hero { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.price-hero .lead { max-width: 620px; }
.doc:has(.price-hero) { max-width: 1080px; }
.pack.is-featured { border: 0; background: #0f1e33; color: #b6c4d6; box-shadow: 0 24px 48px -24px rgba(15, 30, 51, 0.6); }
.pack.is-featured .pack-name { color: #8fb7e0; }
.pack.is-featured .pack-price, .pack.is-featured .pack-min { color: #fff; }
.pack.is-featured .pack-sub, .pack.is-featured .pack-rate { color: #b6c4d6; border-color: rgba(255, 255, 255, 0.12); }
.pack.is-featured .pack-buy { background: var(--orange); color: #0f1e33; box-shadow: none; }
.pack-badge { position: absolute; top: -12px; left: 28px; padding: 4px 10px; border-radius: 999px; background: var(--orange); color: #0f1e33; font-size: 12px; font-weight: 700; }

.doc-shell { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; max-width: 1080px; margin: 0 auto; padding: 48px max(16px, env(safe-area-inset-right, 0px)) 64px max(16px, env(safe-area-inset-left, 0px)); box-sizing: border-box; }
.doc-nav { flex: 1 1 200px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 90px; }
.doc-nav a { padding: 10px 14px; border-radius: 12px; color: var(--muted); font-size: 15px; text-decoration: none; transition: background var(--t-hover), color var(--t-hover); }
.doc-nav a:hover { color: var(--text); background: var(--surface-2); }
.doc-nav a[aria-current="page"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 30, 51, 0.06); }
.doc.doc--card { flex: 999 1 560px; min-width: 0; max-width: none; margin: 0; padding: 40px; border-radius: 24px; background: var(--surface); }
.keep { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.keep > div { display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: 18px; font-size: 14.5px; line-height: 1.5; }
.keep b { font-size: 15px; }
.keep-yes { background: #f3f8f5; } .keep-yes b { color: #1f6b45; }
.keep-no { background: #f8f3f2; } .keep-no b { color: #8a2e1f; }
@media (max-width: 640px) { .keep { grid-template-columns: 1fr; } .doc.doc--card { padding: 24px; } .doc-nav { position: static; flex-direction: row; flex-wrap: wrap; } }
.doc:has(.price-hero) .packs { margin-top: 12px; }

/* Arrival: the document card and its first blocks rise in one after another (site.js, once per load). */
body.is-entering main.doc:not(.doc--card) > :nth-child(-n+6) { animation: reveal 0.5s var(--ease) both; }
body.is-entering main.doc:not(.doc--card) > :nth-child(2) { animation-delay: 0.05s; } body.is-entering main.doc:not(.doc--card) > :nth-child(3) { animation-delay: 0.1s; }
body.is-entering main.doc:not(.doc--card) > :nth-child(4) { animation-delay: 0.15s; } body.is-entering main.doc:not(.doc--card) > :nth-child(5) { animation-delay: 0.2s; }
body.is-entering main.doc:not(.doc--card) > :nth-child(6) { animation-delay: 0.25s; }
body.is-entering main.doc--card { animation: reveal 0.5s var(--ease) both; }
@media (prefers-reduced-motion: reduce) { body.is-entering * { animation: none !important; } }
/* Pages of different length don't shift sideways when the scrollbar comes and goes. */
html:has(body.site) { scrollbar-gutter: stable; }
main.doc--card > * { transition: opacity var(--t-layout) var(--ease); }
main.doc--card.is-fading > * { opacity: 0; transition: opacity var(--t-exit) var(--ease-in); }

/* ---------- Pricing, as on the canvas ---------- */
.pack-name { font-size: 14px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.pack-min { font-size: 18px; font-weight: 700; }
.pack-sub { min-height: 3em; line-height: 1.45; }
.pack-buy { margin-top: auto; height: 48px; background: var(--surface); border: 1px solid var(--line-2); color: var(--text); font-weight: 700; box-shadow: none; }
.pack-buy:not(:disabled):hover { border-color: var(--brand-300); background: var(--brand-50); }
.pack.is-featured .pack-buy:not(:disabled):hover { background: #f5b13a; }
.pack { padding: 28px; transition: transform var(--t-ui) var(--ease), box-shadow var(--t-ui) var(--ease); }
.pack:not(.pack--skel):hover { transform: translateY(-3px); box-shadow: 0 18px 36px -24px rgba(15, 30, 51, 0.35); }
.pack.is-featured:hover { box-shadow: 0 28px 52px -24px rgba(15, 30, 51, 0.7); }
.how > div { border: 0; padding: 20px; }
.buy { background: var(--surface); color: var(--text-2); border: 1px solid var(--line); padding: 22px 24px; gap: 6px; }
.buy h2 { color: var(--text); font-size: 18px; }
.buy a { color: var(--brand-400); }
.faq { gap: 10px; }
.faq details { border: 0; border-radius: 16px; background: var(--surface); padding: 0 20px; }
.faq summary { padding: 16px 0; }
.faq details p { padding: 0 0 16px; color: var(--muted); line-height: 1.55; }
.doc:has(.price-hero) .how { margin-top: 24px; }
.doc:has(.price-hero) .faq { margin-top: -4px; }
.op-details { padding: 12px 16px; border-radius: 12px; background: var(--surface-2); color: var(--text); font-weight: 600; }
