/* =====================================================================
   ADH Design System — la capa del sistema para las páginas públicas del huésped
   Fuente: docs/design/ds-adh/fuente/ (README, tokens.json, components/*)
   Desvíos de ATELIER: .claude/skills/ds-adh/desvios.md (ganan sobre el DS)
   Consumidores: docs/design/ds-adh/consumidores.md

   Toda página pública la enlaza ANTES de su hoja propia (hoy, el portal de
   traslados: app/Views/Transpo/portal/_head.php → transpo-portal.css).
   Aquí sólo vive lo del sistema, nada con prefijo de una pantalla:

   1. Fuentes Heebo LOCALES (public/assets/fonts; nada de Google Fonts).
   2. Tokens en `:root`. Los colores SÓLO viven aquí.
   3. Temas por hotel (`.atpm-theme`, `.olcp-theme`), que el servidor pone
      en `<html>` (en el portal, tptl_tema()). Sin clase = tema base.
   4. Base genérica (box-sizing, foco, `[hidden]`, cuerpo de la página).
   5. Utilidades de texto, iconos `icon-ui` y componentes con el nombre del
      DS: button, alert, badge, chip, form TextField/Select, radio/checkbox,
      stepper, progress, card, list, loader.

   Sin modo oscuro (desvío 7): siempre en claro.
   Contraste (desvíos 1–6): texto «de marca» con --theme-color-text-accent,
   foco con --theme-focus, borde de campo gris 600, botón principal con
   --theme-on-primary (#111 en base y ATPM, blanco en Óleo).
   La tipografía de títulos y párrafos NO va aquí: cada página la acota a su
   contenedor (en el portal, `.tp-main`).
   ===================================================================== */

/* ---------- 1 · Fuentes (locales; nada de Google Fonts) ---------- */
@font-face{ font-family:"Heebo"; src:url(/public/assets/fonts/Heebo-Light.woff2) format("woff2"); font-weight:300; font-style:normal; font-display:swap; }
@font-face{ font-family:"Heebo"; src:url(/public/assets/fonts/Heebo-Regular.ttf) format("truetype"); font-weight:400; font-style:normal; font-display:swap; }
@font-face{ font-family:"Heebo"; src:url(/public/assets/fonts/Heebo-Medium.woff2) format("woff2"); font-weight:500; font-style:normal; font-display:swap; }
@font-face{ font-family:"Heebo"; src:url(/public/assets/fonts/Heebo-Bold.ttf) format("truetype"); font-weight:700; font-style:normal; font-display:swap; }

/* ---------- 2 · Tokens del DS ---------- */
:root {
    --font-family: "Heebo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

    /* Marca (tema base: antes de saber el hotel) */
    --theme-color-primary: #b68845;
    --theme-color-secondary: #a1783e;
    /* Texto «de marca»: el dorado no llega a 4.5:1 sobre blanco (README §5). */
    --theme-color-text-accent: var(--gray-900);
    /* Texto sobre el dorado (botón principal): #111 pasa AA en base y ATPM. */
    --theme-on-primary: #111111;
    --theme-focus: var(--theme-color-secondary);
    --theme-global-shape: .65rem;
    --theme-button-shape: .65rem;
    --theme-input-shape: .65rem;
    --shape-tag: 15px;
    --shape-sm: 4px;
    --shape-pill: 999px;

    /* Neutros */
    --white: #fff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;

    /* Estados */
    --green-100: #f3fce7; --green-300: #b8e383; --green-500: #389d2a; --green-700: #357100; --green-900: #214600;
    --yellow-100: #fef0d0; --yellow-300: #fdcc5c; --yellow-500: #fcb000; --yellow-700: #c48100; --yellow-900: #8a6000;
    --blue-100: #dff4fd; --blue-300: #9fdef9; --blue-500: #4fc3f4; --blue-700: #00a0e4; --blue-900: #2c6b86;
    --red-100: #fdd9d2; --red-300: #fa8d7a; --red-500: #f62f0c; --red-700: #ba0000; --red-900: #701606;

    /* Roles */
    --color-surface: var(--white);
    --color-surface-subtle: var(--gray-100);
    --color-border: var(--gray-300);
    --color-input-border: var(--gray-600);
    --color-text: var(--gray-900);
    --color-text-muted: var(--gray-600);
    --color-text-nav: var(--gray-700);

    /* Espaciado 4 / 8 / 16 / 24 / 48 */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 16px;
    --space-4: 24px;
    --space-5: 48px;

    /* Elevación: sólo para el resumen destacado (cotización) */
    --elevation-8: 0 5px 5px -3px rgba(0, 0, 0, .06), 0 8px 10px 1px rgba(0, 0, 0, .04), 0 3px 14px 2px rgba(0, 0, 0, .04);
}

