:root {
  --bg: #f4f8fb;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --surface-muted: #e8f1f5;
  --text: #102533;
  --text-soft: #5b7280;
  --primary: #0f4c5c;
  --primary-strong: #0a3541;
  --accent: #db8f5b;
  --success: #2a7c62;
  --warning: #c96f37;
  --danger: #aa4d43;
  --border: rgba(16, 37, 51, 0.1);
  --shadow: 0 18px 45px rgba(15, 43, 60, 0.08);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --container: min(1180px, calc(100vw - 32px));
  --font-body: "Aptos", "Segoe UI Variable", "Segoe UI", sans-serif;
  --font-display: "Georgia", "Cambria", serif;
}

[data-theme="dark"] {
  --bg: #0d1c24;
  --surface: rgba(17, 33, 42, 0.9);
  --surface-strong: #142934;
  --surface-muted: #1b3642;
  --text: #edf4f8;
  --text-soft: #b7c7d0;
  --primary: #7dc1d3;
  --primary-strong: #c5ebf5;
  --accent: #f0b27a;
  --border: rgba(232, 243, 248, 0.1);
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(125, 193, 211, 0.14), transparent 32%),
    radial-gradient(circle at bottom right, rgba(219, 143, 91, 0.12), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -44px;
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  z-index: 1000;
}

.skip-link:focus {
  top: 12px;
}

.container {
  width: var(--container);
  margin: 0 auto;
}

.narrow {
  max-width: 760px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(244, 248, 251, 0.72);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .site-header {
  background: rgba(13, 28, 36, 0.76);
}

.header-inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: var(--shadow);
}

.site-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.site-nav a,
.theme-toggle {
  color: var(--text-soft);
}

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.hero,
.page-hero {
  padding: 70px 0 36px;
}

.page-hero.slim {
  padding-bottom: 16px;
}

.hero-grid,
.privacy-grid,
.feature-grid,
.contact-grid,
.stats-grid,
.action-grid {
  display: grid;
  gap: 20px;
}

.hero-grid {
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
}

.hero h1,
.page-hero h1,
.wizard-step h2,
.section-heading h2 {
  font-family: var(--font-display);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}

.hero h1,
.page-hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.7rem);
}

.lead {
  font-size: 1.1rem;
  color: var(--text-soft);
  max-width: 66ch;
}

.eyebrow {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(125, 193, 211, 0.16);
  color: var(--primary);
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 18px;
}

.hero-actions,
.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--primary);
  color: #fff;
}

.button.emergency {
  background: linear-gradient(135deg, #d96548, #b94b3f);
  color: #fff;
  box-shadow: 0 12px 26px rgba(185, 75, 63, 0.28);
}

.button.secondary,
.button.ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.button.danger {
  background: rgba(170, 77, 67, 0.12);
  color: var(--danger);
  border-color: rgba(170, 77, 67, 0.25);
}

.hero-panel,
.wizard-sidebar,
.result-shell,
.feature-card,
.privacy-card,
.stat-card,
.notice-card,
.action-card,
.card-form,
.admin-form,
.faq-item,
.empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-panel,
.wizard-sidebar,
.result-shell,
.admin-form,
.card-form,
.empty-state {
  padding: 24px;
}

.stat-card,
.feature-card,
.privacy-card,
.action-card,
.notice-card {
  padding: 22px;
}

.stat-label,
.inline-note,
.footer-note {
  color: var(--text-soft);
  font-size: 0.95rem;
}

.inline-disclaimer {
  display: grid;
  gap: 8px;
  margin-top: 20px;
  color: var(--text-soft);
}

.section {
  padding: 28px 0 54px;
}

.section.muted {
  background: linear-gradient(180deg, transparent, rgba(125, 193, 211, 0.06));
}

.section-heading {
  margin-bottom: 24px;
}

.feature-grid,
.privacy-grid,
.contact-grid,
.stats-grid,
.action-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.wizard-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
}

.progress-card {
  margin-bottom: 18px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.progress-bar {
  height: 10px;
  background: var(--surface-muted);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 16%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.28s ease;
}

.step-list {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: grid;
  gap: 10px;
}

.step-list li {
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--text-soft);
  border: 1px solid transparent;
}

.step-list li.active {
  color: var(--text);
  background: rgba(125, 193, 211, 0.12);
  border-color: rgba(125, 193, 211, 0.26);
  font-weight: 700;
}

.wizard-main {
  display: grid;
  gap: 18px;
}

.wizard-step {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

.wizard-step.active {
  display: block;
  animation: fadeUp 0.28s ease;
}

.wizard-controls {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.mode-grid,
.storage-grid,
.input-shell {
  display: grid;
  gap: 16px;
}

.mode-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 22px;
}

.mode-card,
.storage-option {
  border: 1px solid var(--border);
  background: var(--surface-strong);
  border-radius: var(--radius-md);
  padding: 18px;
  display: grid;
  gap: 8px;
  text-align: left;
  cursor: pointer;
}

.mode-card.active,
.storage-option.active {
  border-color: rgba(15, 76, 92, 0.35);
  box-shadow: inset 0 0 0 1px rgba(15, 76, 92, 0.18);
  background: linear-gradient(180deg, rgba(125, 193, 211, 0.14), transparent);
}

.storage-option input,
.checkbox-row input {
  margin-right: 10px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 18px;
}

.input-shell {
  grid-template-columns: 1fr 1fr;
}

.input-column,
.preview-column {
  display: grid;
  gap: 12px;
}

.upload-box {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.38);
}

