/* SocialTools: the public site (templates/public/*: the landing page, pricing, sign-up, sign-in, password and email
   pages, the legal pages). Loaded after app.css, whose tokens, buttons, cards, fields and flashes it reuses.
   Everything here is classes only (the CSP allows no inline styles). Colours come from app.css's tokens; the few new
   ones are defined for both themes below and meet WCAG AA on the surfaces they sit on. */

:root {
  --pub-max: 1120px;
  --pub-gutter: 16px;
  --pub-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 12px 32px -12px rgba(16, 24, 40, .14);
  --pub-shadow-lg: 0 2px 4px rgba(16, 24, 40, .06), 0 32px 64px -24px rgba(16, 24, 40, .28);
  --pub-glow: radial-gradient(60% 60% at 70% 30%, rgba(198, 40, 40, .10), transparent 70%);
  --pub-header-bg: rgba(246, 247, 249, .86);
  --phone-frame: #15181d;
  --phone-screen: #0b0d10;
  --phone-video-a: #3b1d24;
  --phone-video-b: #1c2433;
  --phone-text: #f3f4f6;
  --phone-muted: #9aa3ad;
  --phone-bar: #2a3038;
  --headline-bg: #ffffff;
  --headline-text: #111317;
}

[data-theme="dark"] {
  --pub-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px -12px rgba(0, 0, 0, .6);
  --pub-shadow-lg: 0 2px 4px rgba(0, 0, 0, .4), 0 32px 64px -24px rgba(0, 0, 0, .8);
  --pub-glow: radial-gradient(60% 60% at 70% 30%, rgba(255, 107, 107, .12), transparent 70%);
  --pub-header-bg: rgba(14, 17, 20, .86);
  --phone-frame: #262b32;
  --phone-screen: #07080a;
}

body.pub { font-size: 1rem; display: flex; flex-direction: column; min-height: 100vh; }
.pub main { flex: 1; }
.pub-wrap { width: 100%; max-width: var(--pub-max); margin: 0 auto; padding: 0 var(--pub-gutter); }
@media (min-width: 640px) { :root { --pub-gutter: 24px; } }

.pub .skip-link {
  position: absolute; left: var(--sp-3); top: -100px; z-index: 50; padding: var(--sp-2) var(--sp-3);
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius);
}
.pub .skip-link:focus { top: var(--sp-3); }

/* ---- the mark (inline SVG) and wordmark ---- */
.st-mark { width: 28px; height: 28px; flex: none; display: block; }
.st-mark .mark-bg { fill: var(--accent); }
.st-mark .mark-fg { fill: var(--accent-ink); }
.st-mark.lg { width: 48px; height: 48px; }
.pub-brand { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--text); font-weight: 750; font-size: 1.125rem; letter-spacing: -0.02em; }
.pub-brand:hover { text-decoration: none; }
.pub-brand b { color: var(--accent); font-weight: inherit; }

/* ---- header ---- */
.pub-header {
  position: sticky; top: 0; z-index: 30; background: var(--pub-header-bg); border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
}
.pub-header-inner { display: flex; align-items: center; gap: var(--sp-5); min-height: 64px; }
.pub-nav { display: none; gap: var(--sp-1); }
.pub-nav a { color: var(--text-muted); font-weight: 600; font-size: .9375rem; padding: var(--sp-2) var(--sp-3); border-radius: var(--radius); }
.pub-nav a:hover { color: var(--text); background: var(--neutral-soft); text-decoration: none; }
.pub-nav a[aria-current="page"] { color: var(--text); }
.pub-actions { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); }
.pub-actions .pub-login { display: none; }
.pub-actions .btn { height: 38px; }

.pub-menu { position: relative; }
.pub-menu > summary {
  list-style: none; display: inline-grid; place-items: center; width: 38px; height: 38px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text);
}
.pub-menu > summary::-webkit-details-marker { display: none; }
.pub-menu > summary svg { width: 18px; height: 18px; }
.pub-menu[open] > summary { background: var(--surface-2); }
.pub-menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: min(240px, calc(100vw - 32px)); padding: var(--sp-2);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--pub-shadow-lg);
  display: flex; flex-direction: column;
}
.pub-menu-panel a { color: var(--text); font-weight: 600; padding: var(--sp-2) var(--sp-3); border-radius: var(--radius); }
.pub-menu-panel a:hover { background: var(--neutral-soft); text-decoration: none; }

