/* Tappo12 — sito beta. Token dal design system app (src/theme/tokens.ts). */

:root {
  --bg: #16241c;
  --surface: #21302a;
  --surface-raised: #283a32;
  --green: #6aa245;
  --green-deep: #3f5e2c;
  --gold: #eba63c;
  --gold-ink: #201202;
  --ink: #f4eedf;
  --muted: #bcb59c;
  --error: #f0836e;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4.5rem;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-pill: 999px;

  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --duration: 200ms;

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(ellipse 120% 70% at 50% -10%, var(--green-deep) 0%, var(--bg) 55%);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.noscript-banner {
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 600;
  text-align: center;
  padding: var(--space-2) var(--space-3);
}

/* ---------- Layout ---------- */

.page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.site-header {
  padding: var(--space-4) var(--space-4) 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.site-logo-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--ink);
  border-radius: var(--radius-sm);
}

.site-logo-link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

.logo {
  height: 2.5rem;
  width: auto;
  display: block;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.wordmark-accent {
  color: var(--gold);
}

.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5) var(--space-4) var(--space-6);
}

.panel {
  width: 100%;
  max-width: 30rem;
}

.site-footer {
  padding: var(--space-4);
  text-align: center;
  font-size: 0.875rem;
}

.site-footer a {
  color: var(--muted);
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
}

.site-footer a:hover {
  color: var(--ink);
}

.site-footer a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Hero ---------- */

.hero {
  margin-bottom: var(--space-5);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.85rem, 5.5vw + 0.5rem, 2.75rem);
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0 0 var(--space-3);
}

.text-balance {
  text-wrap: balance;
}

.hero-sub {
  margin: 0;
  max-width: 42ch;
  font-size: 1.0625rem;
  color: var(--muted);
}

/* ---------- Form ---------- */

.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.field label,
.field-legend {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
}

.field-optional {
  font-weight: 400;
  color: var(--muted);
}

.field input[type="text"],
.field input[type="email"] {
  appearance: none;
  width: 100%;
  min-height: 3rem;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-raised);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color var(--duration) var(--ease-out-quart), background-color var(--duration) var(--ease-out-quart);
}

.field input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.field input:hover {
  border-color: var(--muted);
}

.field input:focus-visible {
  outline: none;
  border-color: var(--gold);
  background: var(--surface-raised);
  box-shadow: 0 0 0 3px rgb(235 166 60 / 0.25);
}

.field input:invalid:not(:placeholder-shown):not(:focus) {
  border-color: var(--error);
}

/* Honeypot: hidden from sighted users and keyboard/AT, still present for bots to fill. */
.field-hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Platform toggle ---------- */

.platform-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.platform-btn {
  appearance: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
  min-height: 3.25rem;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-raised);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  text-align: left;
  transition: border-color var(--duration) var(--ease-out-quart), background-color var(--duration) var(--ease-out-quart);
}

.platform-btn:hover {
  border-color: var(--muted);
}

.platform-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgb(235 166 60 / 0.25);
}

.platform-btn-label {
  font-weight: 600;
  font-size: 0.9375rem;
}

.platform-btn-sub {
  font-size: 0.8125rem;
  color: var(--muted);
}

.platform-btn[aria-pressed="true"] {
  border-color: var(--gold);
  background: rgb(235 166 60 / 0.12);
}

.platform-btn[aria-pressed="true"] .platform-btn-sub {
  color: var(--gold);
}

/* ---------- Error ---------- */

.form-error {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: rgb(240 131 110 / 0.12);
  color: var(--error);
  font-size: 0.9375rem;
  font-weight: 500;
}

/* ---------- Submit ---------- */

.submit-btn {
  appearance: none;
  cursor: pointer;
  min-height: 3.25rem;
  padding: 0 var(--space-4);
  border: none;
  border-radius: var(--radius-pill);
  background: var(--gold);
  color: var(--gold-ink);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  transition: transform var(--duration) var(--ease-out-quart), box-shadow var(--duration) var(--ease-out-quart), opacity var(--duration) var(--ease-out-quart);
}

.submit-btn:hover:not(:disabled) {
  box-shadow: 0 6px 20px -6px rgb(235 166 60 / 0.55);
  transform: translateY(-1px);
}

.submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.submit-btn:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.submit-btn:disabled {
  cursor: default;
  opacity: 0.65;
}

.form-note {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: center;
}

/* ---------- Success ---------- */

.success-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: var(--space-3);
  border-radius: 50%;
  border: 1px solid var(--green);
  color: var(--green);
  font-size: 1.25rem;
}

.instructions {
  margin-top: var(--space-5);
}

.instructions p {
  margin: 0 0 var(--space-3);
  color: var(--muted);
  max-width: 48ch;
}

.instr-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  margin: 0 0 var(--space-1);
}

.instr-lead {
  margin: 0 0 var(--space-4);
  color: var(--muted);
  max-width: 48ch;
}

.steps {
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.steps li {
  position: relative;
  padding-left: 2.5rem;
  color: var(--ink);
  max-width: 46ch;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.1rem;
  width: 1.7rem;
  height: 1.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgb(235 166 60 / 0.15);
  color: var(--gold);
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.instr-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--green);
  color: var(--gold-ink);
  font-weight: 700;
  text-decoration: none;
  transition: background-color var(--duration) var(--ease-out-quart);
}

.instr-link:hover {
  background: #7db354;
}

.instr-link:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- Legal (privacy.html) ---------- */

.legal-panel {
  max-width: 38rem;
}

.legal-body h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  margin: var(--space-5) 0 var(--space-2);
}

.legal-body p {
  margin: 0 0 var(--space-3);
  color: var(--muted);
}

.legal-body ul {
  margin: 0 0 var(--space-3);
  padding-left: 1.25rem;
  color: var(--muted);
}

.legal-body li {
  margin-bottom: var(--space-1);
}

.legal-body strong {
  color: var(--ink);
  font-weight: 600;
}

.legal-back {
  margin-top: var(--space-5);
}

.legal-back a {
  color: var(--gold);
  font-weight: 600;
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
}

.legal-back a:hover {
  color: var(--ink);
}

.legal-back a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Responsive ---------- */

@media (min-width: 640px) {
  .site-header {
    padding: var(--space-5) var(--space-5) 0;
  }

  .main {
    padding: var(--space-6) var(--space-5) var(--space-7);
  }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }

  .submit-btn:hover:not(:disabled) {
    transform: none;
  }
}
