/* Colores en un solo lugar. Modo claro por defecto; modo oscuro automático según el teléfono. */
:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --surface-2: #efe9df;
  --text: #1b1d22;
  --muted: #5f636d;
  --line: #e1d9cc;
  --accent: #c9821f;
  --accent-ink: #1b1d22;
  --accent-soft: #fbecd3;
  --ok: #2f8a57;
  --ok-soft: #dcf1e4;
  --warn-soft: #fff4d6;
  --danger: #b4432f;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 6px 20px rgba(0, 0, 0, 0.05);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0f1115;
    --surface: #181b21;
    --surface-2: #20242c;
    --text: #f2efe9;
    --muted: #a3a7b0;
    --line: #2b3038;
    --accent: #e8a33d;
    --accent-ink: #14161b;
    --accent-soft: #3a2c16;
    --ok: #5cc28a;
    --ok-soft: #173326;
    --warn-soft: #33290f;
    --danger: #ef7d68;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #0f1115;
  --surface: #181b21;
  --surface-2: #20242c;
  --text: #f2efe9;
  --muted: #a3a7b0;
  --line: #2b3038;
  --accent: #e8a33d;
  --accent-ink: #14161b;
  --accent-soft: #3a2c16;
  --ok: #5cc28a;
  --ok-soft: #173326;
  --warn-soft: #33290f;
  --danger: #ef7d68;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: 'Archivo', 'Inter', system-ui, sans-serif;
  line-height: 1.2;
  margin: 0;
}

a {
  color: var(--accent);
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 16px env(safe-area-inset-bottom);
}

/* Barra superior */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Archivo', sans-serif;
  font-weight: 800;
  font-size: 17px;
}

.brand img {
  border-radius: 8px;
}

