/* =========================================================
   Memor-IQ Drive · estilos globales (landing + componentes)
   Diseño oscuro, responsive y con botones modernos
   ========================================================= */
:root {
    --bg: #0a1020;
    --bg-2: #0e1730;
    --surface: #131c36;
    --surface-2: #1a2543;
    --line: rgba(148, 163, 184, .16);
    --text: #f1f5f9;
    --muted: #94a3b8;
    --brand: #f97316;
    --brand-2: #fb923c;
    --blue: #3b82f6;
    --violet: #8b5cf6;
    --ok: #22c55e;
    --bad: #ef4444;
    --radius: 16px;
    --shadow: 0 18px 50px rgba(0, 0, 0, .45);
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: radial-gradient(1100px 600px at 80% -10%, rgba(59, 130, 246, .18), transparent 60%),
                radial-gradient(900px 500px at 0% 0%, rgba(249, 115, 22, .12), transparent 55%),
                var(--bg);
    background-attachment: scroll;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img, svg { max-width: 100%; }
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid rgba(59, 130, 246, .6); outline-offset: 2px; }

/* ---------- Botones ---------- */
.btn-primary, .btn-auth, .btn-ghost, .btn-cookie-accept {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 0; border-radius: 12px; padding: .8rem 1.4rem; font-weight: 700; font-size: 1rem;
    text-decoration: none; line-height: 1.2; white-space: nowrap;
    transition: transform .12s ease, box-shadow .2s ease, filter .2s ease, background .2s ease;
    -webkit-tap-highlight-color: transparent;
}
.btn-primary {
    background: linear-gradient(135deg, var(--brand), #ea580c); color: #fff;
    box-shadow: 0 10px 28px rgba(249, 115, 22, .35);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 14px 34px rgba(249, 115, 22, .45); }
.btn-primary:active, .btn-auth:active, .btn-ghost:active { transform: translateY(0) scale(.98); }
.btn-auth {
    background: rgba(255, 255, 255, .08); color: var(--text); border: 1px solid var(--line);
    padding: .6rem 1.1rem; font-size: .95rem;
}
.btn-auth:hover { background: rgba(255, 255, 255, .14); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: rgba(255, 255, 255, .07); }
.btn-cookie-accept { background: var(--blue); color: #fff; padding: .6rem 1.1rem; font-size: .9rem; }
.btn-cookie-accept:hover { filter: brightness(1.1); }
.full-width { width: 100%; }

/* ---------- Navegación ---------- */
.navbar {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: .8rem max(20px, 6vw);
    background: rgba(10, 16, 32, .72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.logo { display: inline-flex; align-items: center; gap: 10px; font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; text-decoration: none; }
.logo b, .logo span b { color: var(--brand); font-weight: 800; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--brand), var(--violet)); }
.logo.small { font-size: 1.1rem; } .logo.small .logo-mark { width: 28px; height: 28px; border-radius: 8px; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-link { color: var(--muted); text-decoration: none; padding: .5rem .8rem; border-radius: 10px; font-weight: 600; font-size: .95rem; transition: color .2s, background .2s; }
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.nav-links .btn-auth { margin-left: 8px; }

/* ---------- Secciones ---------- */
.eyebrow { display: inline-block; font-size: .82rem; font-weight: 700; letter-spacing: .04em; color: var(--brand-2); background: rgba(249, 115, 22, .12); border: 1px solid rgba(249, 115, 22, .25); padding: .3rem .8rem; border-radius: 999px; }
.section-head { text-align: center; margin-bottom: 2.2rem; }
.section-head h2, .how-it-works h2, .features h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: -.02em; margin-top: .8rem; }

.hero {
    display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center;
    padding: clamp(2.5rem, 7vw, 6rem) max(20px, 6vw);
    max-width: 1280px; margin: 0 auto;
}
.hero-content h1 { font-size: clamp(2.2rem, 5.6vw, 4rem); line-height: 1.05; letter-spacing: -.035em; margin: 1rem 0 1.1rem; }
.grad { background: linear-gradient(90deg, var(--brand), #f472b6 60%, var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-content p { color: var(--muted); font-size: clamp(1rem, 2.2vw, 1.2rem); max-width: 560px; margin-bottom: 1.8rem; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-points { list-style: none; display: flex; gap: 8px 22px; flex-wrap: wrap; margin-top: 1.6rem; color: var(--muted); font-size: .92rem; }

.hero-visual { display: flex; justify-content: center; }
.mock { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 16px; box-shadow: var(--shadow); transform: rotate(1.5deg); }
.mock-bar { display: flex; align-items: center; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: #475569; } .mock-bar i:first-child { background: #ef4444; } .mock-bar i:nth-child(2) { background: #f59e0b; } .mock-bar i:nth-child(3) { background: #22c55e; }
.mock-bar span { margin-left: 8px; }
.mock-meter { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); margin: 14px 0; overflow: hidden; }
.mock-meter div { width: 38%; height: 100%; background: linear-gradient(90deg, var(--blue), var(--violet)); border-radius: 99px; }
.mock-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mock-card { aspect-ratio: 1; border-radius: 14px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 1.6rem; position: relative; overflow: hidden; }
.mock-card b { font-size: .68rem; font-weight: 600; color: var(--muted); position: absolute; left: 8px; right: 8px; bottom: 7px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mock-card.img1 { background: linear-gradient(160deg, #38bdf8, #1d4ed8); } .mock-card.img2 { background: linear-gradient(160deg, #f472b6, #7c3aed); } .mock-card.img3 { background: linear-gradient(160deg, #fb923c, #be185d); }
.mock-card.img1 b, .mock-card.img2 b, .mock-card.img3 b { color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, .4); }

.how-it-works, .features { padding: clamp(2.5rem, 6vw, 5rem) max(20px, 6vw); max-width: 1280px; margin: 0 auto; }
.steps-container, .grid-features { display: grid; gap: 18px; }
.steps-container { grid-template-columns: repeat(3, 1fr); }
.grid-features { grid-template-columns: repeat(3, 1fr); }
.step, .card { background: linear-gradient(180deg, var(--surface), rgba(19, 28, 54, .7)); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; transition: transform .2s, border-color .2s; }
.card:hover, .step:hover { transform: translateY(-3px); border-color: rgba(249, 115, 22, .35); }
.step-number { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; background: linear-gradient(135deg, var(--brand), #ea580c); margin-bottom: 1rem; }
.ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; background: rgba(255, 255, 255, .06); margin-bottom: 1rem; }
.step h3, .card h3 { font-size: 1.1rem; margin-bottom: .4rem; }
.step p, .card p { color: var(--muted); font-size: .95rem; }

.capotis-band { margin: clamp(1.5rem, 4vw, 3rem) max(20px, 6vw) clamp(2.5rem, 6vw, 5rem); }
.capotis-inner { max-width: 1000px; margin: 0 auto; text-align: center; padding: clamp(2rem, 5vw, 3.5rem) clamp(1.2rem, 4vw, 3rem); border-radius: 28px; border: 1px solid var(--line); background: linear-gradient(135deg, rgba(59, 130, 246, .22), rgba(139, 92, 246, .18) 55%, rgba(249, 115, 22, .16)); }
.capotis-inner h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); letter-spacing: -.02em; margin: .9rem 0 .6rem; }
.capotis-inner p { color: #cbd5e1; max-width: 640px; margin: 0 auto 1.6rem; }

.site-footer { border-top: 1px solid var(--line); padding: 2rem max(20px, 6vw); display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; justify-content: space-between; color: var(--muted); font-size: .9rem; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { text-decoration: none; } .footer-links a:hover { color: var(--text); }

/* ---------- Modal de acceso ---------- */
.modal { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(5, 8, 18, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.modal-content { position: relative; width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 1.6rem; box-shadow: var(--shadow); animation: pop .22s ease; margin: auto; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.close-modal { position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; color: var(--muted); cursor: pointer; transition: background .2s, color .2s; }
.close-modal:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.modal-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: rgba(255, 255, 255, .05); padding: 4px; border-radius: 12px; margin: 6px 36px 1.3rem 0; }
.tab-btn { border: 0; background: transparent; color: var(--muted); padding: .6rem; border-radius: 9px; font-weight: 700; font-size: .95rem; transition: background .2s, color .2s; }
.tab-btn.active { background: var(--surface-2); color: var(--text); box-shadow: 0 1px 6px rgba(0, 0, 0, .3); }
.input-group { margin-bottom: 1rem; text-align: left; }
.input-group label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input-group input, .input-group select {
    width: 100%; padding: .85rem 1rem; font-size: 1rem; border-radius: 12px;
    background: rgba(255, 255, 255, .06); border: 1px solid var(--line); color: var(--text); outline: none; transition: border-color .2s, box-shadow .2s;
}
.input-group input::placeholder { color: #64748b; }
.input-group input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(59, 130, 246, .2); }
.input-group input[type="date"] { color-scheme: dark; min-height: 48px; }
.auth-form .btn-primary, .auth-form .btn-auth { margin-top: .3rem; padding: .95rem; }
.forgot-password-container { margin: -.3rem 0 .8rem; text-align: right; }
.forgot-password-link { color: var(--brand-2); font-size: .88rem; text-decoration: none; font-weight: 600; } .forgot-password-link:hover { text-decoration: underline; }
.auth-message { padding: .75rem 1rem; border-radius: 12px; font-size: .9rem; margin-bottom: 1rem; }
.auth-message.error { background: rgba(239, 68, 68, .14); color: #fca5a5; border: 1px solid rgba(239, 68, 68, .35); }
.auth-message.success { background: rgba(34, 197, 94, .14); color: #86efac; border: 1px solid rgba(34, 197, 94, .35); }

/* ---------- Banner de cookies ---------- */
.cookie-banner { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(16px, env(safe-area-inset-bottom)); width: min(720px, calc(100% - 24px)); z-index: 900; background: rgba(19, 28, 54, .96); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 18px; padding: 1rem 1.2rem; box-shadow: var(--shadow); transition: opacity .3s, transform .3s; }
.cookie-banner.hidden-cookies { opacity: 0; pointer-events: none; transform: translate(-50%, 20px); visibility: hidden; }
.cookie-content { display: flex; align-items: center; gap: 16px; }
.cookie-content p { color: var(--muted); font-size: .85rem; line-height: 1.5; flex: 1; }
.cookie-content a { color: var(--brand-2); }

/* ---------- Adaptación a tablet y móvil ---------- */
@media (max-width: 960px) {
    .hero { grid-template-columns: 1fr; text-align: center; gap: 2.2rem; }
    .hero-content p { margin-inline: auto; }
    .hero-actions, .hero-points { justify-content: center; }
    .steps-container, .grid-features { grid-template-columns: repeat(2, 1fr); }
    .mock { transform: none; }
}
@media (max-width: 640px) {
    .navbar { padding: .65rem 16px; }
    .nav-link { display: none; }
    .logo { font-size: 1.2rem; }
    .hero { padding-top: 2rem; }
    .hero-actions .btn-primary, .hero-actions .btn-ghost { width: 100%; }
    .steps-container, .grid-features { grid-template-columns: 1fr; }
    .site-footer { flex-direction: column; text-align: center; }
    .modal { align-items: flex-end; padding: 0; }
    .modal-content { max-width: none; border-radius: 22px 22px 0 0; padding: 1.3rem 1.2rem max(1.4rem, env(safe-area-inset-bottom)); margin: auto 0 0; animation: sheet .25s ease; }
    @keyframes sheet { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
    .input-group input, .input-group select { font-size: 16px; }
    .cookie-content { flex-direction: column; align-items: stretch; text-align: left; }
    .btn-cookie-accept { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Acceso con Capotis (opción principal) ---------- */
.capotis-auth { text-align: center; padding: .4rem .2rem .2rem; }
.auth-logo { display: flex; justify-content: center; margin-bottom: .8rem; } .auth-logo .logo-mark { width: 52px; height: 52px; border-radius: 16px; }
.auth-title { font-size: 1.4rem; letter-spacing: -.02em; margin-bottom: .4rem; }
.auth-hint { color: var(--muted); font-size: .92rem; margin: 0 auto 1.2rem; max-width: 330px; }
.auth-hint.small { font-size: .8rem; margin: .8rem auto 0; }
.btn-capotis { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; border: 0; border-radius: 14px; padding: .95rem 1rem; font-size: 1.02rem; font-weight: 800; color: #0b1030; background: #fff; box-shadow: 0 10px 28px rgba(0, 0, 0, .35); transition: transform .12s, filter .2s; min-height: 54px; }
.btn-capotis img { border-radius: 7px; }
.btn-capotis:hover { filter: brightness(.96); transform: translateY(-1px); } .btn-capotis:active { transform: scale(.98); }
.or { display: flex; align-items: center; gap: 12px; color: #64748b; font-size: .82rem; margin: 1.3rem 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn-legacy { width: 100%; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--text); border-radius: 14px; padding: .8rem 1rem; font-weight: 700; display: flex; flex-direction: column; gap: 2px; min-height: 54px; transition: background .2s; }
.btn-legacy:hover { background: rgba(255, 255, 255, .1); } .btn-legacy small { color: var(--muted); font-weight: 500; font-size: .76rem; }
.back-link { border: 0; background: none; color: var(--muted); font-weight: 600; padding: .3rem .1rem; margin-bottom: .6rem; } .back-link:hover { color: var(--text); }