/* ---------- 3 · Temas por hotel ---------- */
/* Temas por hotel (mismas llaves que el bundle del DS). Lo pone el servidor
   en <html> con tptl_tema(): ATELIER Playa Mujeres / Óleo Cancún Playa.
   Desvío 12: ATELIER Playa Mujeres usa el dorado base ADH, no el #c7893e /
   #bd7114 del DS (se veía anaranjado). La clase se queda: el logo y lo que
   el DS agregue al tema ATPM siguen colgando de ella. */
:root.atpm-theme {
    --theme-color-primary: #b68845;
    --theme-color-secondary: #a1783e;
}
:root.olcp-theme {
    --theme-color-primary: #635b55;
    --theme-color-secondary: #796e65;
    --theme-color-text-accent: var(--theme-color-primary);
    --theme-on-primary: var(--white);
}

/* ---------- 4 · Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
fieldset { min-width: 0; }
strong, b { font-weight: 700; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--theme-focus); outline-offset: 2px; }
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Cuerpo de la página: fondo, color y familia del DS. El acomodo (columna,
   pie abajo) es de cada página. */
body {
    background: var(--color-surface); color: var(--color-text);
    font-family: var(--font-family); -webkit-font-smoothing: antialiased;
}

/* ---------- 5 · Utilidades de texto ---------- */
.text-body-2 { font-size: .95rem; line-height: 1.45rem; }
.text-body-3 { font-size: .85rem; line-height: 1.3rem; }
.text-small { font-size: .75rem; line-height: 1.1rem; }
.text-muted { color: var(--color-text-muted); }
.text-nav { color: var(--color-text-nav); }

/* ---------- 5 · Iconos (icon-ui) ----------
   SVG inline con las clases del DS (en el portal, `_icons.php` / `tp_icon()`);
   el tamaño y el trazo los pone el CSS según dónde va el icono. */
.icon-ui {
    display: block; flex: none;
    fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round;
}
.icon-ui:not([width]) { width: 1.25rem; height: 1.25rem; }
.icon-ui:not([stroke-width]) { stroke-width: 1.6; }

/* ---------- 5 · Button ---------- */
.button {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
    min-height: 48px; padding: .85rem 1.25rem;
    border: 1px solid transparent; border-radius: var(--theme-button-shape);
    background: none; color: var(--color-text);
    font: inherit; font-size: 1rem; line-height: 1.25rem; text-align: center; text-decoration: none;
    cursor: pointer; transition: background-color .2s, border-color .2s, color .2s;
}
.button .icon-ui { width: 1.125rem; height: 1.125rem; }
.button--raised {
    background: linear-gradient(to right, var(--theme-color-primary), var(--theme-color-secondary));
    color: var(--theme-on-primary); text-transform: uppercase; letter-spacing: .75px; font-weight: 500;
}
.button--raised:hover { background: var(--theme-color-secondary); color: var(--theme-on-primary); }
.button--outlined {
    border-color: var(--gray-500); background: var(--white);
    color: var(--theme-color-text-accent); font-weight: 700;
}
.button--outlined .icon-ui { color: var(--theme-color-primary); }
.button--outlined:hover { border-color: var(--theme-color-secondary); background: var(--color-surface-subtle); }
.button--text { color: var(--theme-color-text-accent); font-weight: 500; }
.button--text:hover { background: var(--color-surface-subtle); }
.button--link {
    min-height: 44px; padding: 0; color: var(--theme-color-text-accent); font-weight: 500; justify-content: flex-start;
}
.button--link .button-label { text-decoration: underline; text-decoration-color: var(--theme-color-primary); text-underline-offset: 4px; }
.button--link .icon-ui { color: var(--theme-color-primary); }
.button--muted { color: var(--color-text-nav); }
.button--small { min-height: 44px; padding: .5rem .85rem; font-size: .875rem; }
.button--fullwidth { width: 100%; }
.button:disabled, .button.button--disabled {
    background: var(--gray-100); border-color: var(--gray-300); color: var(--gray-600); cursor: not-allowed;
}
/* Ocupado: conserva la marca, sólo se apaga un poco */
.button.is--busy { cursor: progress; opacity: .85; }
.button--raised.is--busy:disabled { background: linear-gradient(to right, var(--theme-color-primary), var(--theme-color-secondary)); color: var(--theme-on-primary); border-color: transparent; }
.button .loader__circle { border-color: currentColor; border-top-color: transparent; }

