/* ===================================================
   Signal — feedback-collect site
   Dark theme by default, light mode via data-theme="light"
   =================================================== */

/* ---------- Design tokens ---------- */
:root {
  --paper:   #0e0e16;
  --surface: #17171f;
  --surface2:#1f1f2c;
  --border:  #2a2a3a;
  --border2: #363648;
  --text:    #e2e2ec;
  --muted:   #888899;
  --faint:   #555567;
  --accent:  #7c6ef5;
  --accent2: #a590ff;
  --accent-glow: rgba(124,110,245,.18);
  --success: #3ecf7a;
  --error:   #f56565;
  --error-bg: rgba(245,101,101,.1);

  --radius: .9rem;
  --radius-sm: .5rem;
  --max-w: 1080px;
  --nav-h: 64px;
  --transition: .2s ease;
}

[data-theme="light"] {
  --paper:   #f4f4f8;
  --surface: #ffffff;
  --surface2:#ebebf3;
  --border:  #d0d0df;
  --border2: #c0c0d0;
  --text:    #18181f;
  --muted:   #555568;
  --faint:   #8888a0;
  --accent:  #5b49e8;
  --accent2: #7060f0;
  --accent-glow: rgba(91,73,232,.12);
  --success: #1e9e56;
  --error:   #d63030;
  --error-bg: rgba(214,48,48,.08);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--paper);
  color: var(--text);
  line-height: 1.65;
  font-size: 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background var(--transition), color var(--transition);
}
main { flex: 1; }
img, svg { display: block; }
a { color: inherit; text-decoration: none; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -.02em;
  color: var(--text);
}
em { font-style: normal; color: var(--accent2); }

/* ---------- Layout helpers ---------- */
.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.section-label {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition), background var(--transition), box-shadow var(--transition);
  border: none;
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 0 var(--accent-glow);
}
.btn-primary:hover {
  opacity: .9;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border2);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border2); background: var(--surface2); }
.btn-large { padding: .8rem 1.6rem; font-size: 1rem; border-radius: var(--radius-sm); }
.btn-full { width: 100%; justify-content: center; }

/* Submit button loading state */
.btn .btn-spinner { display: none; }
.btn.loading .btn-label { opacity: 0; }
.btn.loading .btn-spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  position: absolute;
}
.btn.loading { position: relative; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background var(--transition);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}
.logo svg { color: var(--accent); }
.nav-actions { display: flex; align-items: center; gap: .75rem; }

/* Theme toggle */
.theme-toggle {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--border2);
  background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  color: var(--muted);
  transition: border-color var(--transition), color var(--transition), background var(--transition);
  padding: 0;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); background: var(--surface2); }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: block; }

/* ---------- Hero ---------- */
.hero {
  min-height: calc(88vh - var(--nav-h));
  display: flex;
  align-items: center;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 5rem 1.5rem 4rem;
  gap: 4rem;
}
.hero-content { flex: 1; min-width: 0; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--border2);
  background: var(--surface);
  padding: .35rem .8rem;
  border-radius: 2rem;
  margin-bottom: 1.75rem;
}
.hero-title {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.03em;
  margin-bottom: 1.25rem;
}
.hero-desc {
  font-size: 1.15rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 520px;
  margin-bottom: 2rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.hero-note {
  font-size: .82rem;
  color: var(--faint);
  letter-spacing: .01em;
}

/* Hero visual — pulse rings */
.hero-visual {
  flex-shrink: 0;
  width: 260px; height: 260px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.pulse-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  animation: pulseRing 3s ease-out infinite;
}
.ring-1 { width: 80px;  height: 80px;  animation-delay: 0s;    opacity: .5; }
.ring-2 { width: 140px; height: 140px; animation-delay: .6s;   opacity: .3; }
.ring-3 { width: 210px; height: 210px; animation-delay: 1.2s;  opacity: .15; }
@keyframes pulseRing {
  0%   { transform: scale(.8); opacity: inherit; }
  70%  { transform: scale(1);  opacity: 0; }
  100% { transform: scale(1);  opacity: 0; }
}
.signal-core {
  position: relative;
  z-index: 2;
  color: var(--accent);
}

/* ---------- How section ---------- */
.how {
  padding: 5rem 0;
  border-top: 1px solid var(--border);
}
.section-title {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -.025em;
  margin-bottom: 3rem;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow), 0 8px 32px rgba(0,0,0,.2);
}
.card-icon {
  width: 44px; height: 44px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  margin-bottom: 1.1rem;
}
.card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: .5rem;
  letter-spacing: -.01em;
}
.card p { font-size: .92rem; color: var(--muted); line-height: 1.6; }

