/* What AI Means to Us — styles.css
   Calm, neutral, "quietly futuristic." Dark palette, system fonts,
   mobile-first, no imagery, no webfonts. One restrained accent. */

:root {
  --bg: #0d1117;
  --bg-elev: #161b22;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-press: #79c0ff;
  --border: #30363d;
  --radius: 12px;
  --radius-sm: 8px;
  --max-w: 640px;
  --tap: 48px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
          Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 17px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Layout --- */

.view {
  flex: 1;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hidden { display: none !important; }

header {
  text-align: center;
  padding-top: 1rem;
}

h1 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.tagline {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

/* --- Language picker --- */

.language-picker h2 {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.lang-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.lang-buttons button {
  min-height: var(--tap);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.lang-buttons button:hover { border-color: var(--accent); }

.lang-buttons button.active {
  border-color: var(--accent);
  background: rgba(88, 166, 255, 0.1);
  color: var(--accent-press);
}

/* --- Intro section --- */

.intro p { color: var(--text); }

.intro ul {
  list-style: none;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.intro li {
  padding-left: 1.25rem;
  position: relative;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.intro li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
}

.privacy {
  font-size: 0.85rem;
  color: var(--text-muted);
  opacity: 0.8;
  margin-top: 0.5rem;
}

/* --- Primary button --- */

.primary {
  min-height: var(--tap);
  padding: 0.85rem 1.5rem;
  font-family: inherit;
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
  align-self: stretch;
}

.primary:hover { background: var(--accent-press); }
.primary:active { transform: scale(0.98); }

/* --- Form view (survey) --- */

.progress {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.progress-bar {
  height: 6px;
  background: var(--bg-elev);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.25s ease;
  border-radius: 999px;
}
.progress-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.form-section h2 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.section-hint {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-top: -0.5rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.field > label,
.field-label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
}
.field > label.required::after,
.field-label.required::after {
  content: " *";
  color: var(--accent);
}

textarea,
input[type="text"],
select {
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.8rem;
  width: 100%;
  min-height: var(--tap);
  line-height: 1.5;
  transition: border-color 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}
textarea { resize: vertical; min-height: 96px; }
textarea:focus,
input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
}
select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%238b949e' d='M6 8L0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 10px 6px;
  padding-right: 2.2rem;
}

.radio-field { gap: 0.5rem; }
.radio-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  min-height: var(--tap);
  padding: 0.3rem 0;
}
.radio-row input[type="radio"] {
  width: 20px;
  height: 20px;
  margin-top: 0.25rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.radio-row label {
  font-size: 1rem;
  color: var(--text);
  cursor: pointer;
}

.checkbox-field { gap: 0.6rem; }
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  min-height: var(--tap);
  padding: 0.4rem 0;
  cursor: pointer;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--text);
}
.checkbox-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 0.2rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.field-error {
  font-size: 0.85rem;
  color: #f87171;
  margin-top: 0.1rem;
  line-height: 1.4;
}

.skip-link {
  display: inline-block;
  color: var(--accent);
  font-size: 0.9rem;
  text-decoration: none;
  padding: 0.4rem 0;
  align-self: flex-start;
}
.skip-link:hover { text-decoration: underline; }

.consent-block {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}
.form-actions .primary {
  align-self: stretch;
  margin-top: 0.5rem;
}
.link-button {
  min-height: var(--tap);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
  padding: 0.6rem;
  -webkit-tap-highlight-color: transparent;
}
.link-button:hover { color: var(--accent); }

/* --- Footer --- */

footer {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  opacity: 0.6;
}

/* --- Confirmation (thanks) view --- */

#view-thanks {
  text-align: center;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
}

.thanks-header {
  text-align: center;
}

.thanks-header h1 {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: var(--text);
}

.thanks-body {
  margin-top: 0.85rem;
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.contribution {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.contribution-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.contribution-code-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.25rem;
  background: var(--bg-elev);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  min-width: 180px;
}

.contribution-code-box code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent-press);
}

.contribution-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  opacity: 0.85;
  max-width: 460px;
}

#view-thanks .privacy {
  margin-top: 0.5rem;
}

/* --- Form banner (rate-limit / network / generic) --- */

.form-banner {
  font-size: 0.95rem;
  color: #f87171;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  line-height: 1.5;
  margin: 0;
}

.turnstile-widget {
  display: none;
}

/* --- Submit "sending" state --- */

#btn-submit.sending {
  opacity: 0.7;
  cursor: wait;
  pointer-events: none;
}

#btn-submit.sending::after {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-left: 0.5em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -0.15em;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Responsive: wider spacing on larger screens --- */

@media (min-width: 600px) {
  .view { padding: 4rem 2rem 3rem; }
  h1 { font-size: 2.25rem; }
  .tagline { font-size: 1.15rem; }
  .lang-buttons { grid-template-columns: repeat(4, 1fr); }
  .primary { align-self: center; padding: 0.85rem 2.5rem; }
}

/* --- Reduced motion --- */

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
