/* ============================================================
   Fuji Cloud — Landing "Midnight Fab"
   Paleta: azul-negro profundo + cobre (trazas PCB) + color del
   tenant (--trace) como pulso de datos.
   Display: Chakra Petch · Body: Inter · Labels: IBM Plex Mono
   ============================================================ */

.landing {
    --ink: #0a0e1a;
    --ink-2: #0e1424;
    --copper: #e8a664;
    --copper-dim: rgba(232, 166, 100, 0.28);
    --copper-faint: rgba(232, 166, 100, 0.10);
    --text: #e5e9f0;
    --muted: #8b94a7;
    --glass: rgba(17, 24, 39, 0.62);
    --hairline: rgba(232, 166, 100, 0.16);

    /* Full-viewport propio: escapa del flex-center + overflow:hidden de body.login-page */
    position: fixed;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background:
        radial-gradient(1200px 700px at 78% 12%, rgba(232, 166, 100, 0.05), transparent 60%),
        radial-gradient(900px 600px at 12% 88%, color-mix(in srgb, var(--trace, #3b82f6) 7%, transparent), transparent 65%),
        var(--ink);
    color: var(--text);
    font-family: 'Inter', system-ui, sans-serif;
    overflow-x: hidden;
}

/* Canvas de trazas PCB — la firma de la página */
#pcb-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.landing > header,
.landing > main,
.landing > footer {
    position: relative;
    z-index: 1;
}

/* ── Header ─────────────────────────────────────────────── */
.landing-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px clamp(20px, 5vw, 64px);
}

.landing-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: 17px;
    letter-spacing: 0.04em;
}

.landing-brand img {
    height: 34px;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(232, 166, 100, 0.35));
}

.landing-signin-btn {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    letter-spacing: 0.06em;
    color: var(--text);
    background: transparent;
    border: 1px solid var(--hairline);
    border-radius: 4px;
    padding: 10px 18px;
    cursor: pointer;
    transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.landing-signin-btn i { margin-left: 8px; font-size: 11px; color: var(--copper); }

.landing-signin-btn:hover {
    border-color: var(--copper);
    background: var(--copper-faint);
    box-shadow: 0 0 24px rgba(232, 166, 100, 0.18);
}

/* ── Hero (asimétrico: identidad a la izquierda, las trazas fluyen a la derecha) ── */
.landing-hero {
    position: relative;
    min-height: calc(100vh - 160px);
    display: flex;
    align-items: center;
    padding: 0 clamp(20px, 5vw, 64px);
}

.hero-copy { position: relative; z-index: 2; max-width: 640px; }

.hero-eyebrow {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.22em;
    color: var(--copper);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 22px;
}

.pad-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 2px solid var(--copper);
    background: var(--ink);
    box-shadow: 0 0 10px rgba(232, 166, 100, 0.6);
}

.landing h1 {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: clamp(46px, 8vw, 96px);
    line-height: 0.98;
    letter-spacing: -0.01em;
    margin: 0 0 26px;
    text-wrap: balance;
}

.landing h1 em {
    font-style: normal;
    color: var(--copper);
    text-shadow: 0 0 34px rgba(232, 166, 100, 0.45);
}

.hero-sub {
    font-size: clamp(16px, 1.6vw, 19px);
    line-height: 1.65;
    color: var(--muted);
    max-width: 470px;
    margin: 0 0 38px;
}

.hero-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

.btn-primary {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.04em;
    color: var(--ink);
    background: var(--copper);
    border: none;
    border-radius: 4px;
    padding: 15px 30px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.25s;
    box-shadow: 0 4px 30px rgba(232, 166, 100, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 42px rgba(232, 166, 100, 0.42);
}

.btn-ghost {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    letter-spacing: 0.05em;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.25s;
}

.btn-ghost:hover { color: var(--copper); }
.btn-ghost i { font-size: 11px; margin-left: 6px; }

/* ── Labels de sección ─────────────────────────────────── */
.section-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.24em;
    color: var(--muted);
    margin: 0 0 28px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--hairline);
}

