/* Paleta e identidad alineadas a grupoalegria.com.mx */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --navy: #0e0f11;
  --navy-light: #1c1e21;
  --navy-lighter: #2c2f33;
  --accent: #d90429;
  --accent-dark: #b80322;
  --accent-soft: #fbe3e6;
  --ink: #1f2421;
  --muted: #6c757d;
  --border: #e9ecef;
  --bg: #f8f9fa;
  --card: #ffffff;
  --success: #28a745;
  --danger: #dc3545;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(14, 15, 17, 0.08);
  --shadow-lg: 0 20px 45px rgba(14, 15, 17, 0.18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy) 220px, var(--bg) 220px);
  color: var(--ink);
  min-height: 100vh;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  padding: 6px 4px 26px;
}

.brand__logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--navy);
  font-size: 18px;
  flex-shrink: 0;
}

.brand__text h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
}

.brand__text p {
  margin: 2px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

.brand__logo-img { max-height: 42px; max-width: 160px; object-fit: contain; }

/* Progress */
.progress {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 24px;
}

.progress__bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}

.progress__fill {
  height: 100%;
  width: 12.5%;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  border-radius: 999px;
  transition: width .4s ease;
}

.progress__steps {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

.progress__steps span {
  flex: 1;
  text-align: center;
  min-width: 60px;
}

.progress__steps span.active {
  color: var(--accent-dark);
  font-weight: 700;
}

.progress__steps span.done {
  color: var(--navy);
  font-weight: 600;
}

/* Card / step panel */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 28px;
}

.step { display: none; animation: fadeSlide .35s ease; }
.step.active { display: block; }

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

.step__eyebrow {
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin: 0 0 6px;
}

.step h2 {
  margin: 0 0 6px;
  font-size: 24px;
}

.step__hint {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 14.5px;
}

fieldset { border: none; padding: 0; margin: 0 0 24px; }
legend { font-weight: 700; font-size: 14.5px; margin-bottom: 12px; padding: 0; }