@media (min-width: 760px) {
  .pub-nav { display: flex; }
  .pub-actions .pub-login { display: inline-flex; }
  .pub-menu { display: none; }
}

/* ---- shared section bits ---- */
.pub-section { padding: var(--sp-7) 0; }
@media (min-width: 900px) { .pub-section { padding: 88px 0; } }
.pub-section.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 680px; margin: 0 auto var(--sp-6); text-align: center; }
.section-head h2 { font-size: clamp(1.625rem, 2.4vw + 1rem, 2.375rem); font-weight: 750; letter-spacing: -0.025em; margin-bottom: var(--sp-3); }
.section-head p { color: var(--text-muted); font-size: 1.0625rem; margin: 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-4); padding: 4px 12px;
  font-size: .8125rem; font-weight: 700; letter-spacing: .02em; color: var(--accent); background: var(--accent-soft); border-radius: 999px;
}
.eyebrow svg { width: 14px; height: 14px; }
.pub .btn-lg { height: 48px; padding: 0 var(--sp-5); font-size: 1rem; border-radius: 10px; }
.btn-arrow svg { width: 18px; height: 18px; transition: transform .15s ease; }
.btn-arrow:hover svg { transform: translateX(2px); }

/* ---- hero ---- */
.hero { position: relative; overflow: hidden; padding: var(--sp-7) 0 var(--sp-7); background: var(--pub-glow); }
@media (min-width: 900px) { .hero { padding: 96px 0 104px; } }
.hero-grid { display: grid; gap: var(--sp-7); align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 56px; } }
.hero-title { font-size: clamp(2.25rem, 4.2vw + 1rem, 4rem); line-height: 1.04; font-weight: 800; letter-spacing: -0.035em; margin: 0 0 var(--sp-4); }
.hero-title em { font-style: normal; color: var(--accent); white-space: nowrap; }
.hero-lede { font-size: clamp(1.0625rem, .4vw + 1rem, 1.25rem); color: var(--text-muted); max-width: 34em; margin: 0 0 var(--sp-5); }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.hero-note { margin: var(--sp-4) 0 0; color: var(--text-muted); font-size: .875rem; display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); }
.hero-note span { display: inline-flex; align-items: center; gap: 6px; }
.hero-note svg { width: 16px; height: 16px; color: var(--success); }
@media (max-width: 479px) { .hero-cta .btn { width: 100%; } }

