/* ================================
   Reset básico
================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f7f7f7;
  color: #222;
  line-height: 1.5;
}

/* Paleta corporativa */
:root {
  --ai-yellow: #f8b400;
  --ai-yellow-soft: #ffe9b3;
  --ai-yellow-border: #f4c15a;
  --ai-text: #222222;
  --ai-muted: #555555;
  --ai-bg: #ffffff;
  --ai-border-soft: #e6e6e6;
}

/* ================================
   Layout general
================================== */
.site-header {
  background: var(--ai-bg);
  padding: 16px 24px;
  border-bottom: 2px solid var(--ai-yellow-border);
}

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

.site-header img {
  height: 56px;
  width: auto;
  border-radius: 8px;
}

.site-header .titles h1 {
  margin: 0;
  font-size: 1.4rem;
  color: var(--ai-text);
}

.site-header .titles p {
  margin: 4px 0 0;
  color: var(--ai-muted);
  font-size: 0.95rem;
}

main {
  max-width: 1100px;
  margin: 24px auto 40px;
  padding: 0 16px;
}

.card {
  background: var(--ai-bg);
  border-radius: 16px;
  border: 1px solid var(--ai-yellow-border);
  box-shadow: 0 8px 18px rgba(0,0,0,0.03);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 1.25rem;
  color: var(--ai-text);
}

/* ================================
   Grids y formularios
================================== */

.grid.formgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px 16px;
}

.grid.confirmgrid {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(260px, 1fr);
  gap: 16px;
}

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

label {
  font-size: 0.9rem;
  color: var(--ai-muted);
  display: block;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--ai-border-soft);
  font-size: 0.95rem;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--ai-yellow);
  box-shadow: 0 0 0 2px rgba(248, 180, 0, 0.25);
}

.sub {
  font-size: 0.9rem;
  color: var(--ai-muted);
  margin-top: 8px;
  margin-bottom: 0;
}

/* ================================
   Productos
================================== */

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

@media (min-width: 800px) {
  .products {
    grid-template-columns: 1fr 1fr;
  }
}

.products .item {
  border-radius: 12px;
  border: 1px solid var(--ai-border-soft);
  padding: 10px 12px;
  background: #fffdf8;
}

.products .head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.products .title {
  font-weight: 600;
  color: var(--ai-text);
}

.products .row {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.products .row .sub {
  flex: 1 1 auto;
  margin: 0;
  font-size: 0.86rem;
  min-width: 0;
  word-wrap: break-word;
}

.inline-input {
  flex: 1 1 auto;
  min-width: 0;
}

/* cantidad */
.qty {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--ai-border-soft);
  overflow: hidden;
  background: #ffffff;
  flex-shrink: 0;
}

.qty input[type="number"] {
  width: 60px;
  border: none;
  text-align: center;
  padding: 6px 4px;
  font-size: 0.9rem;
}

.btn-qty {
  border: none;
  background: transparent;
  padding: 4px 10px;
  font-size: 1rem;
  cursor: pointer;
}

.btn-qty:hover {
  background: #f5f5f5;
}

.sub.total {
  margin-top: 10px;
}

/* Ajuste mobile productos */
@media (max-width: 600px) {
  .products .row {
    flex-direction: column;
    align-items: flex-start;
  }

  .qty {
    width: 100%;
    justify-content: space-between;
  }

  .qty input[type="number"] {
    flex: 0 0 60px;
  }
}

/* ================================
   Botones generales
================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--ai-border-soft);
  background: #ffffff;
  padding: 6px 14px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.btn:hover {
  background: #fdf7ea;
  box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.btn.primary {
  background: var(--ai-yellow);
  border-color: var(--ai-yellow);
  color: #000;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(248, 180, 0, 0.25);
}

.btn.primary:hover {
  background: #ffbf1f;
}

.link {
  background: none;
  border: none;
  color: #0066cc;
  padding: 0;
  cursor: pointer;
  font-size: 0.88rem;
  text-decoration: underline;
}

/* "Ver beneficios" pill */
.pago-unico .link {
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid var(--ai-border-soft);
  padding: 5px 14px;
  margin-left: 8px;
  background: #ffffff;
  color: var(--ai-muted);
  font-weight: 500;
}

.pago-unico .link:hover {
  background: #fdf7ea;
  border-color: var(--ai-yellow-border);
}

/* ================================
   Mantenimiento preventivo
================================== */

.plan-toggle {
  margin-top: 12px;
}

