:root {
  --orange: #E8621A;
  --orange-light: #F5894E;
  --orange-pale: #FDF0E8;
  --orange-dark: #C04E0C;
  --neutral-900: #1A1814;
  --neutral-700: #3D3A35;
  --neutral-500: #7A7570;
  --neutral-300: #C8C4BE;
  --neutral-100: #F5F3F0;
  --neutral-50: #FAFAF8;
  --shadow-sm: 0 2px 8px rgba(26,24,20,0.08);
  --shadow-md: 0 8px 32px rgba(26,24,20,0.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--neutral-100);
  color: var(--neutral-700);
  min-height: 100vh;
}

/* ── HEADER ── */
.gen-header {
  background: var(--neutral-900);
  padding: 20px 40px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}
#sticky-nav {
  position: sticky;
  top: 0;
  z-index: 100;
}
.gen-logo {
  width: 46px; height: 46px;
  background: var(--orange);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 10px; font-weight: 700; color: white;
  letter-spacing: -0.3px; text-align: center; line-height: 1.3;
  flex-shrink: 0;
}
.gen-header-text h1 {
  font-family: 'Playfair Display', serif;
  font-size: 18px; font-weight: 700; color: white;
}
.gen-header-text .sub {
  font-size: 11px; color: var(--neutral-300);
  text-transform: uppercase; letter-spacing: 0.1em; margin-top: 2px;
}
.gen-header .badge {
  margin-left: auto;
  background: rgba(232,98,26,0.18);
  color: var(--orange-light);
  border: 1px solid rgba(232,98,26,0.3);
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 11.5px; font-weight: 600;
  white-space: nowrap;
}

/* ── PROGRESS ── */
.progress-bar {
  background: var(--neutral-900);
  padding: 0 40px 16px;
  display: flex;
  gap: 0;
}
.progress-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  cursor: pointer;
}
.progress-step::before {
  content: '';
  position: absolute;
  top: 13px;
  right: -50%;
  width: 100%;
  height: 2px;
  background: rgba(255,255,255,0.1);
  z-index: 0;
}
.progress-step:last-child::before { display: none; }
.ps-dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: rgba(255,255,255,0.3);
  font-weight: 700; position: relative; z-index: 1;
  transition: all 0.3s;
}
.progress-step.active .ps-dot {
  background: var(--orange);
  border-color: var(--orange);
  color: white;
  box-shadow: 0 0 0 4px rgba(232,98,26,0.25);
}
.progress-step.done .ps-dot {
  background: rgba(232,98,26,0.3);
  border-color: var(--orange-light);
  color: var(--orange-light);
}
.ps-label {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.25);
  transition: color 0.3s;
}
.progress-step.active .ps-label { color: var(--orange-light); }
.progress-step.done .ps-label { color: rgba(255,255,255,0.4); }

/* ── MAIN ── */
.gen-main {
  max-width: 840px;
  margin: 0 auto;
  padding: 32px 20px 100px;
}