/* the hero's phone: a Reel drawn in HTML/CSS */
.hero-visual { position: relative; display: flex; justify-content: center; padding: var(--sp-4) 0; }
.phone-wrap { position: relative; }
.phone {
  position: relative; width: min(280px, 74vw); aspect-ratio: 9 / 17.5; padding: 10px; border-radius: 40px;
  background: var(--phone-frame); box-shadow: var(--pub-shadow-lg);
}
.phone-screen {
  position: relative; height: 100%; border-radius: 31px; overflow: hidden; background: var(--phone-screen);
  display: flex; flex-direction: column; color: var(--phone-text);
}
.phone-notch { position: absolute; top: 8px; left: 50%; width: 84px; height: 22px; margin-left: -42px; border-radius: 12px; background: var(--phone-frame); z-index: 2; }
.reel-head { display: flex; align-items: center; gap: var(--sp-2); padding: 40px 14px 10px; font-size: .75rem; font-weight: 700; }
.reel-avatar { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, #f59e0b, #ef4444 55%, #a21caf); flex: none; }
.reel-follow { margin-left: auto; padding: 2px 10px; border: 1px solid var(--phone-muted); border-radius: 6px; font-size: .6875rem; }
.reel-headline {
  margin: 0 12px; padding: 10px 12px; border-radius: 10px 10px 0 0; background: var(--headline-bg); color: var(--headline-text);
  font-size: .8125rem; line-height: 1.3; font-weight: 800;
}
.reel-video {
  position: relative; flex: 1; margin: 0 12px; border-radius: 0 0 10px 10px; display: grid; place-items: center;
  background:
    linear-gradient(160deg, var(--phone-video-a), var(--phone-video-b)),
    var(--phone-video-b);
}
.reel-video::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .035) 0 14px, transparent 14px 28px);
}
.reel-play { width: 54px; height: 54px; border-radius: 50%; background: rgba(255, 255, 255, .16); display: grid; place-items: center; z-index: 1; }
.reel-play svg { width: 22px; height: 22px; margin-left: 3px; color: #fff; }
.reel-progress { position: absolute; left: 12px; right: 12px; bottom: 10px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .25); z-index: 1; }
.reel-progress::before { content: ""; display: block; width: 38%; height: 100%; border-radius: inherit; background: #fff; }
.reel-foot { display: flex; align-items: flex-end; gap: var(--sp-3); padding: 12px 14px 18px; }
.reel-caption { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.reel-caption .line { display: block; height: 7px; border-radius: 4px; background: var(--phone-bar); }
.reel-caption .w90 { width: 90%; }
.reel-caption .w70 { width: 70%; }
.reel-caption .w40 { width: 40%; }
.reel-actions { display: flex; flex-direction: column; gap: 10px; color: var(--phone-text); }
.reel-actions svg { width: 20px; height: 20px; }
.float-chip {
  position: absolute; display: inline-flex; align-items: center; gap: var(--sp-2); padding: 8px 12px; z-index: 3;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--pub-shadow); font-size: .8125rem; font-weight: 650; white-space: nowrap;
}
.float-chip svg { width: 16px; height: 16px; flex: none; }
.float-chip .chip-dot { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; }
/* the chips hang off the phone's sides, over the video (never over the headline) */
.chip-ai { top: 48%; left: -72px; }
.chip-ai .chip-dot { background: var(--accent-soft); color: var(--accent); }
.chip-schedule { bottom: 22%; right: -64px; }
.chip-schedule .chip-dot { background: var(--sched-soft); color: var(--sched); }
.chip-sub { display: block; font-weight: 500; color: var(--text-muted); font-size: .75rem; }
@media (max-width: 559px) { .float-chip { display: none; } }

/* ---- features ---- */
.feature-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--sp-5);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.feature:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); box-shadow: var(--pub-shadow); }
.pub-section.alt .feature { background: var(--bg); }
.feature-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: var(--sp-4); }
.feature-icon svg { width: 20px; height: 20px; }
.feature h3 { font-size: 1.0625rem; margin-bottom: var(--sp-1); }
.feature p { color: var(--text-muted); font-size: .9375rem; margin: 0; }

/* ---- how it works ---- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-4); counter-reset: step; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-5); } }
.step { position: relative; padding: var(--sp-5); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.pub-section.alt .step { background: var(--bg); }
.step-num {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; margin-bottom: var(--sp-3);
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: .9375rem;
}
.step h3 { font-size: 1.0625rem; margin-bottom: var(--sp-1); }
.step p { color: var(--text-muted); margin: 0; font-size: .9375rem; }

/* ---- plans (public/_plans.html) ---- */
.plans { display: grid; gap: var(--sp-4); align-items: stretch; }
@media (min-width: 900px) { .plans { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-5); } }
.plan {
  position: relative; display: flex; flex-direction: column; padding: var(--sp-6) var(--sp-5); margin: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
}
.plan-featured { border: 2px solid var(--accent); box-shadow: var(--pub-shadow-lg); }
@media (min-width: 900px) { .plan-featured { transform: translateY(-8px); } }
.plan-current { border: 2px solid var(--success); }
.plan-badge {
  position: absolute; top: -13px; left: var(--sp-5); margin: 0; padding: 3px 12px; border-radius: 999px;
  font-size: .75rem; font-weight: 750; letter-spacing: .02em; background: var(--accent); color: var(--accent-ink);
}
.plan-current .plan-badge { background: var(--success); color: var(--surface); }
.plan-name { font-size: 1.25rem; font-weight: 750; margin: 0 0 var(--sp-1); }
.plan-tagline { color: var(--text-muted); font-size: .9375rem; margin: 0 0 var(--sp-4); min-height: 2.9em; }
.plan-price { display: flex; align-items: baseline; gap: 4px; margin: 0 0 var(--sp-1); }
.plan-yearly { margin: 0 0 var(--sp-5); color: var(--text-muted); font-size: .875rem; }  /* (the panel's Plans: 15% off) */
.plan-amount { font-size: 2.75rem; line-height: 1; font-weight: 800; letter-spacing: -0.03em; }
.plan-per { color: var(--text-muted); font-weight: 600; }
.plan-list { list-style: none; margin: var(--sp-5) 0 0; padding: var(--sp-5) 0 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--sp-3); }
.plan-list li { display: flex; gap: var(--sp-2); align-items: flex-start; font-size: .9375rem; }
.plan-list svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--success); }
.plans-foot { text-align: center; margin: var(--sp-6) 0 0; color: var(--text-muted); }

