/* ============================================================
   ONBOARDING 2026 — Figma "Cubicup-Web" › Iteration #2 › Onboarding 01–06
   (1440 × 941). Va sobre el CSS del plugin cubicup-onboarding: solo escritorio
   (el móvil se queda como lo deja el plugin hasta montar su diseño).
   Izquierda (554): título 36/40, línea de progreso con "1/6", el paso centrado en
   vertical y la tarjeta de valoración abajo. Derecha: el vídeo de la casa en un
   panel de 878 × 925 con radio 16 y 8px de margen.
   ============================================================ */

@media (min-width: 1024px) {
    .onb {
        grid-template-columns: 554px 1fr;
        min-height: 100vh;
        background: var(--background-page, #fef8f3);
    }

    /* ---- columna del formulario ---- */
    .onb__panel {
        justify-content: flex-start;
        padding: 32px 16px 24px 32px;
        gap: 0;
    }
    .onb__header { margin: 0; text-align: left; max-width: 448px; }
    .onb__eyebrow { display: none; }
    .onb__intro {
        margin: 0;
        font-family: var(--font-family-title);
        font-size: var(--heading-lg-size, 36px);
        line-height: var(--heading-lg-line-height, 40px);
        letter-spacing: var(--heading-lg-tracking, -0.01em);
        font-weight: var(--font-weight-regular, 400);
        color: var(--text-primary, #000);
        text-align: left;
    }

    /* línea de progreso: tramo hecho en navy (1px) y el resto fino al 20 % */
    .onb__progressbox { margin: 32px 0 0; width: 100%; max-width: 506px; display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
    .onb__progress {
        width: 100%;
        height: 1px;
        border-radius: 0;
        background: linear-gradient(rgba(0, 0, 0, .2), rgba(0, 0, 0, .2)) 0 50% / 100% .5px no-repeat;
        overflow: visible;
    }
    .onb__progress-bar { height: 1px; border-radius: 0; background: var(--background-navy, #0c2340); }
    .onb__steps-indicator {
        margin: 0;
        font-size: var(--ui-card-eyebrow-size, 10px);
        line-height: 13px;
        letter-spacing: .2em;
        word-spacing: -.25em;
        text-transform: uppercase;
        color: var(--text-muted, rgba(0, 0, 0, .4));
        text-align: left;
    }

}

/* Componentes del paso (pregunta, campos, opciones, botones, valoración): iguales
   en escritorio y en móvil (Figma "Onboarding 01–06", también en 390). */
@media all {
    /* el paso, centrado en vertical entre la cabecera y la valoración */
    .onb__panel .onb__form { margin: auto 0; max-width: 448px; width: 100%; padding: 16px 0; }
    /* el plugin reserva 240px por paso para que el botón no salte; con 160 el
       botón sube y en un portátil (~714px de alto) se ve la tarjeta de reseñas */
    .onb__step.is-active { min-height: 160px; }
    .onb__q {
        margin: 0 0 24px;
        font-family: var(--font-family-title);
        font-size: 20px;
        line-height: 28px;
        font-weight: var(--font-weight-regular, 400);
        letter-spacing: 0;
        color: var(--text-primary, #000);
    }
    .onb__step[data-step-id="codigo_postal"] .onb__hint { display: none; } /* las ciudades ya van en el título */

    /* campos (Figma "Inputs"): label 14/19, caja de 40 blanca, borde 20 %, radio 8 */
    .onb__field { margin-bottom: 16px; }
    .onb__label { margin: 0 0 8px; font-size: var(--body-sm-size, 14px); line-height: 19px; font-weight: var(--font-weight-regular, 400); color: var(--text-primary, #000); letter-spacing: 0; text-transform: none; }
    .onb__input {
        height: 40px;
        box-sizing: border-box;
        padding: 10px 12px;
        border: 1px solid rgba(0, 0, 0, .2);
        border-radius: 8px;
        background: #fff;
        font-size: var(--body-sm-size, 14px);
        line-height: 19px;
        color: var(--text-primary, #000);
        box-shadow: none;
    }
    .onb__input::placeholder { color: var(--text-muted, rgba(0, 0, 0, .4)); }
    .onb__input:focus { border-color: var(--background-navy, #0c2340); box-shadow: 0 0 0 1px var(--background-navy, #0c2340); }
    .onb__suffix { font-size: var(--body-sm-size, 14px); color: var(--text-primary, #000); }
    .onb__step[data-step-id="datos_personales"] .onb__input { padding-block: 10px; }
    .onb__hint--sm { margin: 8px 0 0; font-size: 13px; line-height: 16px; letter-spacing: -.01em; color: var(--text-secondary, rgba(0, 0, 0, .6)); }

    /* opciones (Figma "Project-card-hover" de 448 × 68): beige sin elegir, blanca al elegir */
    .onb__options { gap: 8px; }
    .onb__option-box {
        min-height: 68px;
        box-sizing: border-box;
        padding: 16px;
        gap: 4px;
        border: 1px solid rgba(0, 0, 0, .06);
        border-radius: 8px;
        background: var(--background-subtle, #f8efe7);
        box-shadow: none;
    }
    .onb__option:hover .onb__option-box { border-color: rgba(12, 35, 64, .3); }
    .onb__option input:checked + .onb__option-box { background: #fff; border-color: rgba(12, 35, 64, .35); box-shadow: none; }
    .onb__option-label {
        font-size: var(--ui-card-eyebrow-size, 10px);
        line-height: 13px;
        letter-spacing: .2em;
        text-transform: uppercase;
        font-weight: var(--font-weight-regular, 400);
        color: var(--text-primary, #000);
    }
    .onb__option-sub { margin: 0; font-size: var(--body-sm-size, 14px); line-height: 19px; color: var(--text-primary, #000); }

    /* estancias (filas de 448 × 40 con − valor +) */
    .onb__counters { gap: 4px; }
    .onb__counter {
        min-height: 40px;
        box-sizing: border-box;
        padding: 8px 12px;
        border: 1px solid rgba(12, 35, 64, .12);
        border-radius: 8px;
        background: #fff;
        font-size: var(--body-sm-size, 14px);
        line-height: 19px;
    }
    .onb__counter-controls { gap: 8px; }
    .onb__counter-btn {
        width: 24px; height: 24px;
        border: 1px solid rgba(0, 0, 0, .2);
        border-radius: 999px;
        background: transparent;
        font-size: 14px;
        line-height: 1;
        color: var(--text-primary, #000);
    }
    .onb__counter-value { min-width: 24px; text-align: center; font-size: var(--body-sm-size, 14px); }

    /* casilla: 18px con el borde suave de los campos, radio 4 y visto centrado; texto 13/16 */
    .onb__check { gap: 8px; font-size: 13px; line-height: 16px; align-items: center; }
    .onb__check { gap: 10px; color: var(--text-secondary, rgba(0, 0, 0, .6)); }
    .onb__check input { width: 18px; height: 18px; margin: 0; border: 1px solid rgba(0, 0, 0, .3); border-radius: 4px; background: #fff; }
    .onb__check input:hover { border-color: var(--background-navy, #0c2340); }
    .onb__check input:checked { background: var(--background-navy, #0c2340); border-color: var(--background-navy, #0c2340); }
    /* visto centrado en la casilla de 18 (el del plugin está medido para 20) */
    .onb__check input:checked::after { left: 50%; top: 45%; width: 4px; height: 8px; border-width: 0 1.5px 1.5px 0; transform: translate(-50%, -50%) rotate(45deg); }
    .onb__check a { color: var(--text-primary, #000); text-underline-offset: 2px; }

    /* botones: pill de 44, texto 13 en mayúsculas; "Atrás" 146 y "Continuar" el resto */
    .onb__nav { margin-top: 24px; gap: 8px; }
    .onb__back, .onb__next, .onb__submit {
        height: 44px;
        min-height: 44px;
        padding: 0 24px;
        border-radius: 999px;
        font-family: var(--font-family-title);
        font-size: 13px;
        line-height: 16px;
        font-weight: 500;
        letter-spacing: .08em;
        text-transform: uppercase;
    }
    .onb__next, .onb__submit {
        flex: 1 1 auto;
        display: inline-flex; align-items: center; justify-content: center; gap: 12px;
        background: var(--button-primary-background-default, #0c2340);
        color: #fff;
    }
    /* el isotipo del botón (Figma "Button" primario) */
    .onb__next::before, .onb__submit::before {
        content: "";
        width: 9px; height: 10px; flex: none;
        background: currentColor;
        -webkit-mask: url("../images/isotipo.svg") center / contain no-repeat;
                mask: url("../images/isotipo.svg") center / contain no-repeat;
    }
    .onb__back {
        flex: 0 0 146px;
        background: transparent;
        border: 1px solid var(--background-navy, #0c2340);
        color: var(--background-navy, #0c2340);
    }
    .onb__back:hover { background: var(--background-navy, #0c2340); color: #fff; }
    .onb__back[hidden], .onb__next[hidden], .onb__submit[hidden] { display: none; }

    /* "Datos protegidos" con el candado, centrado bajo los botones */
    .onb__assurances { justify-content: center; margin: 16px 0 0; }
    .onb__assurances li { font-size: 13px; line-height: 16px; letter-spacing: -.01em; color: var(--text-secondary, rgba(0, 0, 0, .6)); gap: 8px; }
    .onb__icon { width: 16px; height: 16px; }
    .onb__volver { display: none; }

    /* valoración (Figma "Rating card"): cristal oscuro de 448 × 38, abajo del todo */
    .onb__panel .onb__social {
        margin: 0;
        align-self: flex-start;
        width: 100%;
        max-width: 448px;
        box-sizing: border-box;
        display: flex; align-items: center; gap: 24px;
        padding: 10px 16px;
        border: 0;
        border-radius: 4px;
        background: var(--glass-background-default, rgba(40, 40, 40, .4));
        -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    }
    .onb__rating { gap: 8px; }
    .onb__rating-score { font-family: var(--font-family-title); font-size: 13px; line-height: 16px; font-weight: 500; letter-spacing: .08em; color: #fff; }
    .onb__stars { gap: 4px; color: #d9ca20; }
    .onb__stars svg { width: 18px; height: 18px; }
    .onb__reviews, .onb__projects { margin: 0; font-size: 10px; line-height: 16px; letter-spacing: 0; color: rgba(255, 255, 255, .8); text-transform: none; }

}

@media (min-width: 1024px) {
    /* ---- columna del vídeo ---- */
    .onb__gallery {
        position: sticky;
        top: 0;
        height: 100vh;
        margin: 0; /* a sangre: sin franja beis arriba, a la derecha ni abajo */
        border-radius: 0; /* Figma: esquinas rectas */
        overflow: hidden;
        background: #fdfdfd; /* el blanco del vídeo */
    }
    .onb-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
}


/* ---- Paso 1: el isotipo como boceto de arquitecto (lo pinta inc/onboarding-2026.php) ----
   Se ve completo desde el primer pintado. La cara de arriba del isotipo coincide con
   el suelo del vídeo (origen 604.5 997.5, coordenadas del vídeo). Al salir del paso 1
   vuelve a escala 1, cae sobre el suelo y se desvanece cuando el suelo real ya está. */
.onb-sketch, body > .onb-video { display: none; }
@media (min-width: 1024px) {
    .onb-sketch { display: block; position: absolute; inset: 0; pointer-events: none; color: #0c2340; }
    /* antes de que el script lo meta en el panel: fijo sobre la columna derecha */
    body > .onb-sketch { position: fixed; left: 554px; top: 0; right: 0; bottom: 0; height: 100vh; z-index: 1; }
    body > .onb-video { display: block; position: fixed; left: 554px; top: 0; right: 0; bottom: 0; width: auto; height: 100vh; z-index: 1; object-fit: cover; background: #fdfdfd; }
    .onb-sketch svg { display: block; width: 100%; height: 100%; overflow: visible; }
    .onb-sketch line, .onb-sketch path { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }

    .onb-sketch .sk-logo {
        transform-box: view-box;
        transform-origin: 604.5px 997.5px;
        transform: translate(10px, -367px) scale(.64);
        transition: transform .5s cubic-bezier(.65, 0, .35, 1) .25s;
    }
    .onb-sketch .sk-grid { opacity: .07; transition: opacity .4s ease .6s; }
    .onb-sketch .sk-top, .onb-sketch .sk-side { stroke-width: 2.6; opacity: .9; transition: opacity .3s ease; }
    .onb-sketch .sk-extras, .onb-sketch__block { opacity: 1; transition: opacity .4s ease .6s; }
    .onb-sketch .sk-c { stroke-width: 1.6; opacity: .3; }
    .onb-sketch .sk-axis { stroke-width: 1.6; opacity: .3; stroke-dasharray: 26 9 4 9; }
    .onb-sketch .sk-h { stroke-width: 2; opacity: .45; stroke-dasharray: 10 10; }
    .onb-sketch .sk-d { stroke-width: 1.8; opacity: .6; }
    .onb-sketch .sk-v { fill: #fdfdfd; stroke: currentColor; stroke-width: 2; }
    .onb-sketch .sk-t {
        fill: currentColor; opacity: .6;
        font-family: var(--font-family-body, sans-serif); font-size: 26px; letter-spacing: .06em;
    }
    .onb-sketch__block {
        position: absolute; right: 24px; bottom: 24px;
        display: flex; border: 1px solid rgba(12, 35, 64, .35);
        font-family: var(--font-family-body, sans-serif); font-size: 10px; line-height: 1;
        letter-spacing: .12em; text-transform: uppercase; color: rgba(12, 35, 64, .65);
    }
    .onb-sketch__block span { padding: 8px 10px; }
    .onb-sketch__block span + span { border-left: 1px solid rgba(12, 35, 64, .35); }

    /* fuera del paso 1: encaja en el suelo del vídeo y se va */
    .onb[data-onb-step]:not([data-onb-step="1"]) .onb-sketch .sk-logo { transform: none; transition-delay: 0s; }
    .onb[data-onb-step]:not([data-onb-step="1"]) .onb-sketch .sk-grid { opacity: 0; transition: opacity .4s ease; }
    .onb[data-onb-step]:not([data-onb-step="1"]) .onb-sketch .sk-top { opacity: 0; transition: opacity .45s ease .75s; }
    .onb[data-onb-step]:not([data-onb-step="1"]) .onb-sketch .sk-side { opacity: 0; transition: opacity .3s ease; }
    .onb[data-onb-step]:not([data-onb-step="1"]) .onb-sketch .sk-extras,
    .onb[data-onb-step]:not([data-onb-step="1"]) .onb-sketch__block { opacity: 0; transition: opacity .25s ease; }
}
@media (min-width: 1024px) and (prefers-reduced-motion: reduce) {
    .onb-sketch *, .onb-sketch { transition: none !important; animation: none !important; }
}

/* ---- Móvil (Figma "Onboarding 01–06" a 390 × 720): título 24/28 a la izquierda,
   línea de progreso con "1/6" debajo, el paso en medio, "Atrás" y "Continuar" en
   una fila y la valoración abajo del todo ---- */
@media (max-width: 1023px) {
    .onb { background: var(--background-page, #fef8f3); padding: 0; }
    .onb__panel {
        min-height: 100vh; min-height: 100svh; box-sizing: border-box;
        display: flex; flex-direction: column; align-items: stretch;
        padding: 20px 13px; gap: 0;
    }
    .onb__header { margin: 0; text-align: left; max-width: none; }
    .onb__eyebrow { display: none; }
    .onb__intro {
        margin: 0; text-align: left;
        font-family: var(--font-family-title); font-size: 24px; line-height: 28px;
        letter-spacing: -0.01em; font-weight: var(--font-weight-regular, 400); color: var(--text-primary, #000);
    }
    .onb__progressbox { margin: 20px 0 0; width: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
    .onb__progress {
        width: 100%; height: 1px; border-radius: 0; overflow: visible;
        background: linear-gradient(rgba(0, 0, 0, .2), rgba(0, 0, 0, .2)) 0 50% / 100% .5px no-repeat;
    }
    .onb__progress-bar { height: 1px; border-radius: 0; background: var(--background-navy, #0c2340); }
    .onb__steps-indicator {
        margin: 0; text-align: left;
        font-size: 9px; line-height: 12px; letter-spacing: .2em; word-spacing: -.25em;
        text-transform: uppercase; color: var(--text-muted, rgba(0, 0, 0, .4));
    }
    .onb__panel .onb__form { max-width: none; padding: 32px 0; }
    .onb__q { margin-bottom: 12px; font-size: 16px; line-height: 20px; }
    /* Safari en iPhone amplía la página al tocar un campo con letra de menos de 16 px
       (y se queda ampliada al pasar de pregunta): en móvil, 16 px */
    .onb__input, .onb input:not([type="radio"]):not([type="checkbox"]), .onb select, .onb textarea { font-size: 16px; }
    /* "Atrás" (146) a la izquierda y "Continuar" ocupa el resto, en la misma fila */
    .onb__nav { margin-top: 16px; flex-direction: row; flex-wrap: nowrap; }
    .onb__back { order: -1; flex: 0 0 146px; width: auto; }
    .onb__next, .onb__submit { width: auto; }
    /* valoración: 4,8 + estrellas, reseñas y proyectos en una sola fila de 44 */
    .onb__panel .onb__social { max-width: none; flex-wrap: nowrap; justify-content: space-between; gap: 12px; padding: 8px; min-height: 44px; }
    .onb__rating { flex-wrap: nowrap; min-width: 0; gap: 8px; }
    .onb__stars { gap: 2px; }
    .onb__stars svg { width: 15px; height: 15px; }
    .onb__reviews, .onb__projects { font-size: 11px; line-height: 14px; max-width: 108px; }
}