/* ── BLOCK ── */
.form-block {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}
.form-block:focus-within { border-color: rgba(232,98,26,0.2); }
.block-header {
  background: var(--neutral-900);
  padding: 18px 26px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.block-icon {
  width: 38px; height: 38px;
  background: var(--orange);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.block-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 16px; font-weight: 700; color: white;
}
.block-header p {
  font-size: 11px; color: var(--neutral-300); margin-top: 2px;
}
.block-body { padding: 24px 26px; }

/* ── FORM ELEMENTS ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--neutral-500);
}
.form-field input,
.form-field select {
  border: 2px solid var(--neutral-100);
  border-radius: 10px;
  padding: 11px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; color: var(--neutral-900);
  outline: none; background: var(--neutral-50);
  transition: border-color 0.2s, background 0.2s;
}
.form-field input:focus,
.form-field select:focus {
  border-color: var(--orange);
  background: white;
}
.field-hint {
  font-size: 10.5px; color: var(--neutral-500);
  font-style: italic; line-height: 1.5; margin-top: 2px;
}

/* ── PRICE FIELD ── */
.price-field {
  display: flex; align-items: center;
  border: 2px solid var(--neutral-100);
  border-radius: 10px;
  overflow: hidden; background: white;
  transition: border-color 0.2s;
}
.price-field:focus-within { border-color: var(--orange); }
.price-field .currency {
  padding: 10px 13px;
  background: var(--neutral-100);
  font-size: 13px; font-weight: 700;
  color: var(--orange-dark);
  border-right: 2px solid var(--neutral-100);
  white-space: nowrap;
}
.price-field input {
  border: none !important; background: transparent !important;
  border-radius: 0 !important; padding: 10px 12px !important;
  flex: 1; font-family: 'Playfair Display', serif !important;
  font-size: 16px !important; font-weight: 700 !important;
  color: var(--neutral-900) !important; outline: none !important;
  min-width: 0;
}
.price-field .unit {
  padding: 10px 12px;
  font-size: 11px; color: var(--neutral-500);
  white-space: nowrap; border-left: 2px solid var(--neutral-100);
}

/* ── SERVICE TOGGLES ── */
.service-toggle {
  border: 2px solid var(--neutral-100);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 10px;
  transition: border-color 0.25s;
}
.service-toggle.active { border-color: var(--orange); }

.toggle-header {
  display: flex; align-items: center; gap: 13px;
  padding: 15px 18px;
  cursor: pointer;
  background: white;
  transition: background 0.2s;
  user-select: none;
}
.toggle-header:hover { background: var(--neutral-50); }
.service-toggle.active .toggle-header { background: var(--orange-pale); }

.toggle-check {
  width: 22px; height: 22px;
  border: 2px solid var(--neutral-300);
  border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: white; font-size: 12px; color: transparent;
  transition: all 0.2s;
}
.service-toggle.active .toggle-check {
  background: var(--orange);
  border-color: var(--orange);
  color: white;
}

.toggle-icon {
  width: 36px; height: 36px;
  background: var(--neutral-100);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  transition: background 0.2s;
}
.service-toggle.active .toggle-icon { background: rgba(232,98,26,0.15); }

.toggle-label { flex: 1; }
.toggle-label strong { font-size: 14px; color: var(--neutral-900); font-weight: 600; display: block; }
.toggle-label span { font-size: 11px; color: var(--neutral-500); margin-top: 2px; display: block; }

.toggle-arrow {
  font-size: 10px; color: var(--neutral-300);
  transition: transform 0.25s;
}
.service-toggle.active .toggle-arrow { transform: rotate(90deg); color: var(--orange); }

.toggle-body {
  display: none;
  padding: 18px 20px 20px 20px;
  background: #FFFBF8;
  border-top: 1px solid rgba(232,98,26,0.12);
}
.service-toggle.active .toggle-body { display: block; }

/* ── MODELOS ── */
.section-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--orange); margin-bottom: 10px; margin-top: 4px;
  display: flex; align-items: center; gap: 8px;
}
.section-label::after {
  content: ''; flex: 1; height: 1px;
  background: rgba(232,98,26,0.2);
}

.modelos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 7px; margin-bottom: 6px;
}
.modelo-chip {
  border: 2px solid rgba(232,98,26,0.2);
  border-radius: 10px;
  padding: 9px 12px;
  display: flex; align-items: center; gap: 9px;
  cursor: pointer; background: white;
  transition: all 0.15s;
}
.modelo-chip:hover { border-color: var(--orange-light); background: var(--orange-pale); }
.modelo-chip.sel { border-color: var(--orange); background: var(--orange-pale); }
.mc-check {
  width: 16px; height: 16px;
  border: 2px solid var(--neutral-300);
  border-radius: 4px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: transparent;
  transition: all 0.15s; background: white;
}
.modelo-chip.sel .mc-check {
  background: var(--orange); border-color: var(--orange); color: white;
}
.mc-num { font-weight: 700; color: var(--neutral-900); font-size: 12px; display: block; }
.mc-desc { font-size: 10px; color: var(--neutral-500); margin-top: 1px; line-height: 1.3; display: block; }
.modelos-hint { font-size: 10.5px; color: var(--neutral-500); font-style: italic; margin-bottom: 10px; }

/* ── SUB-INCLUDES ── */
.sep { height: 1px; background: rgba(232,98,26,0.12); margin: 16px 0; }

