/* ============================================================================
   TAO Solutions — Landing Sistema BESS
   Estilos custom que Tailwind CDN no resuelve por sí solo.
   ============================================================================ */

:root {
    --brand:      #80AA45;
    --brand-dark: #689030;
    --ink:        #10271D;
    --body:       #54655E;
    --muted:      #708079;
    --mist:       #E7F0E9;
    --cloud:      #FAFCFA;
    --line:       #BFCBC2;
    --ember:      #E65E36;
    --forest:     #0B2A1C;
}

/* ── Base ────────────────────────────────────────────────────────────────── */

html {
    scroll-behavior: smooth;
    scroll-padding-top: 88px; /* compensa el header sticky al saltar a anclas */
}

body {
    color: var(--body);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}
.material-symbols-outlined.fill {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

::selection { background: var(--brand); color: #fff; }

/* Resalte de keywords dentro de los "ejemplo simple" de Load Shifting / Peak Shaving */
.bess-example mark {
    background: rgba(128, 170, 69, 0.16);
    color: var(--brand-dark);
    font-weight: 600;
    border-radius: 4px;
    padding: 0.05em 0.35em;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

/* Acento decorativo: fondo de puntos sutiles */
.dot-grid {
    background-image: radial-gradient(rgba(16, 39, 29, 0.06) 1px, transparent 1px);
    background-size: 26px 26px;
}

/* Degradado suave verde para secciones de respiro */
.mist-fade {
    background: linear-gradient(180deg, #ffffff 0%, var(--mist) 100%);
}

/* Tarjetas con sombra suave de marca */
.card-soft {
    box-shadow: 0 1px 2px rgba(16, 39, 29, 0.04), 0 12px 32px -12px rgba(16, 39, 29, 0.12);
}

/* ── Carrusel de logos de clientes (marquee) ─────────────────────────────── */
.marquee {
    position: relative;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
}
.marquee-track {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    width: max-content;
    animation: marquee 48s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
.logo-chip {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 96px;
    width: 184px;
    padding: 0 1.6rem;
    background: #fff;
    border: 1px solid rgba(191, 203, 194, 0.55);
    border-radius: 20px;
    box-shadow: 0 8px 22px -14px rgba(16, 39, 29, 0.25);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.logo-chip:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px -14px rgba(16, 39, 29, 0.30);
}
.logo-chip img {
    max-height: 48px;
    max-width: 124px;
    width: auto;
    object-fit: contain;
}
@media (prefers-reduced-motion: reduce) {
    .marquee { -webkit-mask-image: none; mask-image: none; }
    .marquee-track { animation: none; flex-wrap: wrap; justify-content: center; width: auto; }
    .marquee-dup { display: none; }
}

/* ── Modal: recibo CFE de ejemplo (paso 3 del formulario) ────────────────── */
.recibo-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.recibo-modal[hidden] { display: none; }
.recibo-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 39, 29, 0.55);
    -webkit-backdrop-filter: blur(2px);
            backdrop-filter: blur(2px);
}
.recibo-modal__dialog {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 20px;
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    padding: 24px;
    box-shadow: 0 24px 60px -20px rgba(16, 39, 29, 0.45);
    animation: reciboIn 0.25s ease both;
}
@keyframes reciboIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}
.recibo-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--mist);
    color: var(--ink);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.recibo-modal__close:hover { background: var(--line); }
.recibo-modal__imgwrap {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}
.recibo-modal__imgwrap img { display: block; width: 100%; height: auto; }
@media (prefers-reduced-motion: reduce) { .recibo-modal__dialog { animation: none; } }
body.modal-open { overflow: hidden; }

/* ── Visualizador Load Shifting / Peak Shaving ───────────────────────────── */
.load-viz {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 1px 2px rgba(16, 39, 29, 0.04), 0 18px 44px -20px rgba(16, 39, 29, 0.14);
}
.load-viz__head {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 18px;
}
.load-viz__head p { max-width: 540px; }
.load-viz__toggle {
    display: inline-flex;
    background: var(--mist);
    border-radius: 999px;
    padding: 4px;
    flex-shrink: 0;
}
.load-viz__toggle button {
    border: 0;
    background: none;
    padding: 8px 18px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    color: var(--body);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.load-viz__toggle button.is-active {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 2px 8px -2px rgba(104, 144, 48, 0.5);
}
.load-viz__svg { width: 100%; height: auto; display: block; }
.load-viz__svg path { transition: fill 0.3s ease; }
.load-viz__legend {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--muted);
}
.load-viz__legend li { display: flex; align-items: center; }
.load-viz__legend .dot {
    width: 11px; height: 11px; border-radius: 3px;
    display: inline-block; margin-right: 7px;
}
.dot-base  { background: rgba(128, 170, 69, 0.55); }
.dot-inter { background: rgba(230, 166, 54, 0.65); }
.dot-punta { background: rgba(230, 94, 54, 0.65); }
.load-viz__stat {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--mist);
}
.load-viz__statlbl { font-size: 15px; color: var(--ink); line-height: 1.4; }
.load-viz__note { font-size: 12px; color: var(--muted); margin-top: 12px; }

