* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 24px;
  background: radial-gradient(circle at top left, #eef4ff, #f5f5f5);
  color: #202124;
  font-family: 'Ubuntu', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

h1 {
  text-align: center;
  margin-bottom: 24px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #003366;
}

.card {
  background: #ffffff;
  border-radius: 14px;
  padding: 18px 20px 20px;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.card h2 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
}

.logo-card {
  border: 1px solid rgba(37, 99, 235, 0.35);
  background: linear-gradient(135deg, #f1f5ff, #ffffff);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.15);
}

.logo-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.logo-preview-wrapper {
  min-width: 220px;
  padding: 10px;
  border-radius: 10px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
}

#logoPreview {
  max-width: 200px;
  max-height: 80px;
  object-fit: contain;
  display: block;
  margin-top: 6px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.align-bottom {
  align-self: flex-end;
}

label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}



.field input,
.field select{
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border-radius: 22px;
  border: 1px solid #cbd5e1;
  background-color: #f8fafc;
  font-size: 14px;
  color: #0f172a;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;          /* 🔑 quita estilo nativo */
  -webkit-appearance: none;
  -moz-appearance: none;
}

.field input:focus,
.field select:focus{
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
  background-color: #ffffff;
}


.field input::placeholder{
  color: #64748b;
}

.field{
  position: relative;
}

.field select{
  padding-right: 40px; /* espacio para la flecha */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748b'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.06 1.06l-4.24 4.24a.75.75 0 01-1.06 0L5.21 8.29a.75.75 0 01.02-1.08z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
}


hr {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 16px 0;
}

.small-note {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
}

.warning {
  font-size: 11px;
  color: #b91c1c;
  margin-top: 6px;
}

.btn {
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease-in-out;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.1);
}

.btn.primary {
  background: linear-gradient(135deg, #0f4c81, #2563eb);
  color: #ffffff;
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.3);
}

.btn.ghost {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  box-shadow: none;
}

.btn.ghost:hover {
  background: #f1f5f9;
}

.btn.ghost.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.card-generate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.card-generate .actions {
  flex-shrink: 0;
}

.discount-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

@media (max-width: 900px) {
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .card-generate {
    flex-direction: column;
    align-items: flex-start;
  }
}


.standalone-ac {
  margin-top: 12px;
}

.standalone-ac h3 {
  margin-top: 4px;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

/* --- Sistema de incendios radio style --- */

.fire-toggle {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-top: 5px;
}

.toggle-option {
  display: flex;
  align-items: center;
  cursor: pointer;
  gap: 6px;
  font-size: 14px;
  color: #0f172a;
  user-select: none;
}

.toggle-option input[type="radio"] {
  display: none;
}

.toggle-option .dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid #0f172a;
  display: inline-block;
  box-sizing: border-box;
  transition: 0.2s;
}

.toggle-option input[type="radio"]:checked + .dot {
  background-color: #0f172a;
}


/* --- Botón para seleccionar archivo Excel --- */
.btn-upload {
  display: inline-block;
  background-color: #0f172a;
  color: white;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: 0.2s;
  user-select: none;
}

.btn-upload:hover {
  background-color: #1e293b;
}

.file-name {
  margin-left: 12px;
  font-size: 13px;
  color: #64748b;
  font-style: italic;
}

/* --- Botón secundario: Cargar Excel por defecto --- */

.btn-secondary {
  background-color: #e2e8f0;
  color: #0f172a;
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  margin-top: 10px;
  display: inline-block;
  transition: 0.2s;
}

.btn-secondary:hover {
  background-color: #cbd5e1;
}

.btn-generate {
  background-color: #1d4ed8;
  color: white;
  padding: 12px 26px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  border: none;
  font-weight: 600;
  transition: 0.2s;
}

.btn-generate:hover {
  background-color: #1e40af;
}

/* --- Botones estilo PDF para Excel --- */
.btn-excel {
  background-color: #1d4ed8;   /* igual al btn-generate */
  color: white;
  padding: 12px 26px;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  border: none;
  font-weight: 600;
  transition: 0.2s;
  display: inline-block;
  margin-top: 8px;
}

.btn-excel:hover {
  background-color: #1e40af;   /* igual al hover del PDF */
}

.file-name {
  margin-left: 12px;
  font-size: 13px;
  color: #64748b;
  font-style: italic;
}


/* --- Logo superior --- */

.header-logo {
  text-align: center;
  margin-bottom: 10px;
}

.header-logo img {
  width: 220px;      /* Ajusta el tamaño como quieras */
  height: auto;
  display: inline-block;
}

/* Ocultar la vista previa del logo usada solo para el PDF */
.logo-preview-wrapper {
  display: none !important;
}