/* ---------- 5 · Alert ---------- */
.alert {
    display: flex; gap: .75rem; align-items: flex-start;
    padding: .75rem; margin: 0 0 var(--space-3);
    border: 1px solid var(--gray-300); border-left: 4px solid var(--gray-600);
    border-radius: 0 var(--theme-global-shape) var(--theme-global-shape) 0;
    background: var(--color-surface-subtle);
    font-size: .9rem; line-height: 1.4rem; color: var(--color-text);
}
.alert__icon { flex: none; width: 1.25rem; height: 1.25rem; margin-top: .1rem; color: var(--gray-700); }
.alert__content { flex: 1; min-width: 0; }
.alert__content p:last-child, .alert__content ul:last-child { margin-bottom: 0; }
.alert__title { display: block; margin: 0 0 .125rem; font-size: .9rem; font-weight: 500; color: var(--gray-900); }
.alert--success { background: var(--green-100); border-color: var(--green-300); border-left-color: var(--green-500); }
.alert--success .alert__icon { color: var(--green-700); }
.alert--success .alert__title { color: var(--green-900); }
.alert--warning { background: var(--yellow-100); border-color: var(--yellow-300); border-left-color: var(--yellow-500); }
.alert--warning .alert__icon, .alert--warning .alert__title { color: var(--yellow-900); }
.alert--info { background: var(--blue-100); border-color: var(--blue-300); border-left-color: var(--blue-500); }
.alert--info .alert__icon, .alert--info .alert__title { color: var(--blue-900); }
.alert--danger { background: var(--red-100); border-color: var(--red-300); border-left-color: var(--red-500); }
.alert--danger .alert__icon { color: var(--red-700); }
.alert--danger .alert__title { color: var(--red-900); }
.alert.is--hide { display: none; }

/* ---------- 5 · Badge ---------- */
.badge {
    display: inline-flex; align-items: center; gap: .375rem;
    padding: 4px 12px; border-radius: var(--shape-pill);
    font-size: .75rem; line-height: 1rem; font-weight: 500; white-space: nowrap;
    color: var(--gray-700); background: var(--gray-200);
}
.badge--info { color: var(--blue-900); background: var(--blue-100); }
.badge--success { color: var(--green-900); background: var(--green-100); }
.badge--warning { color: var(--yellow-900); background: var(--yellow-100); }
.badge--danger { color: var(--red-900); background: var(--red-100); }
.badge--muted { color: var(--gray-700); background: var(--gray-200); }
.badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- 5 · Chip ---------- */
.chip {
    display: inline-flex; align-items: center; gap: var(--space-2);
    min-height: 44px; padding: .5rem 1rem;
    border: 1px solid var(--gray-300); border-radius: var(--shape-pill);
    background: var(--white); color: var(--gray-700);
    font: inherit; font-size: .875rem; line-height: 1.25rem; text-decoration: none; cursor: pointer;
}
.chip .icon-ui { width: 1rem; height: 1rem; color: var(--theme-color-primary); }
.chip:hover { border-color: var(--gray-500); }
/* Elegido: borde de 2 px con el secundario (el chip--raised del DS es 3.8:1 en ATPM). */
.chip[aria-current="page"], .chip.is--active {
    border: 2px solid var(--theme-color-secondary); padding: calc(.5rem - 1px) calc(1rem - 1px);
    color: var(--gray-900); font-weight: 500;
}
.chip--raised { background: var(--theme-color-secondary); border-color: var(--theme-color-secondary); color: var(--theme-on-primary); }

