@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --navy: #1e3a5f;
  --teal: #0d9488;
  --teal-light: #ccfbf1;
  --bg: #f8fafc;
  --white: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Layout ── */
.page-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.container { max-width: 680px; width: 100%; }
.container-wide { max-width: 960px; width: 100%; margin: 0 auto; padding: 0 24px; }

/* ── Header ── */
.site-header {
  background: var(--navy);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.site-header .logo {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.3px;
}
.site-header .logo span { color: #7dd3c0; }

/* ── Card ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card-header {
  background: var(--navy);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px 32px;
  margin: -32px -32px 28px;
}
.card-header h1 { color: #fff; margin: 0; font-size: 22px; }
.card-header p { color: #94a3b8; margin: 4px 0 0; font-size: 13px; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
label .req { color: var(--error); margin-left: 2px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
select, textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13,148,136,.12);
}
select { cursor: pointer; }
textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 24px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: opacity .15s, transform .1s, box-shadow .15s;
  line-height: 1;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: #0b7a70; box-shadow: 0 4px 12px rgba(13,148,136,.3); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { border-color: var(--teal); color: var(--teal); }
.btn-ghost { background: transparent; color: var(--muted); padding: 8px 16px; }
.btn-ghost:hover { color: var(--text); background: var(--bg); }
.btn-full { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ── Alert ── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}
.alert.show { display: block; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Radio options (for survey) ── */
.option-group { display: flex; flex-direction: column; gap: 10px; }
.option-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  position: relative;
}
.option-item:hover { border-color: var(--teal); background: #f0fdfa; }
.option-item.selected { border-color: var(--teal); background: #f0fdfa; }
.option-item input[type="radio"], .option-item input[type="checkbox"] {
  width: 18px; height: 18px; margin: 0; flex-shrink: 0;
  accent-color: var(--teal);
}
.option-content { flex: 1; }
.option-badge {
  display: inline-block;
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  width: 22px; height: 22px;
  border-radius: 50%;
  text-align: center;
  line-height: 22px;
  flex-shrink: 0;
}
.option-label { font-weight: 600; font-size: 13px; color: var(--teal); }
.option-text { font-size: 13px; color: var(--text); margin-top: 2px; line-height: 1.5; }

/* ── Progress bar ── */
.progress-wrap { background: var(--border); border-radius: 99px; height: 6px; margin: 12px 0; }
.progress-bar { background: var(--teal); border-radius: 99px; height: 6px; transition: width .3s ease; }
.progress-label { font-size: 12px; color: var(--muted); text-align: right; margin-top: 4px; }

/* ── Badge ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-active { background: #dbeafe; color: #1e40af; }
.badge-in-progress { background: #fef3c7; color: #92400e; }
.badge-partial { background: #fed7aa; color: #9a3412; }
.badge-complete { background: #d1fae5; color: #065f46; }
.badge-benchmark { background: #ede9fe; color: #5b21b6; }
.badge-invited { background: #f1f5f9; color: var(--muted); }
.badge-started { background: #fef3c7; color: #92400e; }
.badge-completed { background: #d1fae5; color: #065f46; }

/* ── Table ── */
.table-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
th { background: #f1f5f9; padding: 10px 14px; text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
td { padding: 12px 14px; font-size: 13px; border-top: 1px solid var(--border); }
tr:hover td { background: #fafafa; }

/* ── Funnel stats ── */
.funnel-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-value { font-size: 32px; font-weight: 800; color: var(--navy); line-height: 1; }
.stat-label { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ── Code input (confirmation) ── */
.code-input-wrap { display: flex; gap: 8px; justify-content: center; margin: 24px 0; }
.code-digit {
  width: 52px; height: 64px;
  font-size: 28px; font-weight: 700;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color .15s;
  color: var(--navy);
}
.code-digit:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,148,136,.12); }

/* ── Survey specific ── */
.survey-header {
  background: var(--navy);
  padding: 16px 24px;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}
.survey-meta { font-size: 12px; color: #94a3b8; }
.question-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin: 24px auto;
  max-width: 760px;
}
.question-id { font-size: 11px; color: var(--teal); font-weight: 700; letter-spacing: .5px; margin-bottom: 4px; }
.question-block { font-size: 11px; color: var(--muted); margin-bottom: 12px; }
.question-text { font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 20px; line-height: 1.5; }
.help-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--teal); cursor: pointer;
  background: none; border: none; padding: 0; margin-bottom: 16px;
  font-family: inherit;
}
.help-btn:hover { text-decoration: underline; }

/* ── Help modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal {
  background: var(--white); border-radius: var(--radius);
  padding: 28px; max-width: 520px; width: 100%; box-shadow: var(--shadow-md);
}
.modal h3 { margin: 0 0 12px; color: var(--navy); font-size: 16px; }
.modal p { font-size: 14px; color: var(--text); line-height: 1.6; margin: 0; }
.modal-close { margin-top: 20px; }

/* ── Comment field (collapsible) ── */
.comment-toggle {
  font-size: 12px; color: var(--muted); cursor: pointer;
  background: none; border: none; padding: 0; font-family: inherit;
  margin-top: 12px; display: inline-block;
}
.comment-toggle:hover { color: var(--teal); }
.comment-field { margin-top: 10px; }
.comment-field textarea { min-height: 60px; font-size: 13px; }

/* ── Nav between questions ── */
.question-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border);
}

/* ── Landing ── */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, #0f2441 100%);
  padding: 80px 24px;
  text-align: center;
  color: #fff;
}
.hero h1 { font-size: clamp(28px, 5vw, 48px); font-weight: 800; margin: 0 0 16px; }
.hero p { font-size: 18px; color: #94a3b8; max-width: 560px; margin: 0 auto 32px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; padding: 60px 24px; max-width: 960px; margin: 0 auto; }
.feature-card { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.feature-icon { font-size: 28px; margin-bottom: 12px; }
.feature-title { font-size: 15px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.feature-desc { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* ── Spinner ── */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Vendor checkboxes ── */
.vendor-section { margin-bottom: 16px; }
.vendor-section-title { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.vendor-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.vendor-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 20px;
  border: 1.5px solid var(--border);
  cursor: pointer; font-size: 12px; font-weight: 500;
  transition: border-color .15s, background .15s;
  user-select: none;
}
.vendor-chip input { display: none; }
.vendor-chip.checked { border-color: var(--teal); background: #f0fdfa; color: var(--teal); }

/* ── Responsive ── */
@media (max-width: 640px) {
  .card { padding: 20px; }
  .card-header { padding: 18px 20px; margin: -20px -20px 20px; }
  .form-row { grid-template-columns: 1fr; }
  .code-digit { width: 42px; height: 56px; font-size: 24px; }
}