.upload-box input {
  display: block;
  width: 100%;
  margin-bottom: 12px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.questionnaire-grid,
.input-grid {
  display: grid;
  gap: 16px;
}

.question-card {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-strong);
}

.question-card label {
  display: block;
  font-weight: 700;
  margin-bottom: 10px;
}

input[type="text"],
input[type="password"],
textarea,
select {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  padding: 14px 16px;
  min-height: 48px;
}

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: rgba(15, 28, 35, 0.72);
}

textarea {
  resize: vertical;
}

.choice-grid,
.badge-row,
.metric-grid,
.signal-grid,
.attention-grid,
.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.choice-chip,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.badge {
  padding: 8px 12px;
  background: rgba(15, 76, 92, 0.12);
  color: var(--primary);
  font-size: 0.92rem;
  font-weight: 700;
}

.result-header {
  display: grid;
  gap: 18px;
  grid-template-columns: 1.15fr 0.85fr;
  margin-bottom: 20px;
}

.result-score {
  display: grid;
  gap: 12px;
}

.score-ring {
  width: 118px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--primary) var(--score-deg), rgba(15, 76, 92, 0.12) 0);
  margin-bottom: 8px;
}

.score-ring span {
  width: 84px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--surface-strong);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.35rem;
}

.metric-card,
.signal-card {
  flex: 1 1 260px;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-strong);
}

.metric-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  overflow: hidden;
  margin-top: 10px;
}

.metric-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.signal-card[data-attention="alto"] {
  border-color: rgba(170, 77, 67, 0.28);
}

.signal-card[data-attention="medio"] {
  border-color: rgba(201, 111, 55, 0.28);
}

.accordion {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.accordion details {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  padding: 16px 18px;
}

.accordion summary,
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
}

.faq-list {
  display: grid;
  gap: 14px;
}

.faq-item {
  padding: 18px 20px;
}

.timeline {
  display: grid;
  gap: 18px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 18px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.timeline-step {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 700;
}

.site-footer {
  padding: 24px 0 48px;
}

.footer-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  padding: 24px;
  border-radius: var(--radius-lg);
  background: rgba(15, 43, 60, 0.94);
  color: #eef5f8;
}

.footer-grid a {
  display: block;
  color: #d9ecf2;
  margin-bottom: 8px;
}

.dashboard-grid {
  display: grid;
  gap: 16px;
}

.dashboard-item {
  display: grid;
  gap: 12px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.dashboard-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-soft);
}

.hidden {
  display: none !important;
}

.skeleton-block {
  min-height: 180px;
}

.skeleton-block.loading {
  position: relative;
  overflow: hidden;
  background: linear-gradient(110deg, rgba(255,255,255,0.2) 8%, rgba(255,255,255,0.58) 18%, rgba(255,255,255,0.2) 33%);
  background-size: 200% 100%;
  animation: shine 1.2s linear infinite;
}

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: grid;
  gap: 10px;
  z-index: 30;
}

.toast {
  min-width: 260px;
  max-width: 380px;
  padding: 14px 16px;
  border-radius: 18px;
  color: #fff;
  box-shadow: var(--shadow);
  animation: fadeUp 0.2s ease;
}

.toast.info { background: var(--primary); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

.form-error {
  color: var(--danger);
}

.prose {
  max-width: 72ch;
}

.share-card-page {
  text-align: center;
}

.emergency-cta-band {
  padding-top: 0;
}

.emergency-band-card,
.emergency-sidebar {
  display: grid;
  gap: 18px;
}

.emergency-band-card {
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 26px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(185, 75, 63, 0.2);
  background: linear-gradient(135deg, rgba(217, 101, 72, 0.09), rgba(255, 255, 255, 0.82));
  box-shadow: var(--shadow);
}

.emergency-page-hero {
  background: linear-gradient(180deg, rgba(217, 101, 72, 0.07), transparent);
}

.emergency-shell {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 22px;
}

.emergency-notice {
  border-color: rgba(185, 75, 63, 0.18);
}

.emergency-main .wizard-step {
  min-height: 380px;
}

.compact-shell {
  padding: 20px;
}

.emergency-choice-grid {
  gap: 14px;
}

.emergency-chip {
  min-height: 58px;
  padding-inline: 16px;
  font-size: 1.02rem;
}

.emergency-guide {
  font-size: 1.02rem;
}

.compare-shell,
.compare-form {
  display: grid;
  gap: 18px;
}

.compare-shell {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
}

.compare-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.compact-section {
  padding-top: 18px;
}

.popup-card {
  border-color: rgba(15, 76, 92, 0.18);
  background: linear-gradient(180deg, rgba(125, 193, 211, 0.08), rgba(255, 255, 255, 0.88));
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shine {
  to { background-position-x: -200%; }
}

@media (max-width: 960px) {
  .hero-grid,
  .wizard-layout,
  .emergency-shell,
  .compare-shell,
  .input-shell,
  .result-header,
  .emergency-band-card {
    grid-template-columns: 1fr;
  }

  .site-nav {
    display: none;
  }
}

@media (max-width: 640px) {
  .hero,
  .page-hero,
  .section {
    padding-top: 22px;
  }

  .header-inner {
    min-height: 68px;
  }

  .wizard-step,
  .hero-panel,
  .wizard-sidebar,
  .emergency-sidebar,
  .result-shell,
  .admin-form,
  .card-form,
  .empty-state {
    padding: 18px;
  }

  .button,
  .mode-card,
  .storage-option {
    width: 100%;
  }

  .wizard-controls {
    flex-direction: column-reverse;
  }
}