/* ---- FAQ ---- */
.faq { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--sp-3); }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.faq summary {
  list-style: none; cursor: pointer; padding: var(--sp-4) var(--sp-5); font-weight: 650;
  display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { width: 18px; height: 18px; flex: none; color: var(--text-muted); transition: transform .15s ease; }
.faq details[open] summary svg { transform: rotate(45deg); }
.faq details > div { padding: 0 var(--sp-5) var(--sp-4); color: var(--text-muted); }
.faq details > div p:last-child { margin: 0; }

/* ---- page heads (pricing) and the CTA band ---- */
.page-hero { padding: var(--sp-7) 0 var(--sp-6); text-align: center; background: var(--pub-glow); }
@media (min-width: 900px) { .page-hero { padding: 80px 0 var(--sp-7); } }
.page-hero h1 { font-size: clamp(2rem, 3.2vw + 1rem, 3.25rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; margin-bottom: var(--sp-3); }
.page-hero p { color: var(--text-muted); font-size: 1.125rem; max-width: 36em; margin: 0 auto; }
.cta-band {
  border-radius: 20px; padding: var(--sp-7) var(--sp-5); text-align: center;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.cta-band h2 { font-size: clamp(1.625rem, 2.4vw + 1rem, 2.375rem); font-weight: 800; letter-spacing: -0.025em; margin-bottom: var(--sp-3); }
.cta-band p { color: var(--text-muted); max-width: 40em; margin: 0 auto var(--sp-5); font-size: 1.0625rem; }
.cta-band .hero-cta { justify-content: center; }

/* ---- footer ---- */
.pub-footer { border-top: 1px solid var(--border); background: var(--surface); padding: var(--sp-6) 0; margin-top: auto; }
.pub-footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.pub-footer nav { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); }
.pub-footer nav a { color: var(--text-muted); font-size: .9375rem; }
.pub-footer nav a:hover { color: var(--text); }
.pub-footer .copy { color: var(--text-muted); font-size: .875rem; margin: 0; }

/* ---- auth pages (sign in, sign up, passwords, verify email) ---- */
/* top and bottom only: the side padding is .pub-wrap's gutter */
.pub-auth { padding-top: var(--sp-6); padding-bottom: var(--sp-7); display: flex; justify-content: center; }
@media (min-width: 640px) { .pub-auth { padding-top: 64px; padding-bottom: 88px; } }
.pub-auth .auth-card { max-width: 440px; box-shadow: var(--pub-shadow); padding: var(--sp-5); }
@media (min-width: 480px) { .pub-auth .auth-card { padding: var(--sp-6); } }
.pub-auth .auth-card.wide { max-width: 560px; }
.pub-auth .auth-card h1 { font-size: 1.625rem; font-weight: 800; letter-spacing: -0.02em; }
.auth-card .st-mark { margin-bottom: var(--sp-4); }
.auth-sub { color: var(--text-muted); margin-bottom: var(--sp-5); }
.auth-alt { margin: var(--sp-5) 0 0; padding-top: var(--sp-4); border-top: 1px solid var(--border); color: var(--text-muted); font-size: .9375rem; text-align: center; }
.auth-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2); }
.auth-row a { font-size: .875rem; font-weight: 600; }
.auth-actions { display: flex; flex-direction: column; gap: var(--sp-2); }
.auth-actions form { margin: 0; }
.trial-note { display: flex; gap: var(--sp-2); align-items: flex-start; font-size: .875rem; color: var(--text-muted); margin: 0; }
.trial-note svg { width: 16px; height: 16px; flex: none; margin-top: 3px; color: var(--success); }
.pub .field .help { font-size: .8125rem; }

