:root {
  --gris: #4A4A4A;
  --gris-dark: #3E3E3E;
  --amarillo: #FFBF07;
  --blanco-gris: #EDEFF1;
  --card: #ffffff;
  --text: #202124;
  --muted: #6b7280;
  --border: #d7dadd;
  --danger: #c0392b;
  --warning: #d97706;
  --success: #047857;
  --soft-yellow: #fff6d9;
  --soft-gray: #f7f8f9;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--blanco-gris);
  color: var(--text);
}

.app {
  width: min(1120px, 94vw);
  margin: 0 auto;
  padding: 26px 0 64px;
}

/* HEADER */
.brand-header {
  background: var(--gris);
  color: #fff;
  border-radius: 0 0 22px 22px;
  margin-bottom: 28px;
  box-shadow: 0 20px 45px rgba(25, 25, 25, .16);
  overflow: hidden;
  border-top: 7px solid var(--amarillo);
}

.brand-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 28px 34px 16px;
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  min-height: 78px;
}

.brand-logo {
  max-width: 320px;
  max-height: 92px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.28));
}

.brand-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-avatar {
  width: 82px;
  height: 82px;
  object-fit: cover;
  object-position: center 25%;
  border-radius: 50%;
  border: 4px solid var(--amarillo);
  box-shadow: 0 8px 18px rgba(0,0,0,.34);
  background: #222;
}

.tutorial-main-btn {
  border: 2px solid var(--amarillo);
  background: var(--amarillo);
  color: #262626;
  border-radius: 18px;
  padding: 13px 18px;
  font-weight: 900;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(255,191,7,.25);
  text-align: left;
  max-width: 260px;
}

.tutorial-main-btn span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #3d3d3d;
}

.tutorial-main-btn:hover {
  background: #fff;
  transform: translateY(-1px);
}

.brand-line {
  height: 2px;
  background: var(--amarillo);
  width: calc(100% - 250px);
  margin: 0 34px;
  opacity: .78;
}

.brand-content {
  padding: 18px 34px 22px;
}

.brand-kicker {
  color: var(--amarillo);
  font-weight: 900;
  letter-spacing: .16em;
  font-size: 13px;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.brand-content h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 68px);
  line-height: .95;
  font-weight: 900;
  letter-spacing: -.045em;
  color: #fff;
}

.brand-subtitle {
  margin: 12px 0 6px;
  font-size: 22px;
  font-weight: 800;
  color: var(--blanco-gris);
}

.brand-description {
  margin: 0 0 14px;
  color: rgba(255,255,255,.9);
  font-size: 18px;
  line-height: 1.45;
}

.brand-explanation {
  max-width: 920px;
  margin: 0;
  color: rgba(255,255,255,.86);
  font-size: 16px;
  line-height: 1.58;
  text-align: justify;
}

.brand-footer {
  padding: 14px 34px;
  color: rgba(255,255,255,.78);
  background: rgba(255, 191, 7, .15);
  letter-spacing: .06em;
  font-size: 13px;
}

/* ESTRUCTURA */
.card {
  background: var(--card);
  border: 1px solid #dfe3e7;
  border-radius: 18px;
  padding: 26px 30px;
  box-shadow: 0 14px 34px rgba(74, 74, 74, .10);
}

.block {
  border-bottom: 1px solid var(--border);
  padding: 26px 0;
}

.block:first-child { padding-top: 0; }
.block:last-of-type { border-bottom: none; }

h2 {
  margin: 0 0 16px;
  font-size: 23px;
  color: #111827;
  letter-spacing: -.02em;
}

h2::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 22px;
  border-radius: 8px;
  background: var(--amarillo);
  margin-right: 10px;
  vertical-align: -4px;
}

h3 {
  margin: 0 0 8px;
  color: var(--gris);
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-weight: 800;
  color: #172033;
}

input, select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #cdd2d8;
  border-radius: 12px;
  font-size: 15px;
  background: #fff;
  color: #111827;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}

input:focus, select:focus {
  border-color: var(--amarillo);
  box-shadow: 0 0 0 4px rgba(255, 191, 7, .22);
}