.module-badge {
    position: absolute;
    top: 18px;
    right: 18px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.14em;
    color: var(--ink);
    background: var(--trace, #3b82f6);
    border-radius: 3px;
    padding: 3px 8px;
    box-shadow: 0 0 14px color-mix(in srgb, var(--trace, #3b82f6) 55%, transparent);
}

/* ── Sakura: cada flor real es un módulo ───────────────── */
.sakura {
    position: absolute;
    right: 0;
    top: 50%;
    width: min(840px, 58vw);
    aspect-ratio: 1448 / 1086;
    z-index: 1;
    transform: translateY(-50%);
    animation: sakura-in 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes sakura-in {
    from { opacity: 0; transform: translateY(calc(-50% + 30px)); }
    to   { opacity: 1; transform: translateY(-50%); }
}

.sakura img {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
    user-select: none;
    filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.55));
}

.bloom {
    position: absolute;
    left: var(--dx);
    top: var(--dy);
    width: 38px;
    height: 38px;
    margin: -19px 0 0 -19px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(232, 166, 100, 0.75);
    background: rgba(10, 14, 26, 0.74);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: var(--copper);
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 3px rgba(10, 14, 26, 0.35), 0 4px 14px rgba(0, 0, 0, 0.6);
    transition: transform 0.25s, border-color 0.25s, box-shadow 0.3s, color 0.25s, font-size 0.25s;
}

.bloom:hover,
.bloom:focus-visible {
    outline: none;
    transform: scale(1.1);
    border-color: var(--trace, #3b82f6);
}

.bloom.active {
    width: 50px;
    height: 50px;
    margin: -25px 0 0 -25px;
    font-size: 20px;
    color: var(--trace, #3b82f6);
    border: 1.5px solid var(--trace, #3b82f6);
    box-shadow:
        0 0 0 6px color-mix(in srgb, var(--trace, #3b82f6) 22%, transparent),
        0 0 30px color-mix(in srgb, var(--trace, #3b82f6) 85%, transparent),
        0 4px 14px rgba(0, 0, 0, 0.6);
}

.bloom.active::after {
    content: '';
    position: absolute;
    inset: -15px;
    border-radius: 50%;
    border: 1px dashed color-mix(in srgb, var(--trace, #3b82f6) 60%, transparent);
    animation: bloom-spin 16s linear infinite;
}

@keyframes bloom-spin { to { transform: rotate(360deg); } }

.bloom-label {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text);
    background: rgba(10, 14, 26, 0.78);
    border: 1px solid rgba(232, 166, 100, 0.35);
    border-radius: 3px;
    padding: 3px 7px;
    pointer-events: none;
    transition: opacity 0.25s;
}

.bloom[data-side="right"] .bloom-label { left: calc(100% + 10px); }
.bloom[data-side="left"] .bloom-label { right: calc(100% + 10px); }
.bloom.active .bloom-label { opacity: 0; }

/* Una sola tarjeta que viaja hasta la flor activa */
.bloom-card {
    position: absolute;
    left: 0;
    top: 0;
    width: 300px;
    box-sizing: border-box;
    padding: 18px 20px 16px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid color-mix(in srgb, var(--trace, #3b82f6) 55%, transparent);
    border-radius: 6px;
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--trace, #3b82f6) 25%, transparent),
        0 12px 40px rgba(0, 0, 0, 0.45);
    z-index: 3;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.35s ease,
        left 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        top 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.bloom-card.show { opacity: 1; }

.bloom-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding-right: 52px;
}

.bloom-card-head i { font-size: 18px; color: var(--copper); }

.bloom-card h3 {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: 17px;
    letter-spacing: 0.03em;
    margin: 0;
}

.bloom-card p {
    font-size: 14px;
    line-height: 1.55;
    color: var(--muted);
    margin: 0 0 12px;
}

.bloom-card-note {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--copper);
}

/* Pantallas angostas: la rama baja bajo el copy (recorte denso de flores) */
@media (max-width: 1099px) {
    .landing-hero {
        flex-direction: column;
        align-items: flex-start;
        min-height: 0;
        padding-top: 30px;
        gap: 30px;
    }

    .sakura {
        position: relative;
        right: auto;
        top: auto;
        width: 100%;
        max-width: 520px;
        aspect-ratio: 928 / 920;
        align-self: center;
        margin-bottom: 190px; /* espacio para la tarjeta a ancho completo */
        transform: none;
        animation-name: sakura-in-flat;
    }

    @keyframes sakura-in-flat {
        from { opacity: 0; transform: translateY(30px); }
        to   { opacity: 1; transform: none; }
    }

    .bloom {
        left: var(--mx);
        top: var(--my);
        width: 32px;
        height: 32px;
        margin: -16px 0 0 -16px;
        font-size: 13px;
    }

    .bloom.active { width: 46px; height: 46px; margin: -23px 0 0 -23px; font-size: 18px; }

    .bloom-label { font-size: 9px; letter-spacing: 0.14em; padding: 2px 6px; }

    .bloom[data-mside="right"] .bloom-label { right: auto; left: calc(100% + 8px); }
    .bloom[data-mside="left"] .bloom-label { left: auto; right: calc(100% + 8px); }
    .bloom[data-mside="bottom"] .bloom-label {
        left: 50%;
        right: auto;
        top: calc(100% + 8px);
        transform: translateX(-50%);
    }

    .bloom-card {
        left: 0 !important;
        top: calc(100% + 26px) !important;
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sakura { animation: none; }
    .bloom.active::after { animation: none; }
    .bloom-card { transition: opacity 0.35s ease; }
}

/* ── Data → Insight → Action ────────────────────────────── */
.landing-flow { padding: 60px clamp(20px, 5vw, 64px) 100px; }

.flow-track {
    display: flex;
    align-items: stretch;
    gap: 0;
    border: 1px solid var(--hairline);
    border-radius: 6px;
    background: rgba(14, 20, 36, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
}

.flow-step { flex: 1; padding: 30px 28px; }

.flow-key {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 21px;
    letter-spacing: 0.14em;
    color: var(--copper);
    display: block;
    margin-bottom: 8px;
}

.flow-step p { margin: 0; font-size: 14px; color: var(--muted); }

.flow-link {
    position: relative;
    width: 1px;
    background: var(--hairline);
}

.flow-pulse {
    position: absolute;
    left: -2px;
    top: 0;
    width: 5px;
    height: 26px;
    border-radius: 3px;
    background: var(--trace, #3b82f6);
    box-shadow: 0 0 12px var(--trace, #3b82f6);
    animation: flow-pulse-down 2.6s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.flow-pulse.delay { animation-delay: 1.3s; }

@keyframes flow-pulse-down {
    0%   { top: -10%; opacity: 0; }
    12%  { opacity: 1; }
    88%  { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* ── Footer ─────────────────────────────────────────────── */
.landing-footer {
    display: flex;
    justify-content: space-between;
    padding: 26px clamp(20px, 5vw, 64px);
    border-top: 1px solid var(--hairline);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--muted);
}

/* ── Reveals ────────────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.in { opacity: 1; transform: none; }

/* ── Auth drawer ────────────────────────────────────────── */
.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(4, 6, 12, 0.6);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.auth-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    width: min(440px, 100vw);
    background: rgba(12, 17, 30, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--hairline, rgba(232, 166, 100, 0.16));
    box-shadow: -30px 0 80px rgba(0, 0, 0, 0.55);
    transform: translateX(105%);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto;
    padding: 56px 30px 30px;
}

.landing.auth-open .auth-overlay { opacity: 1; pointer-events: auto; }
.landing.auth-open .auth-drawer { transform: translateX(0); }

.auth-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    border: 1px solid rgba(232, 166, 100, 0.16);
    background: transparent;
    color: #8b94a7;
    cursor: pointer;
    transition: color 0.25s, border-color 0.25s;
}

.auth-close:hover { color: #e8a664; border-color: #e8a664; }

/* Overrides oscuros del panel de login dentro del drawer (no toca /account/login) */
.landing-auth .login-card {
    background: transparent;
    box-shadow: none;
    border: none;
    padding: 0;
    max-width: none;
    width: 100%;
}

.landing-auth .login-header h1 {
    font-family: 'Chakra Petch', sans-serif;
    color: #e5e9f0;
    font-size: 26px;
}

.landing-auth .login-header p { color: #8b94a7; }

.landing-auth .login-form-label { color: #8b94a7; }

.landing-auth .login-input-group input {
    background: rgba(10, 14, 26, 0.7);
    border-color: rgba(232, 166, 100, 0.18);
    color: #e5e9f0;
}

.landing-auth .login-input-group input:focus {
    border-color: #e8a664;
    box-shadow: 0 0 0 3px rgba(232, 166, 100, 0.15);
}

.landing-auth .login-input-group .input-icon { color: #8b94a7; }

.landing-auth .login-tabs {
    background: rgba(10, 14, 26, 0.7);
    border: 1px solid rgba(232, 166, 100, 0.14);
}

.landing-auth .login-tab { color: #8b94a7; }

.landing-auth .login-tab.active {
    background: rgba(232, 166, 100, 0.14);
    color: #e8a664;
}

.landing-auth .login-divider span { color: #8b94a7; }

.landing-auth .login-footer { color: #566072; }

/* Accesibilidad / focus */
.landing :focus-visible {
    outline: 2px solid var(--copper);
    outline-offset: 2px;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 760px) {
    .landing-hero { min-height: calc(100svh - 140px); }
    .flow-track { flex-direction: column; }
    .flow-link { width: auto; height: 1px; }
    .flow-pulse {
        left: 0;
        top: -2px;
        width: 26px;
        height: 5px;
        animation-name: flow-pulse-right;
    }
    @keyframes flow-pulse-right {
        0%   { left: -10%; opacity: 0; }
        12%  { opacity: 1; }
        88%  { opacity: 1; }
        100% { left: 100%; opacity: 0; }
    }
    .auth-drawer { padding: 56px 20px 24px; }
}

/* ── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .flow-pulse { animation: none; opacity: 0.6; top: 40%; }
    .auth-drawer { transition: none; }
    .btn-primary { transition: none; }
}

/* ── Hitos construidos (carrusel) ───────────────────────── */
/* El chip de trimestre interpola cobre → color del tenant a lo
   largo de los 7 hitos (eco del gradiente cálido→frío del roadmap). */
.landing-milestones { padding: 0 clamp(20px, 5vw, 64px) 90px; }

.carousel {
    position: relative;
    display: flex;
    align-items: stretch;
}

.carousel-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 4px 2px 14px;
    flex: 1;
}

.carousel-track::-webkit-scrollbar { display: none; }

.milestone-card {
    --qmix: color-mix(in srgb, var(--copper) calc((6 - var(--q)) / 6 * 100%), var(--trace, #3b82f6));
    scroll-snap-align: start;
    flex: 0 0 min(320px, 82vw);
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--hairline);
    border-top: 2px solid var(--qmix);
    border-radius: 6px;
    padding: 22px 22px 24px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.milestone-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.milestone-q {
    display: inline-block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--ink);
    background: var(--qmix);
    border-radius: 3px;
    padding: 3px 9px;
    margin-bottom: 14px;
}

.milestone-state {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.18em;
    color: #7ddb9a;
    margin-bottom: 10px;
}

.milestone-state i { font-size: 9px; margin-right: 4px; }

.milestone-card h3 {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: 16.5px;
    line-height: 1.3;
    letter-spacing: 0.02em;
    margin: 0 0 8px;
    color: var(--text);
}

.milestone-card p {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--muted);
    margin: 0;
}

.carousel-btn {
    align-self: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 4px;
    border: 1px solid var(--hairline);
    background: rgba(14, 20, 36, 0.7);
    color: var(--copper);
    cursor: pointer;
    transition: border-color 0.25s, background 0.25s;
    z-index: 2;
}

.carousel-btn:hover { border-color: var(--copper); background: var(--copper-faint); }
.carousel-btn.prev { margin-right: 10px; }
.carousel-btn.next { margin-left: 10px; }

/* Riel de progreso tipo línea de producción */
.carousel-rail {
    position: relative;
    height: 2px;
    margin: 6px 52px 0;
    background: var(--hairline);
    border-radius: 1px;
    overflow: hidden;
}

.carousel-rail::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--rail-progress, 14%);
    background: linear-gradient(90deg, var(--copper), var(--trace, #3b82f6));
    transition: width 0.4s ease;
}

@media (max-width: 760px) {
    .carousel-btn { display: none; }
    .carousel-rail { margin: 6px 2px 0; }
}