/* botones Plan Base / Plan Full más grandes */
.segmented {
  display: inline-flex;
  gap: 0;
  border-radius: 18px;
  padding: 3px;
  background: #fffdf8;
  border: 1px solid var(--ai-yellow-border);
  max-width: 100%;
  overflow: hidden;
}

.segmented .seg {
  border: none;
  background: transparent;
  padding: 12px 32px;
  min-width: 180px;
  border-radius: 14px;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--ai-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
  text-align: center;
}

.segmented .seg small {
  font-size: 0.8rem;
}

.segmented .seg[aria-pressed="true"] {
  background: #ffffff;
  color: var(--ai-text);
  box-shadow: 0 6px 14px rgba(248, 180, 0, 0.25);
  transform: translateY(-1px);
}

/* mobile planes */
@media (max-width: 600px) {
  .segmented {
    flex-direction: column;
    align-items: stretch;
  }

  .segmented .seg {
    width: 100%;
    padding: 12px 18px;
  }
}

.highlight {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fffdf8;
  border: 1px dashed var(--ai-yellow-border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.highlight .badge {
  border-radius: 999px;
  padding: 6px 14px;
  border: 1px solid var(--ai-yellow-border);
  background: #ffffff;
  font-size: 0.82rem;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .highlight {
    flex-direction: column;
  }

  .highlight .badge {
    white-space: normal;
  }
}

.pago-unico {
  margin-top: 8px;
  font-size: 0.9rem;
  word-wrap: break-word;
}

/* ================================
   Checkboxes modernos
================================== */

.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 6px;
  font-size: 0.92rem;
  color: var(--ai-text);
  word-wrap: break-word;
}

.check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--ai-border-soft);
  margin-top: 2px;
  position: relative;
  cursor: pointer;
  background: #ffffff;
  flex-shrink: 0;
}

.check input[type="checkbox"]::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 3px;
  background: transparent;
}

.check input[type="checkbox"]:checked {
  border-color: var(--ai-yellow);
  background: var(--ai-yellow);
}

.check input[type="checkbox"]:checked::after {
  content: "✓";
  color: #000;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.check span {
  flex: 1 1 auto;
}

.check .link {
  margin-left: 4px;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .check {
    flex-direction: row;
    align-items: flex-start;
  }

  .check .link {
    white-space: normal;
  }
}

/* ================================
   Declaraciones
================================== */

.card:last-of-type {
  margin-bottom: 32px;
}

/* ================================
   Uploader
================================== */

.uploader {
  border-radius: 14px;
  border: 1px dashed var(--ai-yellow-border);
  padding: 12px 14px;
  background: #fffdf8;
}

.uploader .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.uploader .actions small {
  font-size: 0.82rem;
  color: var(--ai-muted);
}

.uploader .fileInfo {
  margin-top: 8px;
  font-size: 0.86rem;
}

.uploader.hover {
  background: #fff4d1;
}

/* ================================
   Dialogs
================================== */

dialog {
  border-radius: 16px;
  border: 1px solid var(--ai-yellow-border);
  padding: 0;
  max-width: 640px;
}

dialog::backdrop {
  background: rgba(0,0,0,0.35);
}

dialog header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--ai-border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

dialog header h3 {
  margin: 0;
  font-size: 1rem;
}

dialog article {
  padding: 14px 16px;
  max-height: 60vh;
  overflow: auto;
  font-size: 0.9rem;
}

dialog footer {
  padding: 10px 16px 12px;
  border-top: 1px solid var(--ai-border-soft);
  display: flex;
  justify-content: flex-end;
}

.icon.close {
  border-radius: 999px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--ai-border-soft);
  background: #ffffff;
  cursor: pointer;
}

table.benefits {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

table.benefits th,
table.benefits td {
  border: 1px solid #ececec;
  padding: 6px 8px;
}

table.benefits th {
  background: #fffdf0;
}

/* ================================
   Live region
================================== */

.aria-live {
  margin-top: 10px;
  font-size: 0.85rem;
}

/* ================================
   Responsivo general
================================== */

@media (max-width: 768px) {
  .site-header {
    padding: 12px 16px;
  }

  .site-header .brand {
    flex-direction: row;
    align-items: center;
  }

  .site-header img {
    height: 48px;
  }

  main {
    padding: 0 12px;
  }

  .card {
    padding: 16px 14px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 0.95rem;
  }

  .site-header .titles h1 {
    font-size: 1.15rem;
  }

  .segmented .seg {
    font-size: 0.9rem;
  }
}
