/* Form Studio public site: landing, sign-in and sign-up. No external fonts or scripts (strict CSP). */
:root {
  --deep: #0b1d17;
  --forest: #16483b;
  --moss: #1f5a49;
  --cream: #f7f2e7;
  --paper: #fffdf7;
  --ink: #10221c;
  --muted: #54635b;
  --lime: #c8f169;
  --lime-deep: #9fd23a;
  --coral: #ff8c61;
  --sky: #8fd3ff;
  --line: rgba(16, 34, 28, .12);
  --radius: 1.25rem;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-fa: "Vazirmatn", "Estedad", "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--cream); line-height: 1.6; }
html[lang="fa"] body { font-family: var(--font-fa); }
a { color: inherit; }
img, svg { display: block; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: .4rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 2.75rem; padding: .6rem 1.15rem; border-radius: 999px; border: 1.5px solid transparent;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-solid { background: var(--lime); color: var(--deep); box-shadow: 0 8px 24px -10px rgba(200, 241, 105, .8); }
.btn-solid:hover { background: #d6f78a; }
.btn-outline { border-color: rgba(247, 242, 231, .45); color: var(--cream); }
.btn-outline:hover { border-color: var(--cream); background: rgba(247, 242, 231, .08); }
.btn-ghost { background: transparent; color: var(--cream); }
.btn-ghost:hover { background: rgba(247, 242, 231, .1); }
.btn-lg { min-height: 3.25rem; padding: .8rem 1.6rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* Navigation */
.nav {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1.25rem;
  padding: .85rem clamp(1rem, 4vw, 3rem); color: var(--cream);
  background: rgba(11, 29, 23, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(247, 242, 231, .08);
}
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.1rem; text-decoration: none; }
.mark { width: 2.1rem; height: 2.1rem; }
.mark rect { fill: var(--lime); }
.mark path { fill: var(--deep); }
.nav-links { display: flex; gap: .25rem; margin-inline-start: auto; }
.nav-link { padding: .45rem .75rem; border-radius: 999px; text-decoration: none; color: rgba(247, 242, 231, .8); font-weight: 600; }
.nav-link:hover { color: var(--cream); background: rgba(247, 242, 231, .08); }
.nav-actions { display: flex; align-items: center; gap: .5rem; }
.nav-actions form { margin: 0; }

/* Hero */
.hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center; gap: clamp(1.5rem, 4vw, 4rem); min-height: calc(100vh - 4rem);
  padding: clamp(2.5rem, 7vw, 6rem) clamp(1rem, 5vw, 4rem); color: var(--cream);
  background:
    radial-gradient(60rem 40rem at 85% 10%, rgba(31, 90, 73, .9), transparent 60%),
    radial-gradient(40rem 30rem at 0% 100%, rgba(255, 140, 97, .16), transparent 60%),
    var(--deep);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(247, 242, 231, .07) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 85%);
}
.hero-copy { position: relative; z-index: 2; max-width: 38rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem; margin: 0 0 1.2rem; padding: .35rem .85rem;
  border: 1px solid rgba(200, 241, 105, .35); border-radius: 999px; color: var(--lime); font-weight: 700; font-size: .9rem;
}
.eyebrow::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--lime); animation: pulse 2.4s ease-in-out infinite; }
.hero h1 {
  margin: 0; font-size: clamp(2.6rem, 6.4vw, 5.2rem); line-height: 1.02; letter-spacing: -.035em; font-weight: 850;
}
html[lang="fa"] .hero h1 { letter-spacing: normal; line-height: 1.3; }
.hero h1 em {
  font-style: normal; color: var(--lime); position: relative; white-space: nowrap;
  background: linear-gradient(var(--coral), var(--coral)) no-repeat 0 92% / 0 .14em;
  animation: underline 1.2s .5s cubic-bezier(.2, .8, .2, 1) forwards;
}
html[dir="rtl"] .hero h1 em { background-position: 100% 92%; }
.lead { margin: 1.4rem 0 2rem; font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: rgba(247, 242, 231, .82); max-width: 33rem; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.hero-note { flex-basis: 100%; margin: .4rem 0 0; color: rgba(247, 242, 231, .6); font-size: .95rem; }

/* Hero stage illustration */
.stage { position: relative; z-index: 1; width: min(100%, 34rem); aspect-ratio: 1; justify-self: center; }
.orb { position: absolute; border-radius: 50%; filter: blur(40px); opacity: .7; animation: float 14s ease-in-out infinite; }
.orb-a { width: 55%; height: 55%; top: 5%; inset-inline-end: 0; background: radial-gradient(circle, var(--lime-deep), transparent 70%); }
.orb-b { width: 45%; height: 45%; bottom: 0; inset-inline-start: 5%; background: radial-gradient(circle, var(--coral), transparent 70%); animation-delay: -5s; }
.orb-c { width: 30%; height: 30%; top: 40%; inset-inline-start: 40%; background: radial-gradient(circle, var(--sky), transparent 70%); animation-delay: -9s; opacity: .45; }
.rings { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 60s linear infinite; }
.rings circle { fill: none; stroke: rgba(247, 242, 231, .16); stroke-width: 1; stroke-dasharray: 4 10; }
.rings circle + circle { stroke-dasharray: 2 14; stroke: rgba(200, 241, 105, .22); }
.paper {
  position: absolute; top: 14%; inset-inline-start: 16%; width: 62%; padding: 1.1rem 1.2rem 1.3rem;
  background: var(--paper); color: var(--ink); border-radius: 1.1rem;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .5) inset;
  transform: rotate(-4deg); animation: bob 7s ease-in-out infinite;
  font-size: clamp(.72rem, 1.35vw, .92rem);
}
html[dir="rtl"] .paper { transform: rotate(4deg); animation-name: bob-rtl; }
.paper-head { display: flex; gap: .3rem; margin-bottom: .7rem; }
.dot { width: .5rem; height: .5rem; border-radius: 50%; background: #e3ddd0; }
.dot:first-child { background: var(--coral); }
.paper-title { margin: 0 0 .6rem; font-weight: 800; font-size: 1.15em; }
.paper-q { margin: .6rem 0 .35rem; font-weight: 700; }
.opt { display: flex; align-items: center; gap: .5rem; padding: .3rem .45rem; border-radius: .5rem; color: var(--muted); }
.opt-pick { animation: pick 8s ease-in-out infinite; }
.radio { position: relative; width: 1em; height: 1em; border: 2px solid #a7b3ab; border-radius: 50%; flex: none; }
.radio-dot { position: absolute; inset: 2px; border-radius: 50%; background: var(--forest); transform: scale(0); animation: dot 8s cubic-bezier(.3, 1.6, .5, 1) infinite; }
.field { display: flex; align-items: center; min-height: 2.1em; padding: 0 .6rem; border: 1.5px solid #cfd8d2; border-radius: .5rem; }
.typed { display: inline-block; overflow: hidden; white-space: nowrap; max-width: 0; animation: type 8s steps(12, end) infinite; }
.caret { width: 2px; height: 1.1em; margin-inline-start: 1px; background: var(--forest); animation: blink 1s steps(1) infinite; }
.paper-submit {
  display: inline-block; margin-top: .8rem; padding: .35rem .9rem; border-radius: 999px; background: var(--forest);
  color: var(--paper); font-weight: 700; animation: press 8s ease-in-out infinite;
}
.badge {
  position: absolute; display: inline-flex; align-items: center; gap: .45rem; padding: .55rem .9rem; border-radius: 999px;
  background: rgba(255, 253, 247, .96); color: var(--ink); font-weight: 800; font-size: clamp(.72rem, 1.3vw, .9rem);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .65);
}
.badge svg { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.badge-score { bottom: 16%; inset-inline-end: 2%; color: var(--forest); animation: pop 8s cubic-bezier(.3, 1.5, .5, 1) infinite; }
.badge-score .tick { stroke-dasharray: 22; stroke-dashoffset: 22; animation: draw 8s ease infinite; }
.badge-timer { top: 6%; inset-inline-end: 6%; color: #a8401f; animation: drift 6s ease-in-out infinite; }
.badge-chart { bottom: 4%; inset-inline-start: 4%; animation: drift 7s -2s ease-in-out infinite; }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 1.1em; }
.bars i { width: 4px; border-radius: 2px; background: var(--lime-deep); transform-origin: bottom; animation: grow 2.4s ease-in-out infinite; }
.bars i:nth-child(1) { height: 40%; }
.bars i:nth-child(2) { height: 80%; animation-delay: -.4s; }
.bars i:nth-child(3) { height: 60%; animation-delay: -.8s; background: var(--coral); }
.bars i:nth-child(4) { height: 100%; animation-delay: -1.2s; }
.bars i:nth-child(5) { height: 70%; animation-delay: -1.6s; }

/* Marquee */
.marquee { display: flex; overflow: hidden; background: var(--lime); color: var(--deep); border-block: 1px solid rgba(11, 29, 23, .15); }
.marquee ul { display: flex; flex: none; gap: 2.5rem; margin: 0; padding: .9rem 1.25rem; list-style: none; animation: marquee 38s linear infinite; }
html[dir="rtl"] .marquee ul { animation-name: marquee-rtl; }
.marquee li { font-weight: 800; white-space: nowrap; display: flex; align-items: center; gap: 2.5rem; }
.marquee li::after { content: "✦"; color: var(--forest); }

/* Sections */
.features, .how { padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1rem, 5vw, 4rem); max-width: 76rem; margin: 0 auto; }
.features h2, .how h2, .cta-band h2 { margin: 0 0 2.2rem; font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.15; letter-spacing: -.02em; max-width: 30ch; }
html[lang="fa"] .features h2, html[lang="fa"] .how h2, html[lang="fa"] .cta-band h2 { letter-spacing: normal; line-height: 1.4; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1rem; }
.feature {
  position: relative; padding: 1.6rem; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line);
  transition: transform .3s ease, box-shadow .3s ease, opacity .7s ease;
}
.feature:hover { transform: translateY(-6px); box-shadow: 0 24px 50px -30px rgba(16, 34, 28, .45); }
.feature-icon {
  width: 3rem; height: 3rem; padding: .65rem; margin-bottom: 1.1rem; border-radius: .9rem; background: var(--deep);
  fill: none; stroke: var(--lime); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .4s cubic-bezier(.3, 1.6, .5, 1);
}
.feature:hover .feature-icon { transform: rotate(-8deg) scale(1.08); }
.feature h3 { margin: 0 0 .4rem; font-size: 1.15rem; }
.feature p { margin: 0; color: var(--muted); }

.how { padding-top: 0; }
.steps { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
.steps::before {
  content: ""; position: absolute; top: 1.6rem; inset-inline: 8%; height: 2px;
  background: repeating-linear-gradient(90deg, var(--forest) 0 8px, transparent 8px 16px);
  background-size: 32px 2px; animation: dash 1.2s linear infinite; opacity: .35;
}
.step { position: relative; padding: 0 .5rem; transition: opacity .7s ease, transform .7s ease; }
.step-num {
  position: relative; display: grid; place-items: center; width: 3.2rem; height: 3.2rem; margin-bottom: 1rem; border-radius: 50%;
  background: var(--forest); color: var(--lime); font-weight: 850; font-size: 1.2rem; box-shadow: 0 0 0 8px var(--cream);
}
.step h3 { margin: 0 0 .3rem; font-size: 1.25rem; }
.step p { margin: 0; color: var(--muted); }

.cta-band {
  margin: 0 clamp(1rem, 5vw, 4rem) clamp(3rem, 7vw, 5rem); padding: clamp(2.5rem, 6vw, 4.5rem); border-radius: 2rem;
  color: var(--cream); text-align: center; display: grid; justify-items: center;
  background: linear-gradient(120deg, var(--forest), var(--deep) 45%, var(--moss), var(--forest));
  background-size: 300% 300%; animation: sheen 16s ease infinite; transition: opacity .7s ease, transform .7s ease;
}
.cta-band h2 { margin-bottom: .8rem; }
.cta-band p { margin: 0 0 1.6rem; max-width: 40ch; color: rgba(247, 242, 231, .8); }
.cta-band .cta-row { justify-content: center; }
.foot { display: flex; align-items: center; justify-content: center; gap: .6rem; padding: 2rem 1rem 2.5rem; color: var(--muted); font-size: .95rem; }
.foot .mark { width: 1.6rem; height: 1.6rem; }

/* Scroll reveal: hidden only when JavaScript runs, so content never disappears without it. */
.js .reveal { opacity: 0; transform: translateY(28px); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .feature.reveal:nth-child(2), .js .step.reveal:nth-child(2) { transition-delay: .08s; }
.js .feature.reveal:nth-child(3), .js .step.reveal:nth-child(3) { transition-delay: .16s; }
.js .feature.reveal:nth-child(4) { transition-delay: .06s; }
.js .feature.reveal:nth-child(5) { transition-delay: .14s; }
.js .feature.reveal:nth-child(6) { transition-delay: .22s; }
.features h2.reveal, .how h2.reveal { transition: opacity .7s ease, transform .7s ease; }

/* Sign-in and sign-up */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-art {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(1.5rem, 4vw, 3rem); color: var(--cream);
  background: radial-gradient(40rem 30rem at 100% 0%, rgba(31, 90, 73, .9), transparent 60%), var(--deep);
}
.brand-light { color: var(--cream); }
.auth-quote { position: relative; z-index: 2; }
.auth-quote p { margin: 2.5rem 0 0; font-size: clamp(2rem, 4vw, 3.4rem); font-weight: 850; line-height: 1.08; letter-spacing: -.03em; max-width: 14ch; }
html[lang="fa"] .auth-quote p { letter-spacing: normal; line-height: 1.35; }
.auth-quote em { font-style: normal; color: var(--lime); }
.mini-cards { position: relative; z-index: 2; height: 9rem; }
.mini-cards span {
  position: absolute; bottom: 0; width: 42%; height: 7.5rem; border-radius: 1rem; background: var(--paper);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8); animation: deal 9s ease-in-out infinite;
}
.mini-cards span::before, .mini-cards span::after { content: ""; position: absolute; inset-inline: 14%; height: .55rem; border-radius: 999px; background: #e6e0d3; }
.mini-cards span::before { top: 1.3rem; inset-inline-end: 35%; background: var(--forest); }
.mini-cards span::after { top: 2.6rem; box-shadow: 0 1.3rem 0 #e6e0d3, 0 2.6rem 0 var(--lime); }
.mini-cards span:nth-child(1) { inset-inline-start: 0; transform: rotate(-8deg); }
.mini-cards span:nth-child(2) { inset-inline-start: 28%; transform: rotate(2deg); animation-delay: -3s; }
.mini-cards span:nth-child(3) { inset-inline-start: 56%; transform: rotate(9deg); animation-delay: -6s; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: clamp(1.5rem, 5vw, 4rem); }
.back { align-self: flex-start; margin-bottom: 1.5rem; color: var(--muted); font-weight: 600; text-decoration: none; }
.back::before { content: "← "; }
html[dir="rtl"] .back::before { content: "→ "; }
.back:hover { color: var(--ink); }
.auth-card { width: min(100%, 26rem); }
.auth-card h1 { margin: 0; font-size: clamp(1.8rem, 3.5vw, 2.4rem); letter-spacing: -.02em; }
html[lang="fa"] .auth-card h1 { letter-spacing: normal; }
.auth-lead { margin: .4rem 0 1.6rem; color: var(--muted); }
.auth-card form { display: grid; gap: 1rem; }
.input { display: grid; gap: .35rem; font-weight: 700; }
.input input {
  width: 100%; min-height: 3rem; padding: .7rem .9rem; border: 1.5px solid #b9c4bd; border-radius: .8rem;
  background: var(--paper); color: var(--ink); font: inherit; font-weight: 500; transition: border-color .2s, box-shadow .2s;
}
.input input:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 4px rgba(22, 72, 59, .15); }
.input input[aria-invalid="true"] { border-color: #b42318; }
.input input[type="email"], .input input[name="code"] { direction: ltr; }
html[dir="rtl"] .input input[type="email"], html[dir="rtl"] .input input[name="code"] { text-align: right; }
.hint { color: var(--muted); font-weight: 500; font-size: .875rem; }
.field-error { color: #b42318; font-weight: 600; font-size: .9rem; }
.check { display: flex; align-items: center; gap: .6rem; margin-top: .2rem; font-weight: 600; cursor: pointer; }
.check input { width: 1.2rem; height: 1.2rem; accent-color: var(--forest); flex: none; }
.check + .hint { margin-top: -.6rem; padding-inline-start: 1.8rem; }
.alert { margin: 0 0 1rem; padding: .75rem 1rem; border-radius: .8rem; background: #fde8e4; color: #8a1f12; font-weight: 600; }
.note { margin: 0; padding: .85rem 1rem; border-radius: .8rem; background: #eaf5d3; color: #2c4a12; font-weight: 500; font-size: .95rem; }
.auth-card .btn-solid { margin-top: .4rem; background: var(--forest); color: var(--paper); box-shadow: 0 10px 24px -14px rgba(22, 72, 59, .9); }
.auth-card .btn-solid:hover { background: var(--moss); }
.switch { margin: 1.4rem 0 0; color: var(--muted); }
.switch a { color: var(--forest); font-weight: 700; }

/* Keyframes */
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(200, 241, 105, .6); } 50% { box-shadow: 0 0 0 6px rgba(200, 241, 105, 0); } }
@keyframes underline { to { background-size: 100% .14em; } }
@keyframes float { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(6%, -5%) scale(1.08); } 66% { transform: translate(-5%, 4%) scale(.95); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { 0%, 100% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(-2.5deg) translateY(-12px); } }
@keyframes bob-rtl { 0%, 100% { transform: rotate(4deg) translateY(0); } 50% { transform: rotate(2.5deg) translateY(-12px); } }
@keyframes pick { 0%, 12% { background: transparent; color: var(--muted); } 18%, 92% { background: #eaf5d3; color: var(--ink); } 100% { background: transparent; } }
@keyframes dot { 0%, 14% { transform: scale(0); } 20%, 92% { transform: scale(1); } 100% { transform: scale(0); } }
@keyframes type { 0%, 28% { max-width: 0; } 55%, 92% { max-width: 12em; } 100% { max-width: 0; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes press { 0%, 60% { transform: scale(1); } 63% { transform: scale(.92); background: var(--moss); } 67%, 100% { transform: scale(1); } }
@keyframes pop { 0%, 64% { opacity: 0; transform: translateY(10px) scale(.8); } 70%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-6px) scale(.95); } }
@keyframes draw { 0%, 68% { stroke-dashoffset: 22; } 76%, 100% { stroke-dashoffset: 0; } }
@keyframes drift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes grow { 0%, 100% { transform: scaleY(.45); } 50% { transform: scaleY(1); } }
@keyframes marquee { to { transform: translateX(-100%); } }
@keyframes marquee-rtl { to { transform: translateX(100%); } }
@keyframes dash { to { background-position: 32px 0; } }
@keyframes sheen { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes deal { 0%, 100% { translate: 0 0; } 50% { translate: 0 -14px; } }

/* Narrow screens */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .stage { width: min(100%, 26rem); }
  .nav-links .nav-link:not(.lang) { display: none; }
  .steps { grid-template-columns: 1fr; gap: 1.6rem; }
  .steps::before { display: none; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { min-height: 11rem; }
  .auth-quote p { margin-top: 1rem; font-size: 1.7rem; }
  .mini-cards { display: none; }
}
@media (max-width: 560px) {
  .nav { gap: .5rem; padding-inline: 1rem; }
  .brand span { display: none; }
  .nav-actions .btn { padding-inline: .8rem; min-height: 2.5rem; font-size: .9rem; }
  .hero { padding-top: 2rem; }
  .cta-row .btn-lg { flex: 1 1 auto; }
}

/* Respect reduced motion: show every illustration in its finished state. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .hero h1 em { background-size: 100% .14em; }
  .typed { max-width: 12em; }
  .radio-dot { transform: scale(1); }
  .opt-pick { background: #eaf5d3; color: var(--ink); }
  .badge-score { opacity: 1; }
  .badge-score .tick { stroke-dashoffset: 0; }
  .js .reveal { opacity: 1; transform: none; }
  .marquee ul:last-child { display: none; }
  .marquee, .marquee ul { flex-wrap: wrap; }
}