/* ---------- 5 · Form: TextField / Select ---------- */
.form-group { margin: 0 0 1.25rem; }
.form-text-field { position: relative; }
.form-text-field--outlined input,
.form-text-field--outlined select,
.form-text-field--outlined textarea {
    display: block; width: 100%; min-height: 56px; margin: 0;
    padding: 1rem; border: 1px solid var(--color-input-border); border-radius: var(--theme-input-shape);
    background: var(--white); color: var(--color-text);
    font: inherit; font-size: 1rem; line-height: 1.5rem;
    appearance: none; -webkit-appearance: none;
}
.form-text-field--outlined input, .form-text-field--outlined select { height: 56px; }
.form-text-field--outlined input[type="date"], .form-text-field--outlined input[type="time"] { padding-left: .75rem; padding-right: .5rem; }
.form-text-field--outlined textarea { min-height: 112px; resize: vertical; }
.form-text-field--outlined input::placeholder,
.form-text-field--outlined textarea::placeholder { color: var(--gray-600); }
.form-text-field--outlined input:focus,
.form-text-field--outlined select:focus,
.form-text-field--outlined textarea:focus {
    outline: none; border-color: var(--theme-focus); box-shadow: 0 0 0 1px var(--theme-focus);
}
.form-text-field--outlined input[readonly] { background: var(--gray-100); }
.form-text-field--outlined > label {
    position: absolute; top: -.65rem; left: .75rem; z-index: 1;
    padding: 0 .25rem; background: var(--white);
    font-size: .75rem; line-height: 1.25rem; font-weight: 500; color: var(--gray-700);
}
.form-text-field--select::after {
    content: ""; position: absolute; right: 1.1rem; top: 50%; width: .5rem; height: .5rem; margin-top: -.35rem;
    border-right: 2px solid var(--gray-700); border-bottom: 2px solid var(--gray-700); transform: rotate(45deg);
    pointer-events: none;
}
.form-text-field--select select { padding-right: 2.75rem; }
.form-text-field-notes { display: block; margin-top: .375rem; font-size: .75rem; line-height: 1.1rem; color: var(--gray-700); }
.form-group.is--danger input, .form-group.is--danger select, .form-group.is--danger textarea { border-color: var(--red-700); }
.form-group.is--danger > .form-text-field > label,
.form-group.is--danger .form-text-field-notes { color: var(--red-700); }
.form-group.is--success input { border-color: var(--green-700); }

/* ---------- 5 · Radio / Checkbox ---------- */
.form-radio__control, .form-checkbox__control {
    position: relative; display: flex; align-items: flex-start; gap: .75rem;
    min-height: 44px; cursor: pointer;
}
.form-radio__control > input, .form-checkbox__control > input {
    position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0;
}
.form-radio__mark, .form-checkbox__mark {
    flex: none; width: 22px; height: 22px; margin-top: 1px;
    display: grid; place-items: center;
    border: 2px solid var(--theme-color-secondary); background: var(--white);
}
.form-radio__mark { border-radius: 50%; }
.form-checkbox__mark { border-radius: var(--shape-sm); }
input:checked + .form-radio__mark::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--theme-color-secondary); }
input:checked + .form-checkbox__mark { background: var(--theme-color-secondary); }
input:checked + .form-checkbox__mark::after {
    content: ""; width: 6px; height: 11px; margin-top: -2px;
    border-right: 2px solid var(--white); border-bottom: 2px solid var(--white); transform: rotate(45deg);
}
input:focus-visible + .form-radio__mark, input:focus-visible + .form-checkbox__mark { outline: 2px solid var(--theme-focus); outline-offset: 2px; }
input:disabled + .form-radio__mark, input:disabled + .form-checkbox__mark { border-color: var(--gray-400); }
.form-radio__label, .form-checkbox__label { display: flex; flex-direction: column; gap: 2px; padding-top: 1px; }
.form-radio__label strong, .form-checkbox__label strong { font-weight: 500; }
.form-radio__label > span, .form-checkbox__label > span { font-size: .85rem; line-height: 1.3rem; color: var(--gray-700); }
.form-radio--outlined {
    padding: 1rem; border: 1px solid var(--gray-300); border-radius: var(--theme-global-shape); background: var(--white);
}
.form-radio--outlined:has(input:checked) { border: 2px solid var(--theme-color-secondary); padding: calc(1rem - 1px); }