/* Option grid (radio / checkbox cards) */
.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.option-grid.wide { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.option-card {
  position: relative;
  cursor: pointer;
}

.option-card input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.option-card__body {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 16px 14px;
  height: 100%;
  transition: border-color .15s, background .15s, transform .1s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.option-card__icon { font-size: 22px; }
.option-card__title { font-weight: 700; font-size: 14.5px; }
.option-card__desc { font-size: 12.5px; color: var(--muted); line-height: 1.4; }

.option-card input:checked + .option-card__body {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.option-card:hover .option-card__body { border-color: var(--navy-lighter); transform: translateY(-1px); }

/* Galería de servicios (imágenes reales, paso 1) */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.service-card { position: relative; cursor: pointer; }
.service-card input { position: absolute; opacity: 0; width: 0; height: 0; }

.service-card__body {
  position: relative;
  border: 2px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: border-color .15s, transform .12s, box-shadow .15s;
}

.service-card:hover .service-card__body { transform: translateY(-3px); box-shadow: var(--shadow); }

.service-card__img { display: block; width: 100%; aspect-ratio: 4 / 3; background: var(--bg); overflow: hidden; }
.service-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.service-card__img.diagram { background: #fff; }
.service-card__img.diagram img { object-fit: contain; padding: 6px; }

.service-card__check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: transparent;
  transition: all .15s;
}

.service-card__title { font-weight: 700; font-size: 14px; padding: 12px 14px 2px; }
.service-card__desc { font-size: 12px; color: var(--muted); padding: 4px 14px 14px; line-height: 1.45; }

.service-card input:checked + .service-card__body {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.service-card input:checked + .service-card__body .service-card__check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Chips (multi-select) */
.chip-grid { display: flex; flex-wrap: wrap; gap: 10px; }

.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }

.chip__body {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 2px solid var(--border);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  transition: all .15s;
}

.chip input:checked + .chip__body {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* Form fields */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.field .optional { color: var(--muted); font-weight: 400; }

.field input[type=text],
.field input[type=email],
.field input[type=tel],
.field input[type=number],
.field input[type=date],
.field select,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}

.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field textarea { resize: vertical; min-height: 80px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 560px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.area-badge {
  display: inline-block;
  margin-top: 4px;
  background: var(--navy-light);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.error-text { color: var(--danger); font-size: 12.5px; margin-top: 4px; display: none; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.field.has-error .error-text { display: block; }

/* Nav buttons */
.step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 13px 26px;
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  transition: transform .1s, box-shadow .15s;
}

.btn:active { transform: scale(.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: #fff;
  box-shadow: 0 8px 18px rgba(224, 133, 15, .35);
}

.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--border);
}

.btn-ghost:disabled { opacity: .4; cursor: not-allowed; }

/* Summary (step 8) */
.summary { background: var(--bg); border-radius: 12px; padding: 18px; margin-top: 4px; }
.summary h3 { margin: 0 0 10px; font-size: 14px; }
.summary dl { display: grid; grid-template-columns: 160px 1fr; gap: 6px 10px; margin: 0; font-size: 13px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; }

/* Success screen */
.success { text-align: center; padding: 20px 10px; }
.success__icon {
  width: 74px; height: 74px; border-radius: 50%;
  background: var(--success); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; margin: 0 auto 18px;
}
.success h2 { margin: 0 0 8px; }
.success .folio {
  display: inline-block; margin: 14px 0; font-size: 20px; font-weight: 800;
  letter-spacing: .04em; color: var(--navy); background: var(--accent-soft);
  padding: 10px 20px; border-radius: 10px;
}

@media print {
  body { background: #fff; }
  .step-nav, .progress { display: none; }
}

/* ---------- Admin panel ---------- */
.admin-body { background: var(--bg); }
.admin-topbar {
  background: var(--navy);
  color: #fff;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-topbar__brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.admin-topbar a { color: #fff; text-decoration: none; font-size: 13.5px; opacity: .85; }
.admin-topbar a:hover { opacity: 1; }
.admin-wrap { max-width: 1180px; margin: 0 auto; padding: 26px 24px 60px; }

.admin-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; }
.admin-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; align-items: center; }
.admin-toolbar input, .admin-toolbar select {
  padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 13.5px; font-family: inherit;
}
.admin-toolbar .spacer { flex: 1; }

table.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.admin-table th, table.admin-table td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.admin-table th { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
table.admin-table tr:hover td { background: var(--bg); }

.status-pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.status-nuevo { background: #e0f2fe; color: #0369a1; }
.status-revisado { background: #fef3c7; color: #92400e; }
.status-contactado { background: #dcfce7; color: #166534; }
.status-cerrado { background: #e5e7eb; color: #374151; }

.pagination { display: flex; gap: 6px; margin-top: 18px; }
.pagination a, .pagination span {
  padding: 7px 12px; border-radius: 8px; border: 1.5px solid var(--border); font-size: 13px; text-decoration: none; color: var(--ink);
}
.pagination .current { background: var(--navy); color: #fff; border-color: var(--navy); }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; margin-top: 10px; }
.detail-grid h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin: 0 0 10px; }
.detail-grid dl { margin: 0; font-size: 13.5px; }
.detail-grid dt { color: var(--muted); margin-top: 8px; }
.detail-grid dd { margin: 2px 0 0; font-weight: 600; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag-list span { background: var(--accent-soft); color: var(--accent-dark); padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.back-link { display:inline-block; margin-bottom: 16px; color: var(--navy); font-weight: 600; font-size: 13.5px; text-decoration:none; }

.alert-success { background: #e6f6ea; color: #1e7e34; padding: 10px 14px; border-radius: 8px; font-size: 13.5px; margin-bottom: 16px; }
.alert { background: #fdecea; color: var(--danger); padding: 10px 14px; border-radius: 8px; font-size: 13.5px; margin-bottom: 16px; }
.logo-preview { background: var(--bg); border: 1.5px dashed var(--border); border-radius: 10px; padding: 16px; display: inline-block; }
.logo-preview img { max-height: 70px; max-width: 260px; object-fit: contain; display: block; }

/* Footer de contacto (cotizador público) */
.site-footer {
  max-width: 880px; margin: 28px auto 0; text-align: center;
  color: var(--muted); font-size: 12.5px; padding: 0 20px;
}
.site-footer a { color: var(--navy); text-decoration: none; font-weight: 600; }
.site-footer .sep { margin: 0 8px; opacity: .5; }
