/* ── Tema Fluent Design (Microsoft) — paleta blanco / azul / negro ─────────
   Tokens compartidos por todo el portal. Los nombres de clase se conservan de
   la versión anterior; solo cambia el lenguaje visual. */

:root {
    /* Superficies: blanco sobre gris neutro muy claro (Fluent neutral layers) */
    --bg-main: #f5f6f8;
    --bg-deep: #eef0f3;
    --panel-bg: #ffffff;
    --panel-border: #e1e4e8;
    /* Texto: negro y gris neutro */
    --text-main: #1a1a1a;
    --text-dim: #5c6470;
    /* Azul Fluent (#0078D4) como único acento de marca */
    --accent-main: #0078d4;
    --accent-hover: #106ebe;
    --accent-active: #005a9e;
    --accent-subtle: rgba(0, 120, 212, 0.08);
    --accent-border: rgba(0, 120, 212, 0.35);
    /* Colores funcionales de estado (solo badges/alertas, no cromo) */
    --accent-warm: #9d5d00;
    --danger-main: #c50f1f;
    --success-main: #0f7b0f;
    /* Profundidad Fluent: sombras cortas y difusas */
    --shadow-soft: 0 1.6px 3.6px rgba(0, 0, 0, 0.08), 0 0.3px 0.9px rgba(0, 0, 0, 0.06);
    --shadow-raised: 0 6.4px 14.4px rgba(0, 0, 0, 0.11), 0 1.2px 3.6px rgba(0, 0, 0, 0.09);
    /* Esquinas discretas al estilo WinUI */
    --radius-lg: 8px;
    --radius-md: 6px;
    --radius-sm: 4px;
    --font-ui: "Segoe UI", "Segoe UI Web (West European)", -apple-system,
        BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

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

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    color: var(--text-main);
    font-family: var(--font-ui);
    line-height: 1.5;
    background: var(--bg-main);
    overflow-x: hidden;
}

h1,
h2,
h3 {
    margin: 0;
    color: var(--text-main);
    font-family: var(--font-ui);
    font-weight: 600;
    letter-spacing: 0;
}

p {
    margin: 0;
}

a {
    color: inherit;
}

/* La decoración ambiental (orbes/rejilla) no existe en Fluent: se apaga sin
   tocar el markup de las páginas. */
.ambient-layer {
    display: none;
}

.orb,
.grid-wash {
    display: none;
}

.page-wrap {
    position: relative;
    z-index: 1;
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: clamp(1.2rem, 2.8vw, 2.8rem);
}

.panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.kicker {
    color: var(--accent-main);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin: 0 0 0.8rem;
}

.lead {
    color: var(--text-dim);
    font-size: 1rem;
}