/* --- Estilo para campos con error --- */
.input-error {
  border: 1px solid #dc2626 !important;
  box-shadow: 0 0 0 1px rgba(220,38,38,0.5);
  animation: shake 0.2s ease-in-out 0s 3;
}

/* Animación tipo "temblor" suave */
@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  50% { transform: translateX(2px); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}


/* --- Stepper para Cantidad de sistemas MDC --- */

.stepper-input {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Ocultamos el range, pero sigue siendo el valor real */
.stepper-input input[type="range"] {
  display: none;
}

/* Caja principal del stepper */
.stepper-input .custom-input {
  width: 140px;
  height: 36px;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  gap: 8px;
}

/* Botones + y - */
.stepper-input .custom-input button {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  outline: none;
  background: #e2e8f0;
  color: #1d4ed8;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 180ms ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stepper-input .custom-input button:hover {
  background: #cbd5e1;
}

.stepper-input .custom-input button:active {
  background: #94a3b8;
  transform: scale(0.95);
}

/* Ventana donde se ven los números */
.stepper-input .custom-input .numbers {
  width: 40px;
  height: 28px;
  overflow: hidden;
  position: relative;
}

/* Pila vertical de números */
.stepper-input .custom-input .numbers div {
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  transition: transform 220ms ease-in-out;
}

/* Cada número */
.stepper-input .custom-input .numbers div span {
  display: block;
  width: 40px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  font-size: 16px;
  color: #0f172a;
  transform: scale(0.7);
  transition: color 220ms ease-in-out, transform 220ms ease-in-out;
  align-items: center;       /* Centrado vertical perfecto */
  justify-content: center;   /* Centrado horizontal */
}

/* Número activo */
.stepper-input .custom-input .numbers div span.active {
  
  transform: scale(1);
}

.custom-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.custom-modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  padding: 20px 26px;
  border-radius: 12px;
  width: 360px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  text-align: center;
  font-size: 14px;
}

.choice-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 columnas iguales */
  gap: 20px;
  margin-top: 12px;
}

.choice-body{
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
}

.choice-body img{
  width: 280px;         
  height: 240px;          
  object-fit: contain;   /* no se deforma */
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  flex-shrink: 0;        /* evita que se achique */
}


.field label{
  font-size: 13px;        /* más compacto */
  font-weight: 600;
  color: #334155;
  margin-bottom: 4px;
  display: block;
}

.field input{
  height: 40px;
  font-size: 14px;
}

.grid-2{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 14px;
}

@media (max-width: 768px){
  .grid-2{
    grid-template-columns: 1fr;
  }
}

.legend{
  display:flex;
  flex-wrap:wrap;
  gap:10px 14px;
  margin:10px 0 14px;
  color:#334155;
  font-size:13px;
}

.legend-item{
  display:flex;
  align-items:center;
  gap:8px;
  background:#f8fafc;
  border:1px solid #e2e8f0;
  padding:8px 10px;
  border-radius:12px;
}

.pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:26px;
  height:22px;
  border-radius:999px;
  font-weight:700;
  font-size:12px;
  background:#0f4c81;
  color:white;
}

.pill2{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:35px;
  height:22px;
  border-radius:999px;
  font-weight:700;
  font-size:12px;
  background:#0f4c81;
  color:white;
}

.pill-kw{
  width:auto;
  padding:0 10px;
  background:#334155;
}

.muted{
  color:#64748b;
  font-size:12px;
  margin-left:6px;
}

.info-card{
  margin-top:10px;
  background:#ffffff;
  border:1px solid #e2e8f0;
  border-radius:16px;
  padding:12px 14px;
  box-shadow: 0 6px 18px rgba(15,23,42,0.06);
  color:#0f172a;
}

.info-card .title{
  font-weight:800;
  margin-bottom:6px;
}

.info-card .row{
  display:flex;
  flex-wrap:wrap;
  gap:10px 16px;
  font-size:14px;
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  background:#f1f5f9;
  border:1px solid #e2e8f0;
  font-weight:600;
}
.badge strong{ font-weight:800; }

.badge-warn{
  background:#fff7ed;
  border-color:#fed7aa;
}

/* ===== Nomenclatura aire acondicionado ===== */
.nomenclatura-wrapper {
  margin-top: 16px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px dashed #cbd5e1;
  display: flex;
  justify-content: center; 
}


.nomenclatura-img {
  max-width: 280px;     /* 🔧 ajusta aquí el tamaño */
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

/* 🔒 Ocultar campo Consecutivo */
#field-quoteNumber {
  display: none !important;
}

/* ===== Header principal ===== */
.main-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 24px 0 32px;
}

.main-logo {
  max-width: 140px;
  opacity: 0.95;
}


.main-header h1 {
  margin: 0;
  text-align: center;
}