/* ── FAQ / details ───────────────────────────────────────────────────────── */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details[open] .faq-icon { transform: rotate(180deg); }
.faq-icon { transition: transform 0.25s ease; }

/* ── Reset de inputs para look consistente ───────────────────────────────── */
input, select, textarea {
    -webkit-appearance: none;
    appearance: none;
}
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2354655e' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 18px;
    padding-right: 2.75rem;
}

/* ── Animaciones de scroll (respeta prefers-reduced-motion) ──────────────── */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.6s ease, transform 0.6s ease;
        will-change: opacity, transform;
    }
    .reveal.is-visible {
        opacity: 1;
        transform: translateY(0);
    }
    .reveal-stagger > * {
        opacity: 0;
        transform: translateY(18px);
        transition: opacity 0.5s ease, transform 0.5s ease;
    }
    .reveal-stagger.is-visible > * {
        opacity: 1;
        transform: translateY(0);
    }
    .reveal-stagger.is-visible > *:nth-child(1) { transition-delay:   0ms; }
    .reveal-stagger.is-visible > *:nth-child(2) { transition-delay:  70ms; }
    .reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 140ms; }
    .reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 210ms; }
    .reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 280ms; }
    .reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 350ms; }
    .reveal-stagger.is-visible > *:nth-child(7) { transition-delay: 420ms; }
    .reveal-stagger.is-visible > *:nth-child(8) { transition-delay: 490ms; }
    .reveal-stagger.is-visible > *:nth-child(9) { transition-delay: 560ms; }
}

/* ============================================================================
   FORMULARIO MULTIETAPA (precalificación BESS)
   ============================================================================ */

/* Pasos: solo el activo es visible */
.form-step { display: none; }
.form-step.is-active {
    display: block;
    animation: stepIn 0.4s ease both;
}
@media (prefers-reduced-motion: reduce) {
    .form-step.is-active { animation: none; }
}
@keyframes stepIn {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Barra de progreso */
.progress-track {
    height: 6px;
    background: var(--mist);
    border-radius: 999px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--brand);
    border-radius: 999px;
    width: 20%;
    transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Puntos de paso (stepper) */
.step-dot {
    width: 34px; height: 34px;
    border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 14px;
    background: #fff;
    color: var(--muted);
    border: 2px solid var(--line);
    transition: all 0.3s ease;
}
.step-dot.is-active { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(128,170,69,0.18); }
.step-dot.is-done   { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Tarjetas de opción (radio/checkbox como tarjeta seleccionable) */
.option-card {
    display: flex; align-items: center; gap: 0.85rem;
    padding: 1rem 1.15rem;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.option-card:hover { border-color: var(--brand); }
.option-card input { position: absolute; opacity: 0; pointer-events: none; }
.option-card .option-mark {
    flex-shrink: 0;
    width: 22px; height: 22px;
    border: 2px solid var(--line);
    border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
}
.option-card.is-checkbox .option-mark { border-radius: 6px; }
.option-card:has(input:checked),
.option-card.is-selected {
    border-color: var(--brand);
    background: rgba(128, 170, 69, 0.07);
    box-shadow: 0 0 0 1px var(--brand);
}
.option-card:has(input:checked) .option-mark,
.option-card.is-selected .option-mark {
    border-color: var(--brand);
    background: var(--brand);
}
.option-card:has(input:checked) .option-mark::after,
.option-card.is-selected .option-mark::after {
    content: '';
    width: 8px; height: 8px;
    border-radius: inherit;
    background: #fff;
}

/* Inputs de texto del formulario */
.fc-input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font-size: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.fc-input::placeholder { color: #9aa8a1; }
.fc-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(128, 170, 69, 0.18);
}

/* Zona de subida de archivo (recibo CFE) */
.fc-upload {
    border: 1.5px dashed var(--line);
    border-radius: 14px;
    padding: 1.5rem;
    text-align: center;
    background: var(--cloud);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.fc-upload:hover { border-color: var(--brand); background: rgba(128, 170, 69, 0.05); }
.fc-upload.has-file { border-color: var(--brand); border-style: solid; }

/* ── Validación de campos ────────────────────────────────────────────────── */
.field-invalid {
    border-color: #e11d48 !important;
    box-shadow: 0 0 0 3px rgba(225, 29, 48, 0.15) !important;
}
.option-group.field-invalid {
    border: none !important;
    box-shadow: none !important;
}
.field-error-msg {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
    font-weight: 500;
    color: #e11d48;
}

/* ── Utilidad: ocultar visualmente pero accesible ───────────────────────── */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