input[readonly] {
  background: #f2f4f6;
  color: var(--gris);
}

.phone-row {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 8px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.explain {
  background: var(--soft-yellow);
  border-left: 5px solid var(--amarillo);
  padding: 14px 16px;
  border-radius: 12px;
  color: #3d3d3d;
  line-height: 1.5;
}

.checkbox {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-weight: 700;
}

.checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--amarillo);
}

.hidden { display: none !important; }

/* FESTIVOS */
.festivos-box {
  margin-top: 18px;
  padding: 18px;
  background: #fff8df;
  border: 1px solid rgba(255,191,7,.55);
  border-radius: 16px;
}

.festivo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-weight: 600;
}

.festivo-item input {
  width: 18px;
  height: 18px;
  accent-color: var(--amarillo);
}

/* TABLAS */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
}

th {
  background: var(--gris);
  color: #fff;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

th, td {
  border-bottom: 1px solid var(--border);
  padding: 11px;
  text-align: left;
}

td input { min-width: 140px; }

/* BOTONES */
.primary, .secondary {
  border: none;
  cursor: pointer;
  border-radius: 14px;
  padding: 14px 20px;
  font-weight: 900;
  font-size: 15px;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.primary {
  width: 100%;
  background: var(--amarillo);
  color: #262626;
  margin-top: 10px;
  box-shadow: 0 10px 22px rgba(255, 191, 7, .28);
}

.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(255, 191, 7, .34);
}

.secondary {
  background: var(--gris);
  color: #fff;
}

.secondary:hover {
  background: #383838;
  transform: translateY(-1px);
}

.remove {
  background: #ffe4df;
  color: var(--danger);
  border: none;
  border-radius: 10px;
  padding: 9px 11px;
  cursor: pointer;
  font-weight: 800;
}

/* RESULTADOS */
.mini-result {
  margin-top: 14px;
  padding: 15px;
  background: var(--soft-gray);
  border: 1px solid var(--border);
  border-left: 5px solid var(--amarillo);
  border-radius: 14px;
  line-height: 1.6;
}

.result {
  margin-top: 24px;
  border-top: 7px solid var(--amarillo);
}

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

.kpi {
  padding: 18px;
  border-radius: 18px;
  background: #f8f9fa;
  border: 1px solid var(--border);
  border-top: 5px solid var(--amarillo);
}

.kpi span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 7px;
  font-weight: 700;
}

.kpi strong {
  font-size: 24px;
  color: var(--gris);
}

.kpi small {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

/* SEMÁFOROS */
.kpi.semaforo-rojo {
  border-top-color: #c0392b;
  background: #fff5f5;
}

.kpi.semaforo-rojo strong {
  color: #c0392b;
}

.kpi.semaforo-rojo small {
  background: #fdecec;
  color: #922b21;
}

.kpi.semaforo-amarillo {
  border-top-color: #ffbf07;
  background: #fffaf0;
}

.kpi.semaforo-amarillo strong {
  color: #8a6d00;
}

.kpi.semaforo-amarillo small {
  background: #fff1b8;
  color: #6f5700;
}

.kpi.semaforo-verde {
  border-top-color: #047857;
  background: #f0fdf4;
}

.kpi.semaforo-verde strong {
  color: #047857;
}

.kpi.semaforo-verde small {
  background: #dcfce7;
  color: #166534;
}

/* ALERTAS */
.alert {
  border-left: 6px solid;
  padding: 14px 16px;
  border-radius: 12px;
  margin: 10px 0;
  background: #fff;
  line-height: 1.45;
}

.alert.danger {
  border-color: var(--danger);
  background: #fff5f5;
}

.alert.warning {
  border-color: var(--amarillo);
  background: #fffaf0;
}

.alert.success {
  border-color: var(--success);
  background: #f0fdf4;
}

/* PRIVACIDAD */
.privacy-block h2::before {
  background: var(--gris);
}

.privacy-box {
  background: #f4f4f0;
  border: 1px solid #deded8;
  border-left: 5px solid var(--amarillo);
  border-radius: 14px;
  padding: 16px 18px;
  color: #4b5563;
  line-height: 1.55;
}

.privacy-box strong {
  display: block;
  color: #303030;
  margin-bottom: 6px;
}

.privacy-box p {
  margin: 0;
  text-align: justify;
}

/* VIDEOS */
.video-link {
  display: inline-block;
  margin: 0 0 14px;
  padding: 9px 13px;
  background: rgba(255, 191, 7, 0.16);
  border: 1px solid rgba(255, 191, 7, 0.55);
  border-radius: 999px;
  color: #4A4A4A;
  text-decoration: none;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}

.video-link:hover {
  background: #FFBF07;
  color: #262626;
}

.video-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 18px;
}

