:root {
  --bg: #0f172a;
  --bg-soft: #111827;
  --card: rgba(255, 255, 255, 0.96);
  --card-border: rgba(148, 163, 184, 0.25);
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #dbeafe;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --radius: 16px;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  color: var(--text);
  background: #eef2ff;
  min-height: 100vh;
}
.app-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.18), transparent 35%),
    radial-gradient(circle at 90% 10%, rgba(99, 102, 241, 0.16), transparent 30%),
    linear-gradient(180deg, #eef2ff 0%, #f8fafc 100%);
  z-index: -1;
}
.container { width: min(980px, calc(100% - 32px)); margin: 0 auto; }

.site-header {
  padding: 18px 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}
.brand strong { display: block; font-size: 15px; }
.brand small { color: var(--muted); font-size: 12px; }
.header-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.main-content { padding: 8px 0 48px; }

.hero-card, .form-shell, .panel, .success-card, .admin-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero-card {
  padding: 28px 28px 24px;
  margin-bottom: 18px;
}
.hero-card h1 {
  margin: 0 0 8px;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.15;
}
.hero-card p { margin: 0; color: var(--muted); line-height: 1.6; }

.form-shell { padding: 24px; }
.stepper {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}
.step-pill {
  text-align: center;
  padding: 10px 6px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: .2s ease;
}
.step-pill.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: #93c5fd;
}
.step-pill.done {
  background: #ecfdf5;
  color: var(--success);
  border-color: #6ee7b7;
}

.form-step { display: none; animation: fade .25s ease; }
.form-step.active { display: block; }
@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.section-title {
  margin: 0 0 6px;
  font-size: 20px;
}
.section-lead {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.field small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="url"],
.field input[type="date"],
.field input[type="password"],
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.upload-card {
  border: 1.5px dashed #cbd5e1;
  border-radius: 14px;
  padding: 14px;
  background: #f8fafc;
}
.upload-card.has-file {
  border-color: #34d399;
  background: #ecfdf5;
}
.upload-card label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
}
.upload-card .hint { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.upload-card input[type="file"] { width: 100%; font-size: 12px; }
.file-name { margin-top: 8px; font-size: 12px; color: var(--success); font-weight: 600; }

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  font-size: 13px;
}
.choice input { accent-color: var(--primary); }

.counter-table, .data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.counter-table th, .data-table th,
.counter-table td, .data-table td {
  border: 1px solid #e2e8f0;
  padding: 8px;
  text-align: left;
}
.counter-table th, .data-table th { background: #f8fafc; }

.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #e2e8f0;
}
.btn {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}
.btn-secondary {
  background: #e2e8f0;
  color: #334155;
}
.btn-danger { background: #fee2e2; color: #b91c1c; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  margin: 0 0 16px;
  font-size: 14px;
}
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

.success-card, .admin-card {
  padding: 28px;
  text-align: center;
}
.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ecfdf5;
  color: var(--success);
  font-size: 28px;
}

.site-footer {
  padding: 24px 0 40px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* Admin */
body.admin-page .main-content { width: min(1100px, calc(100% - 32px)); }
.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.admin-card { text-align: left; padding: 20px; margin-bottom: 16px; }
.submission-list { width: 100%; border-collapse: collapse; font-size: 14px; }
.submission-list th, .submission-list td {
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 8px;
  text-align: left;
  vertical-align: top;
}
.submission-list th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #eff6ff;
  color: #1d4ed8;
}
.detail-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
}
.detail-nav {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
}
.detail-nav a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: #334155;
  text-decoration: none;
  font-size: 13px;
}
.detail-nav a:hover { background: #e2e8f0; }
.kv { margin: 0 0 12px; }
.kv dt { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.kv dd { margin: 0; font-size: 14px; white-space: pre-wrap; }
.file-list { list-style: none; padding: 0; margin: 0; }
.file-list li {
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
}
.login-wrap {
  max-width: 420px;
  margin: 40px auto;
  padding: 28px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

@media (max-width: 760px) {
  .grid-2, .grid-3, .upload-grid, .detail-grid { grid-template-columns: 1fr; }
  .stepper { grid-template-columns: repeat(3, 1fr); }
  .form-actions { flex-direction: column-reverse; }
  .btn { width: 100%; }
}
