:root {
  --orange: #f58220;
  --orange-dark: #d96708;
  --orange-soft: #fff3e8;
  --charcoal: #34383c;
  --gray: #6f757b;
  --gray-light: #eef0f2;
  --border: #dfe2e5;
  --white: #ffffff;
  --success: #257a47;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(28, 32, 36, 0.11);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--charcoal);
  background: linear-gradient(145deg, #f7f8f9 0%, #fff7ef 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--orange-dark); }

.page-shell { min-height: 100vh; padding: 28px 18px 54px; }
.container { width: min(980px, 100%); margin: 0 auto; }
.brand-card {
  padding: 26px 30px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 22px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
  text-align: center;
}
.brand-logo { width: min(820px, 100%); height: auto; display: block; margin: 0 auto; }
.hero-copy { max-width: 760px; margin: 22px auto 0; }
.hero-copy h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.7rem); letter-spacing: -0.035em; }
.hero-copy p { margin: 12px 0 0; color: var(--gray); font-size: 1.03rem; }
.accent-line { width: 86px; height: 5px; border-radius: 999px; margin: 18px auto 0; background: var(--orange); }

.card {
  margin-top: 24px;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--white);
  box-shadow: 0 12px 34px rgba(28, 32, 36, 0.08);
}
.form-section + .form-section { margin-top: 32px; padding-top: 30px; border-top: 1px solid var(--gray-light); }
.section-title { margin: 0 0 18px; font-size: 1.2rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field label, .field-label { display: block; margin-bottom: 7px; font-weight: 700; }
.required { color: var(--orange-dark); }
.input, .textarea {
  width: 100%; border: 1px solid #cfd4d8; border-radius: 12px; padding: 13px 14px;
  color: var(--charcoal); background: #fff; outline: none; transition: .2s ease;
}
.input:focus, .textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(245,130,32,.13); }
.textarea { min-height: 130px; resize: vertical; }
.char-count { margin-top: 6px; color: var(--gray); text-align: right; font-size: .85rem; }

.question { margin-top: 24px; }
.question:first-child { margin-top: 0; }
.question legend { padding: 0; margin-bottom: 12px; font-weight: 750; }
.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.option { position: relative; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option span {
  display: flex; align-items: center; min-height: 52px; padding: 12px 14px;
  border: 1px solid #d8dcdf; border-radius: 12px; background: #fafafa; transition: .18s ease;
}
.option span::before {
  content: ""; width: 17px; height: 17px; margin-right: 10px; border: 2px solid #a7adb2;
  border-radius: 50%; background: white; flex: 0 0 auto;
}
.option input:checked + span { border-color: var(--orange); background: var(--orange-soft); color: #7d3900; font-weight: 700; }
.option input:checked + span::before { border: 5px solid var(--orange); }
.option input:focus-visible + span { outline: 3px solid rgba(245,130,32,.3); outline-offset: 2px; }

.consent { display: flex; gap: 11px; align-items: flex-start; padding: 14px; border-radius: 12px; background: #f7f8f9; }
.consent input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--orange); }
.actions { margin-top: 26px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.button {
  border: 0; border-radius: 12px; padding: 13px 20px; font-weight: 750; transition: .18s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}
.button-primary { color: white; background: linear-gradient(135deg, var(--orange), var(--orange-dark)); box-shadow: 0 9px 20px rgba(217,103,8,.23); }
.button-primary:hover { transform: translateY(-1px); }
.button-secondary { color: var(--charcoal); background: var(--gray-light); }
.button:disabled { cursor: not-allowed; opacity: .62; transform: none; }
.status { min-height: 24px; margin-top: 14px; font-weight: 650; }
.status.error { color: var(--danger); }
.status.success { color: var(--success); }
.footer { margin-top: 20px; text-align: center; color: var(--gray); font-size: .88rem; }

.success-panel { display: none; text-align: center; padding: 44px 26px; }
.success-panel.visible { display: block; }
.success-icon { width: 68px; height: 68px; margin: 0 auto 20px; display: grid; place-items: center; border-radius: 50%; background: #e8f6ed; color: var(--success); font-size: 34px; font-weight: 900; }

/* Admin */
.admin-shell { min-height: 100vh; background: #f5f6f7; }
.admin-header { background: white; border-bottom: 1px solid var(--border); }
.admin-header-inner { width: min(1220px, 100%); margin: auto; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.admin-logo { width: min(420px, 58vw); height: auto; }
.admin-main { width: min(1220px, 100%); margin: auto; padding: 26px 20px 50px; }
.login-wrap { width: min(470px, 100%); margin: 70px auto; }
.login-card { padding: 32px; border-radius: 18px; background: white; box-shadow: var(--shadow); }
.login-card h1 { margin-top: 0; }
.stack { display: grid; gap: 16px; }
.hidden { display: none !important; }
.dashboard-top { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; }
.dashboard-top h1 { margin: 0; }
.muted { color: var(--gray); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 24px 0; }
.kpi { padding: 20px; border: 1px solid var(--border); border-radius: 16px; background: white; }
.kpi-label { color: var(--gray); font-size: .9rem; }
.kpi-value { margin-top: 7px; font-size: 1.9rem; font-weight: 850; }
.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .input { max-width: 340px; }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 16px; background: white; }
table { width: 100%; border-collapse: collapse; min-width: 1040px; }
th, td { padding: 12px 13px; border-bottom: 1px solid #eceeef; text-align: left; vertical-align: top; }
th { position: sticky; top: 0; background: #f8f9fa; color: #4e5358; font-size: .82rem; text-transform: uppercase; letter-spacing: .035em; }
td { font-size: .91rem; }
.score-pill { display: inline-flex; min-width: 58px; justify-content: center; padding: 4px 8px; border-radius: 999px; background: var(--orange-soft); color: #863d00; font-weight: 800; }
.empty { padding: 40px; text-align: center; color: var(--gray); }

@media (max-width: 820px) {
  .field-grid, .options { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .brand-card { padding: 20px 18px; }
}
@media (max-width: 520px) {
  .page-shell { padding-inline: 10px; }
  .card { padding: 20px 16px; border-radius: 16px; }
  .kpis { grid-template-columns: 1fr; }
  .admin-header-inner { padding-inline: 14px; }
  .admin-main { padding-inline: 14px; }
}
