/* ===== DS-Root Tokens (subset) ===== */
:root {
  --surface-primary: #0F1729;
  --surface-secondary: #1A2332;
  --surface-tertiary: #243044;
  --neutral-100: #F1F5F9;
  --neutral-200: #E2E8F0;
  --neutral-300: #CBD5E1;
  --neutral-400: #94A3B8;
  --neutral-500: #64748B;
  --neutral-600: #475569;
  --insight: #2563EB;
  --opportunity: #059669;
  --risk: #DC2626;
  --gap: #D97706;
  --accent: #E8913A;
  --cat-01: #8B5CF6;
  --cat-02: #3B82F6;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 8px;
  --radius-lg: 12px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-sans);
  background: var(--surface-primary);
  color: var(--neutral-200);
  line-height: 1.5;
  min-height: 100vh;
}

/* ===== Form Page ===== */
.form-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

.form-header {
  text-align: center;
  margin-bottom: 32px;
}

.form-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--neutral-100);
  margin-bottom: 8px;
}

.form-header p {
  font-size: 14px;
  color: var(--neutral-400);
}

/* ===== Form Groups ===== */
.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--neutral-200);
  margin-bottom: 8px;
}

.form-group .hint {
  display: block;
  font-size: 13px;
  color: var(--neutral-500);
  margin-bottom: 8px;
  font-style: italic;
}

/* ===== Text Input ===== */
input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px; /* anti-zoom iOS */
  font-family: var(--font-sans);
  background: var(--surface-secondary);
  border: 1px solid var(--neutral-600);
  border-radius: var(--radius);
  color: var(--neutral-100);
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus {
  border-color: var(--accent);
}

input[type="text"]::placeholder {
  color: var(--neutral-600);
}

/* ===== Radio Cards ===== */
.radio-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface-secondary);
  border: 1px solid var(--neutral-600);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  min-height: 48px; /* touch target */
}

.radio-card:active {
  background: var(--surface-tertiary);
}

.radio-card input[type="radio"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--neutral-500);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.radio-card input[type="radio"]:checked {
  border-color: var(--accent);
}

.radio-card input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
}

.radio-card.selected {
  border-color: var(--accent);
  background: rgba(232, 145, 58, 0.08);
}

.radio-card span {
  font-size: 15px;
  color: var(--neutral-200);
}

/* ===== Select ===== */
select {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px; /* anti-zoom iOS */
  font-family: var(--font-sans);
  background: var(--surface-secondary);
  border: 1px solid var(--neutral-600);
  border-radius: var(--radius);
  color: var(--neutral-100);
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%2394A3B8'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
  min-height: 48px;
}

select:focus {
  border-color: var(--accent);
}

/* ===== Submit Button ===== */
.btn-submit {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-sans);
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.2s;
  min-height: 52px;
  margin-top: 8px;
}

.btn-submit:active {
  opacity: 0.85;
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== Success Screen ===== */
.success-screen {
  display: none;
  text-align: center;
  padding: 80px 20px;
}

.success-screen h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--neutral-100);
  margin-bottom: 12px;
}

.success-screen p {
  font-size: 16px;
  color: var(--neutral-400);
  max-width: 320px;
  margin: 0 auto;
}

.success-check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--opportunity);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 32px;
  color: #fff;
}

/* ===== Error ===== */
.form-error {
  display: none;
  padding: 12px 16px;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid var(--risk);
  border-radius: var(--radius);
  color: var(--risk);
  font-size: 14px;
  margin-bottom: 16px;
}

/* ===== Admin Page ===== */
.admin-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--neutral-100);
}

.admin-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.admin-count {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  color: var(--accent);
}

.admin-status {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.admin-status.released {
  background: rgba(5, 150, 105, 0.15);
  color: var(--opportunity);
}

.admin-status.blocked {
  background: rgba(100, 116, 139, 0.15);
  color: var(--neutral-400);
}

.btn-toggle {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-sans);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-toggle.release {
  background: var(--opportunity);
  color: #fff;
}

.btn-toggle.block {
  background: var(--neutral-600);
  color: var(--neutral-200);
}

/* ===== Charts Grid ===== */
.charts-section {
  margin-bottom: 32px;
}

.charts-section h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--neutral-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.chart-card {
  background: var(--surface-secondary);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

.chart-card h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--neutral-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.chart-wrapper {
  position: relative;
  width: 100%;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ===== Response Feed ===== */
.feed-section h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--neutral-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.response-card {
  background: var(--surface-secondary);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 8px;
}

.response-card .name {
  font-weight: 600;
  color: var(--neutral-100);
  margin-bottom: 4px;
}

.response-card .meta {
  font-size: 13px;
  color: var(--neutral-500);
  margin-bottom: 8px;
}

.response-card .detail {
  font-size: 14px;
  color: var(--neutral-300);
}

.response-card .detail strong {
  color: var(--neutral-400);
  font-weight: 500;
}

/* ===== Result Page ===== */
.result-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 40px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 32px;
}

.result-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--neutral-100);
}

.result-count {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--accent);
}

.waiting-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.waiting-screen h2 {
  font-size: 32px;
  font-weight: 700;
  color: var(--neutral-100);
  margin-bottom: 12px;
}

.waiting-screen p {
  font-size: 18px;
  color: var(--neutral-500);
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ===== Unauthorized ===== */
.unauthorized {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  color: var(--neutral-500);
  font-size: 18px;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .result-container {
    padding: 20px;
  }
  .result-header h1 {
    font-size: 22px;
  }
  .result-count {
    font-size: 18px;
  }
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