.video-modal-content {
  position: relative;
  width: min(420px, 94vw);
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  border: 4px solid #FFBF07;
}

.video-modal-content iframe {
  width: 100%;
  height: 100%;
  display: block;
}

.video-close {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: #FFBF07;
  color: #262626;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.video-close:hover {
  background: #ffffff;
}

a {
  color: #1f2937;
  text-decoration-color: var(--amarillo);
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
}

/* RESPONSIVE */
@media (max-width: 760px) {
  .app {
    width: min(100%, 94vw);
    padding-top: 14px;
  }

  .grid,
  .kpi-grid,
  .phone-row {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 20px;
  }

  .brand-header {
    border-radius: 0 0 18px 18px;
  }

  .brand-top {
    padding: 24px 22px 14px;
    align-items: flex-start;
  }

  .brand-logo {
    max-width: 210px;
  }

  .brand-right {
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
  }

  .brand-avatar {
    width: 64px;
    height: 64px;
  }

  .tutorial-main-btn {
    max-width: 210px;
    font-size: 13px;
    padding: 10px 12px;
  }

  .tutorial-main-btn span {
    font-size: 11px;
  }

  .brand-line {
    width: calc(100% - 44px);
    margin: 0 22px;
  }

  .brand-content {
    padding: 18px 22px 22px;
  }

  .brand-content h1 {
    font-size: 42px;
  }

  .brand-subtitle {
    font-size: 18px;
  }

  .brand-description {
    font-size: 16px;
  }

  .brand-explanation {
    font-size: 15px;
    text-align: left;
  }

  .brand-footer {
    padding: 12px 22px;
  }
}

/* NUMERAL 5 MEJORADO */
.cliente-calc-box {
  background: #f7f8f9;
  border: 1px solid var(--border);
  border-left: 5px solid var(--amarillo);
  border-radius: 16px;
  padding: 18px;
  margin: 16px 0 18px;
}

.cliente-calc-box h3 {
  margin-bottom: 14px;
}

.n5-question {
  margin-top: 16px;
}

.toggle-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 12px;
}

.toggle-option {
  border: 1px solid #cdd2d8;
  background: #ffffff;
  color: #172033;
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 900;
}

.toggle-option.active {
  background: var(--amarillo);
  border-color: var(--amarillo);
  color: #262626;
  box-shadow: 0 8px 18px rgba(255, 191, 7, .20);
}

.calc-subbox {
  background: #ffffff;
  border: 1px solid #dfe3e7;
  border-radius: 14px;
  padding: 14px;
  margin-top: 10px;
}

.calc-warning {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  padding: 10px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
  margin-top: 10px;
}

.calc-preview {
  background: #fff8df;
}

.cliente-source {
  display: inline-block;
  margin-top: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff8df;
  color: #4A4A4A;
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 760px) {
  .toggle-row {
    grid-template-columns: 1fr;
  }
}


.edit {
  background: #fff8df;
  color: #4A4A4A;
  border: none;
  border-radius: 10px;
  padding: 9px 11px;
  cursor: pointer;
  font-weight: 800;
  margin-right: 6px;
}

.edit:hover {
  background: var(--amarillo);
}

.n5-alert {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.n5-alert.warning {
  background: #fffaf0;
  border: 1px solid #ffbf07;
  color: #6f5700;
}

.n5-alert.danger {
  background: #fff5f5;
  border: 1px solid #c0392b;
  color: #922b21;
}

.n5-alert.success {
  background: #f0fdf4;
  border: 1px solid #047857;
  color: #166534;
}