/* sign-up's plan choice: radios as small cards */
.plan-pick { border: 0; margin: 0; padding: 0; min-width: 0; }
.plan-pick legend { float: left; width: 100%; font-weight: 600; font-size: .875rem; padding: 0; margin-bottom: 6px; }
.plan-options { clear: both; display: grid; gap: var(--sp-2); }
@media (min-width: 480px) { .plan-options { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.plan-option {
  position: relative; display: flex; flex-direction: column; gap: 2px; padding: var(--sp-3); cursor: pointer;
  border: 1px solid var(--border-input); border-radius: var(--radius); background: var(--surface);
}
.plan-option input { position: absolute; top: var(--sp-3); right: var(--sp-3); width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.plan-option input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.plan-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.plan-option-name { font-weight: 700; padding-right: 22px; }
.plan-option-price { font-weight: 700; font-size: 1.0625rem; }
.plan-option-price small { color: var(--text-muted); font-weight: 600; font-size: .8125rem; }
.plan-option-meta { color: var(--text-muted); font-size: .8125rem; }
.terms-check { align-items: flex-start; font-weight: 500; font-size: .9375rem; }
.terms-check input { margin-top: 3px; }

.dev-box { margin-bottom: var(--sp-4); padding: var(--sp-3) var(--sp-4); border-radius: var(--radius); background: var(--warn-soft); color: var(--warn); border: 1px dashed color-mix(in srgb, var(--warn) 55%, transparent); font-size: .875rem; }
.dev-box strong { display: block; margin-bottom: 4px; }
.dev-box a { color: var(--warn); font-weight: 600; text-decoration: underline; overflow-wrap: anywhere; word-break: break-all; }
.sent-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--success-soft); color: var(--success); margin-bottom: var(--sp-4); }
.sent-icon svg { width: 24px; height: 24px; }
.btn-link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); font-weight: 600; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
.inline-form { display: inline; margin: 0; }

/* flashes on public pages: a band under the header */
.pub-flashes { padding-top: var(--sp-4); }
.pub-flashes .flash { max-width: 720px; margin: 0 auto var(--sp-2); }

/* ---- legal pages ---- */
.legal { max-width: 760px; margin: 0 auto; padding: var(--sp-6) 0 var(--sp-7); }
@media (min-width: 640px) { .legal { padding: 64px 0 88px; } }
.legal h1 { font-size: clamp(1.875rem, 2.4vw + 1rem, 2.5rem); font-weight: 800; letter-spacing: -0.025em; margin-bottom: var(--sp-1); }
.legal .updated { color: var(--text-muted); margin-bottom: var(--sp-5); }
.legal h2 { font-size: 1.1875rem; font-weight: 700; margin: var(--sp-6) 0 var(--sp-2); }
.legal p, .legal li { color: var(--text); line-height: 1.65; }
.legal ul { padding-left: var(--sp-5); margin: 0 0 var(--sp-3); }
.legal li + li { margin-top: var(--sp-1); }
.legal-notice { padding: var(--sp-3) var(--sp-4); border-radius: var(--radius); background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); font-weight: 650; margin-bottom: var(--sp-5); }

@media (prefers-reduced-motion: reduce) {
  .btn-arrow svg, .faq summary svg, .feature { transition: none; }
}

/* The workspaces picker (/workspaces) and an invite's join page (public/workspaces.html, public/join.html) */
.ws-list { list-style: none; margin: var(--sp-4) 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.ws-list form { margin: 0; }
