/* =========================================================
   TAAF Logistics — Landings de campaña (/laredo/, /michigan/, /california/)
   Complementa css/styles.css del sitio principal. Mismos
   tokens: navy #111E63, bg-elevated #0b1437, accent-blue
   #3b82f6, accent-cyan #55C2E3, Montserrat.
   ========================================================= */

html { scroll-behavior: smooth; }
main { overflow-x: hidden; }
.grid > * { min-width: 0; }
.material-symbols-outlined { overflow: hidden; max-width: 100%; }

/* Tarjeta estándar (igual a los pasos del home) */
.tl-card {
    background: #0a1240;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 1rem;
    padding: 2rem;
    height: 100%;
    transition: border-color .2s ease, transform .2s ease;
}
.tl-card:hover { border-color: rgba(85, 194, 227, .4); transform: translateY(-3px); }

/* =========================================================
   FORMULARIO — mismo look que el formulario del sitio.
   Se usa :is(#leadForm, .tl-form) para ganarle al plugin @tailwindcss/forms,
   que pone fondo blanco a los inputs.
   ========================================================= */
:is(#leadForm, .tl-form) .tl-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: .45rem;
}
:is(#leadForm, .tl-form) .tl-input {
    display: block;
    width: 100%;
    min-height: 48px;
    background-color: #0d0f1a;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: .5rem;
    padding: .75rem 1rem;
    color: #fff;
    font-family: inherit;
    font-size: .9rem;
    line-height: 1.4;
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
:is(#leadForm, .tl-form) textarea.tl-input { min-height: 120px; }
:is(#leadForm, .tl-form) .tl-input:hover { border-color: rgba(255, 255, 255, .25); }
:is(#leadForm, .tl-form) .tl-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .25);
    background-color: #10131f;
}
/* El sitio pone placeholders en blanco sólido; aquí se atenúan para distinguirlos del texto escrito */
:is(#leadForm, .tl-form) .tl-input::placeholder { color: rgba(255, 255, 255, .35) !important; opacity: 1 !important; }
:is(#leadForm, .tl-form) .tl-input::-webkit-input-placeholder { color: rgba(255, 255, 255, .35) !important; }

:is(#leadForm, .tl-form) .tl-select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2355C2E3' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px 10px;
    padding-right: 2.75rem;
}
:is(#leadForm, .tl-form) .tl-select.is-empty { color: rgba(255, 255, 255, .35); }
:is(#leadForm, .tl-form) .tl-select option { background: #0b1437; color: #fff; }

/* Estados de validación */
:is(#leadForm, .tl-form) .tl-error {
    margin-top: .4rem;
    font-size: 11px;
    line-height: 1.3;
    color: #f87171;
    display: flex;
    align-items: center;
    gap: .35rem;
}
:is(#leadForm, .tl-form) .tl-error.hidden { display: none; }
:is(#leadForm, .tl-form) .tl-error::before {
    content: "!";
    flex: none;
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    font-size: 9px; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
}
:is(#leadForm, .tl-form) .is-invalid .tl-input,
:is(#leadForm, .tl-form) .is-invalid .tl-input:focus { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .18); }
:is(#leadForm, .tl-form) .is-valid .tl-input { border-color: rgba(34, 197, 94, .45); }

/* Selector segmentado (Ámbito / Seguro) */
:is(#leadForm, .tl-form) .tl-seg {
    position: relative;
    display: flex;
    gap: 4px;
    min-height: 48px;
    background: #0d0f1a;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: .5rem;
    padding: 4px;
}
:is(#leadForm, .tl-form) .tl-seg input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px; height: 1px;
    margin: 0;
    pointer-events: none;
}
:is(#leadForm, .tl-form) .tl-seg label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: .5rem .25rem;
    border-radius: .375rem;
    font-size: .8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .7);
    cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s;
    user-select: none;
}
:is(#leadForm, .tl-form) .tl-seg label:hover { color: #fff; background: rgba(255, 255, 255, .06); }
:is(#leadForm, .tl-form) .tl-seg input:checked + label { background: #3b82f6; color: #fff; box-shadow: 0 0 14px rgba(45, 99, 242, .45); }
:is(#leadForm, .tl-form) .tl-seg input:focus-visible + label { outline: 2px solid #55C2E3; outline-offset: 1px; }

/* ---------- FAQ ---------- */
.tl-faq {
    background: #0a1240;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: .75rem;
    transition: border-color .2s;
}
.tl-faq[open] { border-color: rgba(85, 194, 227, .4); }
.tl-faq summary {
    cursor: pointer;
    list-style: none;
    padding: 1.25rem 1.5rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.tl-faq summary::-webkit-details-marker { display: none; }
.tl-faq summary::after { content: "+"; font-size: 1.5rem; line-height: 1; color: #55C2E3; transition: transform .2s; }
.tl-faq[open] summary::after { transform: rotate(45deg); }
.tl-faq p { padding: 0 1.5rem 1.5rem; color: rgba(255, 255, 255, .7); font-size: .9rem; line-height: 1.7; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .route-line { animation: none; }
}

/* ---------- Indicadores del panel de rutas (+25 / +5,000 / 98%) ----------
   El número se escala al ancho de su tarjeta (container queries) para que
   nunca se salga del cuadro, con cualquier fuente o ancho de pantalla. */
.tl-metric-card { container-type: inline-size; min-width: 0; overflow: hidden; }
.tl-metric {
    font-size: clamp(1.05rem, 26cqi, 1.875rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

/* =========================================================
   HERO A/B/C — prueba de variantes en /michigan/ y /california/
   La variante activa se marca en <html data-hero="a|b|c|0">.
   ========================================================= */
.tl-hero h1 { text-wrap: balance; }
.tl-hero-a {
    background:
        radial-gradient(ellipse 70% 60% at 85% 20%, rgba(45, 99, 242, .22), transparent 70%),
        linear-gradient(180deg, #111E63 0%, #0a102b 100%);
}
.tl-hero-b {
    background:
        radial-gradient(ellipse 60% 50% at 50% 0%, rgba(45, 99, 242, .25), transparent 70%),
        #050a1f;
}
.tl-hero-c-overlay {
    background: linear-gradient(90deg, rgba(5, 10, 31, .94) 0%, rgba(10, 18, 64, .86) 55%, rgba(10, 18, 64, .6) 100%);
}
@media (max-width: 767px) {
    .tl-hero-c-overlay { background: linear-gradient(180deg, rgba(5, 10, 31, .88) 0%, rgba(10, 18, 64, .92) 100%); }
}

/* Paso del formulario del hero */
.tl-form fieldset[hidden] { display: none; }
.tl-step-enter { animation: tlStepIn .25s ease; }
@keyframes tlStepIn { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }

/* Chips de ruta (hero B) */
.tl-route-chip {
    min-height: 56px;
    background: rgba(11, 20, 55, .92);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 10px;
    transition: border-color .15s, background-color .15s, transform .15s;
}
.tl-route-chip:hover { border-color: rgba(85, 194, 227, .6); background: rgba(26, 43, 138, .9); }
.tl-route-chip:focus-visible { outline: 2px solid #55C2E3; outline-offset: 2px; }
.tl-route-chip.is-import { border-style: dashed; border-color: rgba(85, 194, 227, .5); }

/* CTA fijo en mobile (hero C) */
.tl-sticky-cta { transform: translateY(110%); transition: transform .25s ease; }
.tl-sticky-cta.is-visible { transform: none; }
@media (max-width: 767px) {
    html[data-hero="c"] .tl-floating,
    html.tl-hq-in-view .tl-floating { display: none; }
    html[data-hero="c"] body { padding-bottom: 76px; }
}
/* En C la barra de confianza del hero ya muestra las certificaciones */
html[data-hero="c"] #certificaciones { display: none; }

@media (prefers-reduced-motion: reduce) {
    .tl-step-enter { animation: none; }
    .tl-sticky-cta { transition: none; }
}

/* =========================================================
   IMAGEN DEL HERO POR LANDING (misma foto en todas las variantes
   para que la prueba A/B compare sólo el layout)
   --hero-pos / --hero-pos-m: encuadre en desktop / mobile
   ========================================================= */
body[data-landing="laredo"]     { --hero-img: url('/assets/laredo-hero2.webp');     --hero-pos: 50% 75%; --hero-pos-m: 50% 85%; }
body[data-landing="michigan"]   { --hero-img: url('/assets/michigan-hero2.webp');   --hero-pos: 50% 40%; --hero-pos-m: 80% 40%; }
body[data-landing="california"] { --hero-img: url('/assets/california-hero3.webp'); --hero-pos: 70% 50%; --hero-pos-m: 72% 50%; }

/* Hero original (laredo y control ?hero=0) */
body[data-landing] .hero-gradient-home {
    background:
        linear-gradient(90deg, rgba(10, 15, 40, .9) 0%, rgba(10, 15, 40, .72) 50%, rgba(10, 15, 40, .5) 100%),
        var(--hero-img) var(--hero-pos) / cover no-repeat,
        #0a102b;
}
/* A: foto de fondo con velo navy (texto + tarjeta encima) */
.tl-hero-a {
    background:
        linear-gradient(90deg, rgba(10, 16, 43, .92) 0%, rgba(13, 22, 70, .78) 55%, rgba(10, 16, 43, .7) 100%),
        var(--hero-img) var(--hero-pos) / cover no-repeat,
        #0a102b;
}
/* B: la foto vive detrás del texto centrado y se funde a sólido antes del mapa */
.tl-hero-b {
    background:
        linear-gradient(180deg, rgba(5, 10, 31, .55) 0%, rgba(5, 10, 31, .72) 38%, #050a1f 62%),
        var(--hero-img) center top / 100% auto no-repeat,
        #050a1f;
}
/* C */
.tl-hero-img { object-position: var(--hero-pos); }
@media (max-width: 767px) {
    body[data-landing] .hero-gradient-home {
        background:
            linear-gradient(180deg, rgba(10, 15, 40, .82) 0%, rgba(10, 15, 40, .9) 100%),
            var(--hero-img) var(--hero-pos-m) / cover no-repeat,
            #0a102b;
    }
    .tl-hero-a {
        background:
            linear-gradient(180deg, rgba(10, 16, 43, .8) 0%, rgba(10, 16, 43, .94) 45%),
            var(--hero-img) var(--hero-pos-m) / cover no-repeat,
            #0a102b;
    }
    .tl-hero-b {
        background:
            linear-gradient(180deg, rgba(5, 10, 31, .7) 0%, rgba(5, 10, 31, .85) 40%, #050a1f 60%),
            var(--hero-img) var(--hero-pos-m) / auto 520px no-repeat,
            #050a1f;
    }
    .tl-hero-img { object-position: var(--hero-pos-m); }
}