/* ---------- CTA banner ---------- */
.cta-banner {
  padding: 4rem 0;
  border-top: 1px solid var(--border);
}
.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.cta-text h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: .5rem; }
.cta-text p  { color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: .85rem;
  color: var(--faint);
}
.footer-logo { font-weight: 700; color: var(--muted); }

/* ---------- Feedback form page ---------- */
.form-page {
  padding: 4rem 1.5rem 5rem;
}
.form-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 5rem;
  align-items: start;
}
.form-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -.03em;
  margin-bottom: 1rem;
}
.form-desc {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 2rem;
  font-size: 1rem;
}
.form-promises {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.form-promises li {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .9rem;
  color: var(--muted);
}
.form-promises svg { color: var(--success); flex-shrink: 0; }

/* Form card */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.25rem;
}

/* Fields */
.field-group { margin-bottom: 1.5rem; }
.field-label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .5rem;
  letter-spacing: -.005em;
}
.field-required { color: var(--accent); }
.field-input, .field-textarea {
  width: 100%;
  background: var(--surface2);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .95rem;
  line-height: 1.6;
  padding: .7rem 1rem;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  font-family: inherit;
  outline: none;
  resize: none;
}
.field-input::placeholder, .field-textarea::placeholder { color: var(--faint); }
.field-input:focus, .field-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--surface);
}
.has-error .field-input,
.has-error .field-textarea {
  border-color: var(--error);
  box-shadow: 0 0 0 3px var(--error-bg);
}
.field-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
  margin-top: .4rem;
}
.field-error {
  font-size: .8rem;
  color: var(--error);
  min-height: 1.1rem;
  line-height: 1.3;
}
.char-count {
  font-size: .78rem;
  color: var(--faint);
  white-space: nowrap;
  flex-shrink: 0;
}
.form-actions { margin-top: .5rem; }

/* Error banner */
.form-error-banner {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: var(--error-bg);
  border: 1px solid rgba(245,101,101,.25);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  font-size: .875rem;
  color: var(--error);
  margin-top: 1rem;
}

/* Success state */
.form-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1rem;
  gap: 1rem;
}
.success-icon { color: var(--success); }
.form-success h2 { font-size: 1.6rem; }
.form-success p  { color: var(--muted); max-width: 340px; line-height: 1.65; }

/* Success SVG ring animation */
.success-ring {
  stroke: var(--success);
  stroke-dasharray: 138;
  stroke-dashoffset: 138;
  transition: stroke-dashoffset .6s ease .1s;
}
.success-ring.animate { stroke-dashoffset: 0; }
.success-check {
  stroke: var(--success);
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  transition: stroke-dashoffset .4s ease .5s;
}
.success-check.animate { stroke-dashoffset: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero {
    flex-direction: column;
    min-height: auto;
    padding: 3.5rem 1.5rem 3rem;
    gap: 3rem;
    text-align: center;
  }
  .hero-desc { max-width: 100%; margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-visual { display: none; }
  .form-wrap {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .form-context { order: 0; }
  .form-card    { order: 1; }
}

@media (max-width: 540px) {
  .nav-cta { display: none; }
  .hero-title { font-size: 2.2rem; }
  .form-card { padding: 1.5rem; }
  .cta-inner { flex-direction: column; text-align: center; align-items: center; }
  .section-title { margin-bottom: 2rem; }
}