.btn {
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 1.2rem;
    transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.btn:focus-visible {
    outline: 2px solid var(--text-main);
    outline-offset: 2px;
}

.btn-primary {
    color: #ffffff;
    background: var(--accent-main);
}

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

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

.btn-ghost {
    color: var(--text-main);
    background: #ffffff;
    border: 1px solid #d1d5da;
}

.btn-ghost:hover {
    background: #f3f4f6;
    border-color: #b9bfc7;
}

.btn-danger {
    color: #ffffff;
    background: var(--danger-main);
}

.btn-danger:hover {
    background: #a80d1a;
}

.btn-block {
    width: 100%;
}

.landing-main {
    display: grid;
    gap: 1.15rem;
}

.hero-panel {
    padding: clamp(1.25rem, 3.3vw, 2.6rem);
    border-top: 3px solid var(--accent-main);
}

.hero-panel h1 {
    font-size: clamp(1.9rem, 4.4vw, 3rem);
    line-height: 1.12;
    margin-bottom: 0.95rem;
    max-width: 16ch;
    font-weight: 700;
}

.hero-panel .lead {
    font-size: clamp(1rem, 2.2vw, 1.12rem);
    max-width: 64ch;
}

.hero-actions {
    margin-top: 1.6rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.72rem;
}

.insight-row {
    margin-top: 1.35rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.insight-row span {
    border-radius: var(--radius-sm);
    border: 1px solid var(--accent-border);
    background: var(--accent-subtle);
    color: var(--accent-active);
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.benefit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.benefit-card {
    border-radius: var(--radius-md);
    padding: 1rem 1.05rem;
}

.benefit-card h2 {
    font-size: 1.1rem;
    margin-bottom: 0.46rem;
    color: var(--accent-main);
}

.benefit-card p {
    color: var(--text-dim);
}

.benefit-card:nth-child(2n) h2,
.benefit-card:nth-child(2n + 1) h2 {
    color: var(--accent-main);
}

.login-body,
.home-body {
    display: grid;
    place-items: center;
    padding: 1rem;
}

.auth-shell {
    width: min(480px, 100%);
}

.auth-panel {
    padding: clamp(1.2rem, 3.5vw, 2rem);
    border-top: 3px solid var(--accent-main);
}

.auth-panel h1 {
    font-size: clamp(1.55rem, 4.5vw, 2rem);
    margin-bottom: 0.55rem;
    font-weight: 700;
}

.auth-form {
    display: grid;
    gap: 0.75rem;
    margin-top: 1.4rem;
}

.auth-form label {
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.auth-form input {
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid #d1d5da;
    border-bottom: 2px solid #8a8f98;
    background: #ffffff;
    color: var(--text-main);
    font-family: var(--font-ui);
    font-size: 0.96rem;
    padding: 0.66rem 0.85rem;
    transition: border-color 0.12s ease;
}

.auth-form input:focus {
    outline: none;
    border-bottom-color: var(--accent-main);
}

.status-message {
    color: var(--danger-main);
    min-height: 1.25rem;
    margin: 0.8rem 0 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.auth-note {
    color: var(--text-dim);
    margin-top: 0.3rem;
    font-size: 0.9rem;
}

.inline-link {
    display: inline-block;
    margin-top: 0.75rem;
    color: var(--accent-main);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
}

.inline-link:hover {
    text-decoration: underline;
    text-underline-offset: 0.18rem;
    color: var(--accent-hover);
}

.home-shell {
    width: min(1080px, 100%);
    display: grid;
    gap: 1rem;
}

.home-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    padding: 1.25rem 1.3rem;
}

.home-header h1 {
    font-size: clamp(1.55rem, 3.6vw, 2.2rem);
    margin-bottom: 0.4rem;
    font-weight: 700;
}

.home-header .lead {
    max-width: 58ch;
}

.home-card {
    border-radius: var(--radius-md);
    padding: 1.05rem 1.2rem;
}

.home-card h2 {
    color: var(--text-main);
    font-size: 1.15rem;
    margin-bottom: 0.8rem;
}

.profile-grid {
    margin: 0;
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 0.46rem 0.8rem;
}

.profile-grid dt {
    color: var(--text-dim);
    font-size: 0.88rem;
    font-weight: 600;
}

.profile-grid dd {
    margin: 0;
    color: var(--text-main);
    font-weight: 600;
}

.split-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.pill-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.56rem;
}

.pill-list li {
    border-radius: var(--radius-sm);
    border: 1px solid var(--panel-border);
    background: var(--bg-main);
    color: var(--text-main);
    font-size: 0.83rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
}

.home-status {
    margin-top: -0.2rem;
}

.reveal {
    animation: slide-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.landing-main .benefit-grid {
    animation-delay: 0.06s;
}

.home-shell > :nth-child(2) {
    animation-delay: 0.04s;
}

.home-shell > :nth-child(3) {
    animation-delay: 0.08s;
}

.home-shell > :nth-child(4) {
    animation-delay: 0.12s;
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 920px) {
    .home-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .split-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .page-wrap {
        padding: 0.95rem;
    }

    .hero-panel,
    .auth-panel,
    .home-header,
    .home-card {
        padding: 1rem;
    }

    .profile-grid {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .btn {
        width: 100%;
    }

    .hero-actions .btn {
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