/* Logo de texto de Cappataz: todo en minúscula y "app" en ámbar, más grueso. */
.wordmark {
  font-family: 'Archivo', 'Inter', system-ui, sans-serif;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.wordmark .wm-app {
  color: var(--accent);
  font-weight: 800;
}

.pill {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.draft {
  font-size: 13px;
  background: var(--warn-soft);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 8px;
}

main {
  flex: 1;
}

.screen {
  padding: 16px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.intro h1 {
  font-size: clamp(30px, 8vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 12px;
}

.screen h2 {
  font-size: 22px;
  font-weight: 700;
  margin-top: 6px;
}

.lead {
  font-size: 17px;
  margin: 0;
}

.muted {
  color: var(--muted);
  margin: 0;
}

/* Opciones grandes, fáciles de tocar */
.choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  min-height: 64px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, transform 0.1s;
}

.choice:hover:not(:disabled) {
  border-color: var(--accent);
}

.choice:active:not(:disabled) {
  transform: scale(0.99);
}

.choice:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.choice-icon {
  font-size: 26px;
  line-height: 1;
}

.choice-label {
  flex: 1;
  font-weight: 600;
  display: flex;
  flex-direction: column;
}

.choice-label small,
.choice-badge small {
  font-weight: 400;
  color: var(--muted);
  font-size: 13px;
}

.choice-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-align: right;
  display: flex;
  flex-direction: column;
  max-width: 45%;
}

.zone-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.zone-group.is-soon .choice {
  min-height: 56px;
  padding: 12px 16px;
}

.zone-state {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 8px;
}

.link-btn {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 4px 0;
  color: var(--muted);
  font-size: 15px;
}

.link-btn.danger {
  color: var(--danger);
  margin-top: 8px;
}

/* Contexto: zona, ID, idioma */
.context {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
}

/* Progreso */
.progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.progress-text {
  font-size: 14px;
  color: var(--muted);
}

.progress-text strong {
  color: var(--text);
}

/* Elegir camino: con ayuda o por mi cuenta */
.path-choice {
  margin-top: 4px;
}

.path-q {
  font-family: 'Archivo', 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: 17px;
  margin: 0 0 8px;
}

.path-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.path-btn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  min-height: 64px;
}

.path-btn:hover {
  border-color: var(--accent);
}

.path-btn.on {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.path-icon {
  font-size: 22px;
  line-height: 1.2;
}

.path-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.path-text small {
  color: var(--muted);
  font-size: 13px;
}

.path-intro {
  margin: 14px 0 0;
}

/* Capa 2 (negocio) */
.l2-card {
  margin-top: 16px;
  background: var(--surface);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.l2-card h3 {
  font-size: 18px;
}

.l2-card p {
  margin: 0;
}

.l2-card.is-locked {
  border-style: dashed;
  border-color: var(--line);
}

.state-rule {
  margin-top: 14px;
  border-left: 4px solid var(--accent);
  background: var(--surface-2);
  border-radius: 0 12px 12px 0;
  padding: 10px 14px;
}

.step-body .state-rule h4 {
  margin-top: 0;
}

[hidden] {
  display: none !important;
}

/* Calculadora de precios */
.calc-open {
  margin-top: 14px;
  width: 100%;
  background: var(--accent-soft);
  border: 1.5px solid var(--accent);
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
  min-height: 48px;
}

.calc {
  margin-top: 14px;
  background: var(--surface-2);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.calc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.calc-head .link-btn {
  white-space: nowrap;
}

.step-body .calc-head h4 {
  margin: 0;
}

.calc p {
  margin: 0;
}

.calc-toggle {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 600;
}

.calc-toggle input {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  flex: none;
  accent-color: var(--accent);
}

.calc-toggle small {
  display: block;
  font-weight: 400;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.calc-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
}

.calc-field:has(select),
.calc-field:has(.link-btn) {
  grid-column: 1 / -1;
}

.calc-field small {
  font-weight: 400;
  font-size: 12px;
}

.calc-field input,
.calc-field select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  font-size: 16px;
}

.calc-field input:focus,
.calc-field select:focus {
  outline: none;
  border-color: var(--accent);
}

.calc-results {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calc-big {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  text-align: center;
}

.calc-big > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface);
  border-radius: 10px;
  padding: 8px 4px;
}

.calc-big strong {
  font-size: 17px;
}

.calc-price {
  background: var(--accent) !important;
  color: var(--accent-ink);
}

.calc-warn {
  color: var(--danger);
  font-weight: 600;
}

.calc-detail table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 6px;
}

.calc-detail td {
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}

.calc-detail td:last-child {
  text-align: right;
}

.calc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Zonas de expansión (DC, Virginia) */
.exp-card {
  margin-top: 8px;
  background: var(--surface);
  border: 1.5px dashed var(--accent);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exp-card h3,
.exp-zone h3 {
  font-size: 18px;
}

.exp-card p {
  margin: 0;
}

.exp-card.is-locked {
  border-color: var(--line);
}

.exp-unlock {
  align-self: flex-start;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 600;
  min-height: 44px;
}

.exp-unlock:hover {
  border-color: var(--accent);
}

.exp-choose {
  font-weight: 600;
}

.exp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.exp-chip {
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  min-height: 44px;
}

.exp-chip.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.exp-zone {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.small {
  font-size: 13px;
}

.id-banner {
  background: var(--ok-soft);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 15px;
}

.celebrate {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--ok-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.celebrate span {
  font-size: 28px;
}

.celebrate p {
  margin: 4px 0 0;
}

/* Pasos */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.step.is-open {
  border-color: var(--accent);
}

.step-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: none;
  border: none;
  padding: 14px 16px;
  text-align: left;
}

.step-num {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--text);
}

.is-done .step-num {
  background: var(--ok);
  color: #fff;
}

.step-titles {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.step-title {
  font-weight: 700;
}

.is-done .step-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.step-summary {
  font-size: 14px;
  color: var(--muted);
}

.chevron {
  font-size: 24px;
  color: var(--muted);
  transition: transform 0.2s;
}

.is-open .chevron {
  transform: rotate(90deg);
}

.step-body {
  padding: 0 16px 16px 62px;
}

.step-body h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 14px 0 4px;
}

.step-body p {
  margin: 0;
}

.todo,
.links {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.links a {
  font-weight: 600;
  text-decoration: none;
}

.links a:hover {
  text-decoration: underline;
}

.links {
  gap: 12px;
}

.link-guide {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 10px;
  padding: 8px 10px;
  user-select: text;
}

.callout,
.tip {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 15px;
  margin-top: 12px;
}

.callout {
  background: var(--accent-soft);
}

.tip {
  background: var(--surface-2);
}

.done-btn {
  margin-top: 16px;
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: none;
  font-weight: 700;
  background: var(--accent);
  color: var(--accent-ink);
}

.done-btn.on {
  background: var(--ok-soft);
  color: var(--ok);
}

/* Pie */
.footer {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 16px 0 24px;
  border-top: 1px solid var(--line);
}

.footer p {
  margin: 2px 0;
}

.footer a {
  color: inherit;
}

@media (max-width: 400px) {
  .step-body {
    padding-left: 16px;
  }
}
