/*
 * Sitio público (landing y Aviso de Privacidad).
 * Identidad de la app: Inter + índigo (ver docs/frontend-guide.md).
 */

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-soft: #eef2ff;
    --ink: #111827;
    --ink-soft: #374151;
    --muted: #6b7280;
    --line: #e5e7eb;
    --bg: #ffffff;
    --bg-tinted: #f5f7fa;
    --success: #059669;
    --success-soft: #d1fae5;
    --radius: 15px;
    --shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
    --header-h: 68px;
}

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

[x-cloak] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 8px);
}

body.public {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img,
svg {
    display: block;
}

a {
    color: var(--primary);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ---------- Botones y chips ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    border: 2px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:focus-visible,
.site-nav a:focus-visible,
.site-header__burger:focus-visible {
    outline: 3px solid rgba(79, 70, 229, 0.45);
    outline-offset: 2px;
}

.btn-lg {
    padding: 0.8rem 1.4rem;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--primary);
    border-color: rgba(79, 70, 229, 0.3);
}

.btn-ghost:hover {
    background: var(--primary-soft);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.chip-success {
    background: var(--success-soft);
    color: var(--success);
}

.chip-ai {
    background: var(--primary-soft);
    color: var(--primary);
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
}

/* ---------- Encabezado ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: var(--header-h);
}

.site-header__brand img {
    height: 36px;
    width: auto;
}

.site-nav {
    display: flex;
    gap: 1.75rem;
    margin-left: auto;
}

.site-nav a {
    color: var(--ink-soft);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}

.site-nav a:hover {
    color: var(--primary);
}

.site-header__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.site-header__burger {
    display: none;
    background: none;
    border: none;
    color: var(--ink);
    padding: 0.4rem;
    border-radius: 8px;
    cursor: pointer;
}

/* ---------- Secciones ---------- */

.section {
    padding: 5rem 0;
}

.section-tinted {
    background: var(--bg-tinted);
}

.section-header {
    max-width: 720px;
    margin: 0 auto 3rem;
    text-align: center;
}

.eyebrow {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

h1,
h2,
h3 {
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.75rem, 3vw, 2.4rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.15rem;
    font-weight: 600;
}

.section-lead {
    color: var(--muted);
    font-size: 1.1rem;
}

/* ---------- Hero ---------- */

.hero {
    background: radial-gradient(ellipse at top right, #e0e7ff 0%, rgba(224, 231, 255, 0) 55%), var(--bg);
    padding: 5rem 0 5.5rem;
}

.hero__inner {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 3.5rem;
    align-items: center;
}

.hero h1 {
    font-size: clamp(2.2rem, 4.6vw, 3.4rem);
    font-weight: 800;
    margin-bottom: 1.25rem;
}

.hero__lead {
    color: var(--ink-soft);
    font-size: 1.15rem;
    max-width: 560px;
    margin-bottom: 2rem;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hero__visual {
    position: relative;
    padding-bottom: 3.5rem;
}

.lj-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 1.25rem 1.25rem 1rem;
}

.lj-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.lj-card__title {
    display: block;
    font-weight: 600;
}

.lj-card__subtitle {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
}

.lj-chart {
    width: 100%;
    height: auto;
}

.lj-chart line {
    stroke-width: 1;
}

.lj-chart .mean {
    stroke: #9ca3af;
}

.lj-chart .sd1 {
    stroke: #e5e7eb;
    stroke-dasharray: 3 4;
}

.lj-chart .sd2 {
    stroke: #fcd34d;
    stroke-dasharray: 5 4;
}

.lj-chart .sd3 {
    stroke: #fca5a5;
    stroke-dasharray: 5 4;
}

.lj-chart__labels text {
    font-size: 10px;
    fill: var(--muted);
    text-anchor: end;
}

.lj-chart__line {
    fill: none;
    stroke: var(--primary);
    stroke-width: 2;
    stroke-linejoin: round;
}

.lj-chart__points circle {
    fill: #fff;
    stroke: var(--primary);
    stroke-width: 2;
}

.lj-card__footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid var(--line);
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.lj-card__ok {
    color: var(--success);
    font-weight: 600;
}

.ai-card {
    position: absolute;
    left: -1.5rem;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.75rem 1rem;
    max-width: 380px;
}

.ai-card strong {
    display: block;
    font-size: 0.9rem;
}

.ai-card__hint {
    font-size: 0.8rem;
    color: var(--muted);
}

.ai-card__icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
}

/* ---------- Apps ---------- */

.app-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.app-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2rem 2.25rem;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.app-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.app-card__icon {
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    border-radius: 16px;
    color: #fff;
    background: var(--primary);
    margin: 0 auto 1.1rem;
}

/* Mismos colores por App que el selector */
.app-card.qc .app-card__icon { background: #4f46e5; }
.app-card.qualitative .app-card__icon { background: #7c3aed; }
.app-card.verification .app-card__icon { background: #059669; }
.app-card.learning .app-card__icon { background: #d97706; }

.app-card h3 {
    margin-bottom: 0.6rem;
    text-align: center;
}

.app-card p {
    color: var(--muted);
    font-size: 0.95rem;
}

.app-card__feature {
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px dashed var(--line);
}

.app-card__feature p {
    margin-top: 0.6rem;
    font-size: 0.875rem;
}

/* ---------- Acompañamiento ---------- */

/* Flex en lugar de grid para centrar la última fila cuando no se completa */
.feature-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem;
}

.feature {
    flex: 0 1 calc((100% - 2 * 1.25rem) / 3);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.75rem 2rem;
}

.feature__icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary);
    margin: 0 auto 1rem;
}

.feature h3 {
    margin-bottom: 0.5rem;
    text-align: center;
}

.feature p {
    color: var(--muted);
    font-size: 0.95rem;
}

/* ---------- Contacto ---------- */

.contact-card {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 3rem 2rem;
}

.contact-card__email {
    display: inline-block;
    margin: 1.5rem 0;
    font-size: clamp(1.25rem, 3vw, 1.6rem);
    font-weight: 700;
    text-decoration: none;
    word-break: break-all;
}

.contact-card__email:hover {
    text-decoration: underline;
}

.contact-card__actions {
    display: flex;
    justify-content: center;
}

.contact-card__social {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 0.5rem;
    list-style: none;
}

.social-links a {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: var(--ink-soft);
    background: var(--bg-tinted);
    transition: color 0.2s ease, background-color 0.2s ease;
}

.social-links a:hover {
    color: #fff;
    background: var(--primary);
}

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

.site-footer {
    border-top: 1px solid var(--line);
    padding: 3rem 0 1.5rem;
    font-size: 0.9rem;
}

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.site-footer__brand img {
    height: 30px;
    width: auto;
    margin-bottom: 0.5rem;
}

.site-footer__brand p {
    color: var(--muted);
}

.site-footer__links {
    display: flex;
    gap: 1.5rem;
}

.site-footer__links a,
.site-footer__legal a {
    color: var(--ink-soft);
    text-decoration: none;
}

.site-footer__links a:hover,
.site-footer__legal a:hover {
    color: var(--primary);
}

.site-footer__legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.85rem;
}

/* ---------- Aviso de Privacidad ---------- */

.legal__inner {
    max-width: 760px;
}

.legal h1 {
    font-size: clamp(2rem, 4vw, 2.6rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.legal__updated {
    color: var(--muted);
    margin-bottom: 2.5rem;
}

.legal h2 {
    font-size: 1.25rem;
    margin: 2rem 0 0.75rem;
}

.legal p,
.legal li {
    color: var(--ink-soft);
}

.legal p {
    margin-bottom: 0.75rem;
}

.legal ul {
    padding-left: 1.25rem;
    display: grid;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
    /* En una sola columna, el hero se centra completo (texto, CTAs y gráfico) */
    .hero__inner {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .hero__copy {
        text-align: center;
    }

    .hero__lead {
        margin-left: auto;
        margin-right: auto;
    }

    .hero__actions {
        justify-content: center;
    }

    .hero__visual {
        width: 100%;
        max-width: 520px;
        margin: 0 auto;
    }

    .ai-card {
        left: auto;
        right: -0.5rem;
    }
}

@media (max-width: 768px) {
    .site-header__burger {
        display: block;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background: #fff;
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow);
        padding: 0.5rem 1.25rem 1rem;
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav a {
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--line);
    }

    .site-header__actions {
        margin-left: auto;
    }

    .section {
        padding: 3.5rem 0;
    }

    .hero {
        padding: 3rem 0 3.5rem;
    }

    /* Una sola columna de tarjetas, igual en Apps y en acompañamiento */
    .app-grid {
        grid-template-columns: 1fr;
    }

    .feature {
        flex-basis: 100%;
    }

    .contact-card {
        padding: 2.25rem 1.25rem;
    }

    .site-footer__inner,
    .site-footer__legal {
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }

    .site-footer__legal {
        align-items: center;
    }

    .site-footer__brand img {
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 560px) {
    .site-header__brand img {
        height: 30px;
    }

    .site-header__actions .btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.875rem;
    }

    .ai-card {
        position: static;
        margin-top: 1rem;
        max-width: none;
    }

    .hero__visual {
        padding-bottom: 0;
    }

    /* "Sin violaciones" baja completo a su propia línea en lugar de partirse */
    .lj-card__footer {
        flex-wrap: wrap;
        row-gap: 0.25rem;
    }

    .hero__actions .btn {
        flex: 1 1 100%;
    }

    .app-card,
    .feature {
        padding: 1.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .btn,
    .app-card {
        transition: none;
    }
}