.sub-include {
  border: 2px solid rgba(232,98,26,0.2);
  border-radius: 12px; padding: 12px 14px;
  margin-bottom: 9px; background: white;
  cursor: pointer; transition: border-color 0.2s;
  user-select: none;
}
.sub-include.active { border-color: var(--orange); background: var(--orange-pale); }
.sub-include-row { display: flex; align-items: center; gap: 9px; }
.sub-check {
  width: 17px; height: 17px;
  border: 2px solid var(--neutral-300);
  border-radius: 4px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: transparent;
  transition: all 0.15s; background: white;
}
.sub-include.active .sub-check {
  background: var(--orange); border-color: var(--orange); color: white;
}
.sub-include-label { font-size: 13px; font-weight: 600; color: var(--neutral-900); }
.sub-price-row {
  display: none;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid rgba(232,98,26,0.15);
}
.sub-include.active .sub-price-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* ── RESUMEN LATERAL / BOTTOM ── */
.sticky-summary {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--neutral-900);
  padding: 16px 28px;
  display: flex; align-items: center; gap: 18px;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.3);
  z-index: 200;
  flex-wrap: wrap;
}
.summary-chips { display: flex; gap: 7px; flex-wrap: wrap; flex: 1; }
.summary-chip {
  background: rgba(232,98,26,0.15);
  color: var(--orange-light);
  border: 1px solid rgba(232,98,26,0.25);
  padding: 4px 11px;
  border-radius: 50px;
  font-size: 11.5px; font-weight: 600;
}
.summary-chip.empty {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.1);
}
.gen-btn {
  background: var(--orange);
  color: white; border: none;
  border-radius: 12px;
  padding: 14px 30px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14.5px; font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  display: flex; align-items: center; gap: 9px;
  white-space: nowrap;
  flex-shrink: 0;
}
.gen-btn:hover { background: var(--orange-dark); transform: translateY(-2px); }
.gen-btn:active { transform: translateY(0); }
.nav-btn { background: transparent; border: 1px solid rgba(255,255,255,.22); color: rgba(255,255,255,.88); border-radius: 9px; padding: 8px 16px; font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 500; cursor: pointer; transition: all .2s; white-space: nowrap; flex-shrink: 0; }
.nav-btn:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.4); }

/* ── TOAST ── */
.toast {
  position: fixed; top: 80px; right: 24px;
  background: var(--neutral-900);
  color: white; padding: 13px 20px;
  border-radius: 12px; font-size: 13.5px;
  box-shadow: var(--shadow-md);
  border-left: 4px solid var(--orange);
  opacity: 0; transform: translateX(20px);
  transition: all 0.3s; z-index: 9999;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(0); }

@media (max-width: 620px) {
  .gen-header { padding: 14px 16px; }
  .gen-main { padding: 20px 12px 100px; }
  .form-grid { grid-template-columns: 1fr; }
  .block-body { padding: 18px 16px; }
  .modelos-grid { grid-template-columns: 1fr 1fr; }
  .sticky-summary { flex-direction: column; align-items: stretch; }
  .gen-btn { justify-content: center; }
}

/* ── LISTA DE PRESUPUESTOS GUARDADOS ── */
.presupuesto-list { display: flex; flex-direction: column; gap: 10px; }
.empty-list { color: var(--neutral-500); font-size: 13px; line-height: 1.4; padding: 12px 10px; border-radius: 12px; background: #fff5ee; border: 1px dashed var(--orange-light); }
.budget-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 12px 12px; border: 1px solid #f2e7de; border-radius: 12px; background: #fff; }
.budget-info { font-size: 13px; }
.budget-title { font-weight: 700; color: var(--neutral-900); }
.budget-meta { color: var(--neutral-500); font-size: 12px; margin-top: 2px; }
.budget-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.budget-actions button { border: 1px solid var(--neutral-300); background: white; color: var(--neutral-700); padding: 6px 10px; border-radius: 8px; cursor: pointer; font-size: 12px; }
.budget-actions button:hover { background: var(--neutral-100); border-color: var(--orange); color: var(--orange-dark); }
