:root {
    --bg: #070b18;
    --surface: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --text: #eef2fb;
    --text-2: #a3adc2;
    --text-3: #6b768d;
    --accent: #6e96ff;
    --accent-soft: rgba(110, 150, 255, 0.12);
    --radius: 16px;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ---------- Fondo ---------- */

.bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(180deg, #0a1024 0%, #070b18 55%, #05070f 100%);
}

.bg-glow {
    position: absolute;
    top: -30vh;
    left: 50%;
    width: 120vw;
    height: 80vh;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, rgba(70, 110, 255, 0.16), transparent 65%);
}

.bg-scene {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: #fff;
    animation: float ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(var(--dx), var(--dy)); }
}

/* ---------- Layout ---------- */

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px 260px;
    text-align: center;
    animation: enter 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes enter {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Marca ---------- */

.brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 18px;
    margin-bottom: 120px;
}

.brand-logo {
    width: auto;
    height: clamp(48px, 6vw, 60px);
}

.brand-name {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    line-height: 1;
}

.brand-title {
    font-size: clamp(26px, 3.4vw, 34px);
    font-weight: 600;
    letter-spacing: -0.03em;
}

.brand-title strong {
    font-weight: 600;
    color: var(--accent);
}

.brand-domain {
    margin-top: 6px;
    padding-left: 2px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.24em;
    color: var(--text-3);
}

/* ---------- Cuenta atrás ---------- */

.countdown {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 640px;
}

.unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 28px 12px 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: border-color 0.3s ease;
}

.unit:hover {
    border-color: var(--border-strong);
}

.value {
    font-size: clamp(36px, 6vw, 56px);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-3);
}

.quota {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 640px;
    margin-top: 28px;
}

.quota-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0 2px;
}

.quota-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-3);
}

.quota-value {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    color: var(--text-2);
}

.quota-bar {
    width: 100%;
    height: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.quota-bar span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(110, 150, 255, 0.5), var(--accent));
    transition: width 0.6s ease;
}

/* ---------- Icono de ajustes (pentágono) ---------- */

.settings-btn {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 10;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-3);
    opacity: 0.35;
    cursor: pointer;
    transition: opacity 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.settings-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
    stroke-linejoin: round;
}

.settings-btn:hover,
.settings-btn:focus-visible {
    opacity: 1;
    color: var(--accent);
    background: rgba(255, 255, 255, 0.04);
}

.settings-btn:focus-visible {
    outline: 1px solid var(--border-strong);
}

/* ---------- Modal ---------- */

.modal {
    margin: auto;
    width: min(420px, calc(100% - 32px));
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: #0c1227;
    color: var(--text);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.modal::backdrop {
    background: rgba(3, 5, 12, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal[open] {
    animation: modal-in 0.2s ease both;
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(6px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 26px 24px 22px;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.modal-text {
    margin-top: -10px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-2);
}

.field-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 12px;
}

.field-input option {
    background: #0c1227;
    color: var(--text);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-3);
}

.field-input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    color-scheme: dark;
}

.field-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-hint {
    margin-top: -8px;
    min-height: 1em;
    font-size: 12px;
    color: var(--text-3);
}

.field-hint::first-letter {
    text-transform: uppercase;
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.modal-spacer {
    flex: 1;
}

.btn {
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-ghost {
    background: transparent;
    color: var(--text-2);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.btn-primary {
    background: var(--accent);
    color: #0a1024;
}

.btn-primary:hover {
    background: #85a7ff;
}

/* ---------- Footer ---------- */

.footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(5, 7, 15, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 12px;
    color: var(--text-3);
}

.footer-legal {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* ---------- Carrusel de logos IA ---------- */

.ai-marquee {
    --logo: 60px;
    --logo-gap: 80px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 96px;
    overflow: hidden;
    pointer-events: none;
    /* Difumina los extremos para que los logos entren y salgan suavemente */
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}

/* Dos copias idénticas: al desplazar -50% la segunda ocupa el sitio de la
   primera y el bucle no tiene salto. min-width evita huecos en pantallas anchas. */
.ai-track {
    display: flex;
    width: max-content;
    animation: marquee 40s linear infinite;
}

.ai-logos {
    display: flex;
    flex-shrink: 0;
    justify-content: space-around;
    gap: var(--logo-gap);
    min-width: 100vw;
    padding-right: var(--logo-gap);
    list-style: none;
}

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.ai-logo {
    display: flex;
    color: #fff;
    pointer-events: auto;
}

.ai-logo svg {
    width: var(--logo);
    height: var(--logo);
    fill: currentColor;
    opacity: 0.16;
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.ai-logo:hover svg {
    opacity: 0.45;
    filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.3));
}

/* ---------- Móvil ---------- */

@media (max-width: 560px) {
    .brand { margin-bottom: 80px; }
    .countdown { gap: 8px; }
    .unit { padding: 18px 4px 14px; gap: 8px; border-radius: 12px; }
    .value { font-size: clamp(26px, 9vw, 36px); }
    .label { font-size: 9px; letter-spacing: 0.1em; }
    .footer { gap: 12px; font-size: 11px; padding: 14px 16px; }
    .footer-legal { flex-direction: column; align-items: center; gap: 2px; }
    .ai-marquee { --logo: 44px; --logo-gap: 44px; bottom: 92px; }
    .ai-track { animation-duration: 28s; }
    .footer-sep { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .page, .particle, .modal[open], .ai-track { animation: none; }
}