/* ---------- 5 · Stepper ---------- */
.stepper-group { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.stepper-label { display: flex; flex-direction: column; }
.stepper-label strong { font-weight: 500; }
.stepper-label span { font-size: .85rem; line-height: 1.3rem; color: var(--gray-700); }
.stepper-control {
    display: inline-flex; align-items: center;
    border: 1px solid var(--color-input-border); border-radius: var(--theme-input-shape); background: var(--white);
}
.stepper-control .button { min-width: 48px; min-height: 48px; padding: 0; justify-content: center; }
.stepper-control .button .icon-ui { width: 1.25rem; height: 1.25rem; }
.stepper-counter {
    width: 3rem; min-height: 48px; border: 0; background: none; text-align: center;
    font: inherit; font-size: 1.125rem; font-weight: 500; color: var(--color-text);
    -moz-appearance: textfield; appearance: textfield;
}
.stepper-counter::-webkit-outer-spin-button, .stepper-counter::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-control .button--disabled { color: var(--gray-500); background: none; border: 0; }

/* ---------- 5 · ProgressBar ----------
   El DS lo dibuja en línea; en el teléfono cada paso lleva título y frase,
   así que es vertical y desde 768 px pasa a la variante en línea. */
.progress-bar { list-style: none; margin: 0; padding: 0; }
.progress-step { position: relative; display: flex; gap: .75rem; padding: 0 0 1.25rem; }
.progress-step:not(:last-child)::before {
    content: ""; position: absolute; left: 11px; top: 26px; bottom: 2px; width: 2px; background: var(--gray-300);
}
.progress-step__shape {
    position: relative; flex: none; width: 24px; height: 24px; border-radius: 50%;
    display: grid; place-items: center; border: 2px solid var(--gray-500); background: var(--white);
    font-size: .75rem; font-weight: 500; color: var(--gray-700);
}
.progress-step__shape .icon-ui { width: 14px; height: 14px; stroke-width: 2.4; }
.progress-step--active .progress-step__shape { background: var(--gray-700); border-color: var(--gray-700); color: var(--white); }
.progress-step--success .progress-step__shape { background: var(--green-500); border-color: var(--green-500); color: var(--white); }
.progress-step--success::before { background: var(--green-500) !important; }
.progress-step__label { display: block; font-size: .95rem; line-height: 1.4rem; font-weight: 500; }
.progress-step__text { display: block; font-size: .85rem; line-height: 1.3rem; color: var(--gray-700); }
@media (min-width: 768px) {
    .progress-bar--inline { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--space-3); }
    .progress-bar--inline .progress-step { flex-direction: column; padding: 0; }
    .progress-bar--inline .progress-step:not(:last-child)::before { left: 32px; right: calc(-1 * var(--space-3) + 6px); top: 11px; bottom: auto; width: auto; height: 2px; }
}

/* ---------- 5 · Card ---------- */
.card { background: var(--white); border: 1px solid var(--color-border); border-radius: var(--theme-global-shape); }
.card__header { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; padding: 1rem 1rem .75rem; }
.card__content { padding: 0 1rem 1rem; }
.card__row { padding: .875rem 1rem; border-bottom: 1px solid var(--color-border); }
.card__row:last-child { border-bottom: 0; }
.card__footer { padding: 1rem; border-top: 1px solid var(--color-border); }
.card--fullwidth { width: 100%; }
.elevation-8 { box-shadow: var(--elevation-8); }

/* ---------- 5 · List ---------- */
.list-unstyled { list-style: none; margin: 0; padding: 0; }
.list-disc { margin: 0 0 var(--space-3); padding-left: 1.25rem; }
.list-disc li + li { margin-top: var(--space-1); }
.list-inline { display: flex; flex-wrap: wrap; align-items: center; list-style: none; margin: 0; padding: 0; }
.list-disc-separator > li + li::before { content: "·"; margin: 0 .5rem; color: var(--gray-600); }

/* ---------- 5 · Loader ---------- */
.loader__circle {
    display: inline-block; flex: none; border: .25rem solid var(--gray-400); border-top-color: var(--theme-color-primary);
    border-radius: 50%; animation: loader-spin .4s linear infinite;
}
.loader__size-16 { width: 16px; height: 16px; border-width: 2px; }
.loader__size-32 { width: 32px; height: 32px; }
.loader { display: none; }
.loader.is--show { display: flex; align-items: center; justify-content: center; gap: .75rem; }
@keyframes loader-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
    .loader__circle { animation-duration: 1.6s; }
}
