/* ===================================================================
   SOCHIMI 2026 — Sistema de diseño (rediseño UX/UI)
   Paleta oficial + componentes. Estilo: público vibrante / interno sobrio.
   Se conservan los nombres de clase existentes para no romper vistas.
   =================================================================== */

:root {
    /* --- Paleta oficial SOCHIMI --- */
    --c-azul-marino: #1D3557;
    --c-rojo:        #E63946;
    --c-azul-salud:  #0077CC;
    --c-turquesa:    #00B4A6;
    --c-amarillo:    #FFB703;
    --c-verde:       #2ECC71;
    --c-coral:       #FF6B6B;
    --c-celeste:     #4DD0E1;
    --c-lavanda:     #E8E6FF;
    --c-melocoton:   #FFE08A;

    /* --- Tokens del sistema (mapeados a la paleta) --- */
    --color-primary:      #1D3557;   /* puede sobreescribirse desde congress_settings */
    --color-primary-dark: #142844;
    --color-secondary:    #0077CC;
    --color-accent:       #E63946;
    --color-text:   #16202f;
    --color-muted:  #5b6677;
    --color-bg:     #f5f7fb;
    --color-surface:#ffffff;
    --color-border: #e6e9ef;

    --container-max: 1180px;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow-sm: 0 1px 2px rgba(20, 30, 48, .06);
    --shadow:    0 8px 28px rgba(20, 30, 48, .10);
    --shadow-lg: 0 24px 60px rgba(20, 30, 48, .18);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    overflow-x: hidden;
}
img { max-width: 100%; }
a { color: var(--color-secondary); text-decoration: none; }
a:hover { color: var(--color-primary-dark); }

.container { max-width: var(--container-max); margin: 0 auto; padding: 0 1.1rem; }
.muted { color: var(--color-muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .15em; font-size: .78rem; font-weight: 800; color: var(--c-turquesa); }

.skip-link { position: absolute; left: -9999px; top: 0; background: #fff; color: var(--color-primary); padding: .5rem 1rem; z-index: 1000; }
.skip-link:focus { left: 1rem; top: 1rem; }

/* ===================== Botones ===================== */
.button {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    background: var(--color-secondary); color: #fff;
    padding: .62rem 1.2rem; border: 2px solid transparent; border-radius: 999px;
    text-decoration: none; font-weight: 700; font-size: .96rem; cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
    box-shadow: 0 6px 16px rgba(0, 119, 204, .22);
}
.button:hover { background: #0468ad; color: #fff; transform: translateY(-2px); }
.button:focus-visible { outline: 3px solid rgba(0, 119, 204, .4); outline-offset: 2px; }
.button[disabled], .button:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.button--accent { background: var(--c-rojo); box-shadow: 0 8px 20px rgba(230, 57, 70, .32); }
.button--accent:hover { background: #cf2c39; }
.button--ghost { background: transparent; color: var(--color-primary); border-color: var(--color-border); box-shadow: none; }
.button--ghost:hover { background: #fff; border-color: var(--color-secondary); color: var(--color-secondary); }
.button--ghost-light { background: rgba(255,255,255,.10); color: #fff; border-color: rgba(255,255,255,.55); box-shadow: none; backdrop-filter: blur(4px); }
.button--ghost-light:hover { background: rgba(255,255,255,.2); color: #fff; }
.button--danger { background: #fff; color: var(--c-rojo); border-color: #f3c4c8; box-shadow: none; }
.button--danger:hover { background: var(--c-rojo); color: #fff; }
.button--sm { padding: .42rem .85rem; font-size: .85rem; }
.button--lg { padding: .95rem 1.9rem; font-size: 1.06rem; }

.link-button { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.link-button:hover { color: var(--color-secondary); }

/* ===================== Header / Nav ===================== */
.site-header {
    position: sticky; top: 0; z-index: 60;
    background: rgba(255, 255, 255, .9); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
}
.site-header__inner { display: flex; align-items: center; gap: 1rem; padding: .6rem 0; }
.brand { color: var(--color-primary); font-weight: 800; text-decoration: none; display: inline-flex; align-items: center; gap: .6rem; }
.brand__logo { width: 42px; height: 42px; object-fit: contain; display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,.12)); }
.brand__name { font-size: 1.06rem; letter-spacing: .01em; line-height: 1.1; }
.brand__name small { display: block; font-weight: 600; color: var(--color-muted); font-size: .7rem; }

.site-nav { display: flex; align-items: center; gap: .35rem; margin-left: auto; flex-wrap: wrap; }
.site-nav__link { color: var(--color-primary); text-decoration: none; font-weight: 600; padding: .4rem .7rem; border-radius: 8px; font-size: .94rem; }
.site-nav__link:hover { background: var(--c-lavanda); color: var(--color-primary); }
.site-nav__link--primary { background: var(--c-rojo); color: #fff; box-shadow: 0 6px 14px rgba(230,57,70,.3); }
.site-nav__link--primary:hover { background: #cf2c39; color: #fff; }
.site-nav__user { color: var(--color-muted); font-size: .9rem; padding-left: .4rem; }
.site-nav__logout { display: inline; margin: 0; }
.site-nav__logout .link-button { color: var(--color-muted); }

.nav-toggle { display: none; background: none; border: 0; font-size: 1.7rem; line-height: 1; color: var(--color-primary); cursor: pointer; margin-left: auto; padding: .2rem .4rem; }
.site-header__strip { padding: .4rem 0; color: var(--color-muted); font-size: .9rem; border-top: 1px solid var(--color-border); }

@media (max-width: 900px) {
    .nav-toggle { display: block; }
    .site-nav {
        position: absolute; left: 0; right: 0; top: 100%;
        flex-direction: column; align-items: stretch; gap: .15rem;
        background: #fff; border-bottom: 1px solid var(--color-border);
        padding: .6rem 1.1rem 1rem; box-shadow: var(--shadow);
        display: none;
    }
    .site-nav.is-open { display: flex; }
    .site-nav__link { padding: .6rem .7rem; }
    .site-nav__user { padding: .4rem .7rem; }
}

/* ===================== Footer ===================== */
.site-footer { background: #0f2742; color: rgba(255,255,255,.78); padding: 2.4rem 0 1.4rem; margin-top: 3rem; }
.site-footer__grid { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.site-footer .brand { color: #fff; }
.site-footer .brand__logo { filter: brightness(0) invert(.88); }
.site-footer .brand__name small { color: rgba(255,255,255,.6); }
.site-footer__legal { margin-left: auto; text-align: right; font-size: .86rem; }
.site-footer__legal a { color: #fff; }
.site-footer hr { border: 0; border-top: 1px solid rgba(255,255,255,.15); margin: 1.3rem 0 1rem; }
.site-footer__copy { font-size: .8rem; color: rgba(255,255,255,.55); text-align: center; }

/* ===================== Main ===================== */
.site-main { padding: 2.6rem 0; min-height: 60vh; }
.site-main--flush { padding: 0; min-height: 60vh; }

/* ===================== Alertas ===================== */
.alert {
    display: flex; gap: .6rem; align-items: flex-start;
    padding: .85rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: .8rem;
    border-left: 4px solid var(--color-secondary); background: #e8f3fc; color: #0a4d8c; font-size: .95rem;
}
.alert--success { background: #e4f8ec; color: #1c6e42; border-left-color: var(--c-verde); }
.alert--error   { background: #fdeaec; color: #a01824; border-left-color: var(--c-rojo); }
.alert--info    { background: #e8f3fc; color: #0a4d8c; border-left-color: var(--color-secondary); }
.alert--warning { background: #fff4d6; color: #7a5b00; border-left-color: var(--c-amarillo); }

/* ===================== Formularios ===================== */
.form { display: flex; flex-direction: column; gap: 1rem; }
.form__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.form__row { display: flex; flex-direction: column; gap: .35rem; }
.form__row--check { flex-direction: row; align-items: center; gap: .5rem; }
.form__row label { font-weight: 600; font-size: .92rem; color: var(--color-primary); }
.form__row input[type="text"], .form__row input[type="email"], .form__row input[type="password"],
.form__row input[type="number"], .form__row input[type="datetime-local"],
input[type="text"], input[type="email"], input[type="password"], input[type="number"] {
    padding: .62rem .8rem; border: 1.5px solid var(--color-border); border-radius: var(--radius-sm);
    font: inherit; background: #fff; transition: border-color .15s, box-shadow .15s;
}
.form__row input:focus, input:focus, textarea:focus, select:focus {
    outline: none; border-color: var(--color-secondary); box-shadow: 0 0 0 3px rgba(0,119,204,.15);
}
.form__grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) { .form__grid--2 { grid-template-columns: 1fr; } }
.form__row--full { grid-column: 1 / -1; }
.form__hint { color: var(--color-muted); font-size: .84rem; }
.form__error { color: var(--c-rojo); font-size: .84rem; font-weight: 600; }
.form__actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: .5rem; }
.form__alt { margin-top: 1rem; color: var(--color-muted); font-size: .95rem; }
.form__fieldset { border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: .9rem 1.1rem; margin: 0; display: flex; flex-direction: column; gap: .45rem; }
.form__fieldset legend { padding: 0 .4rem; color: var(--color-primary); font-weight: 700; }
.form__fieldset label { font-weight: 400; }

textarea { padding: .62rem .8rem; border: 1.5px solid var(--color-border); border-radius: var(--radius-sm); font: inherit; background: #fff; width: 100%; resize: vertical; }
select { padding: .6rem .8rem; border: 1.5px solid var(--color-border); border-radius: var(--radius-sm); font: inherit; background: #fff; }

/* ===================== Auth ===================== */
.auth-wrap { display: grid; place-items: center; padding: 2.5rem 0; }
.auth-card {
    width: 100%; max-width: 460px; margin: 1.5rem auto;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow);
}
.auth-card--wide { max-width: 760px; }
.auth-card h1 { color: var(--color-primary); margin-top: 0; }
.auth-card__brand { display: flex; flex-direction: column; align-items: center; gap: .5rem; margin-bottom: 1.2rem; text-align: center; }
.auth-card__brand img { width: 64px; height: 64px; object-fit: contain; }

/* ===================== Cards / page header ===================== */
.page-header { margin-bottom: 1.4rem; }
.page-header h1 { color: var(--color-primary); margin: 0 0 .4rem; }

.hero { max-width: 760px; }       /* fallback antiguo, el home usa .home-hero */
.hero h1 { color: var(--color-primary); margin: 0 0 .75rem; font-size: clamp(1.6rem, 2.4vw, 2.2rem); }
.hero__lead { font-size: 1.1rem; margin: 0 0 1rem; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: 2.5rem; }
.info-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow-sm); }
.info-card h2 { color: var(--color-primary); margin: 0 0 .5rem; font-size: 1.1rem; }
.info-card p { margin: 0; color: var(--color-muted); }

.dashboard h1 { color: var(--color-primary); margin-top: 0; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.role-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1.1rem 1.3rem; box-shadow: var(--shadow-sm); }
.role-card h2 { color: var(--color-primary); font-size: 1.05rem; margin: 0 0 .4rem; }
.role-card p { margin: 0; }

.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.3rem; margin-bottom: 1.5rem; }
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1.3rem 1.5rem; box-shadow: var(--shadow-sm); }
.card h2 { color: var(--color-primary); margin: 0 0 1rem; font-size: 1.15rem; }
.card__header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.card__header h2 { margin: 0; }
.card__divider { border: 0; border-top: 1px solid var(--color-border); margin: 1.25rem 0; }
.card--span2 { grid-column: span 1; }

.profile-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.3rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: .5rem 0 0; }
.kv dt { color: var(--color-muted); font-size: .9rem; }
.kv dd { margin: 0; }

/* ===================== Tablas + scroll móvil ===================== */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-sm); }
.submissions-table { width: 100%; border-collapse: collapse; min-width: 540px; }
.submissions-table th, .submissions-table td { padding: .6rem .7rem; border-bottom: 1px solid var(--color-border); text-align: left; vertical-align: middle; }
.submissions-table th { background: var(--color-bg); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--color-muted); }
.submissions-table tr:last-child td { border-bottom: 0; }
.submissions-table tbody tr:hover { background: #fafbfd; }
.submissions-table__actions { white-space: nowrap; display: flex; gap: .4rem; flex-wrap: wrap; }
.submissions-table tr.is-overdue td { background: #fdeaec; }

/* ===================== Badges de estado ===================== */
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .65rem; border-radius: 999px; font-size: .77rem; font-weight: 700; background: #eef1f6; color: #5b6677; border: 1px solid transparent; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge--draft     { background: #eef1f6; color: #5b6677; }
.badge--submitted { background: #e8f3fc; color: #0468ad; }
.badge--review    { background: #fff4d6; color: #8a6a00; }
.badge--evaluated { background: #e3f7f4; color: #067a70; }
.badge--approved  { background: #e4f8ec; color: #1c8a4b; }
.badge--rejected  { background: #fdeaec; color: #c81e2c; }
.badge--pending   { background: #fff4d6; color: #8a6a00; }
.badge--finalized { background: #e3f7f4; color: #067a70; }

.deadlines { list-style: none; padding: 0; margin: 0 0 .5rem; }
.deadlines__item { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; padding: .5rem 0; border-bottom: 1px dashed var(--color-border); }
.deadlines__item:last-child { border-bottom: 0; }
.deadlines__name { font-weight: 600; }
.deadlines__name.is-upcoming { color: var(--c-rojo); }
.deadlines__value { font-variant-numeric: tabular-nums; color: var(--color-muted); }

@media (max-width: 900px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .profile-grid   { grid-template-columns: 1fr; }
}

/* ===================== Evaluador ===================== */
.rubric-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.rubric-table th, .rubric-table td { padding: .65rem .75rem; border-bottom: 1px solid var(--color-border); vertical-align: top; text-align: left; }
.rubric-table th { background: var(--color-bg); font-size: .85rem; color: var(--color-muted); text-transform: uppercase; letter-spacing: .04em; }
.rubric-table tr:last-child td { border-bottom: 0; }
.rubric-table__score { width: 110px; }
.rubric-table__score input { width: 100%; }
.peer-eval { border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: .85rem 1rem; margin-bottom: .75rem; background: var(--color-bg); }
.peer-eval__head { display: flex; gap: .5rem; align-items: baseline; margin-bottom: .4rem; flex-wrap: wrap; }
.peer-eval h4 { margin: .6rem 0 .2rem; font-size: .95rem; }

/* ===================== Formulario de postulación ===================== */
.submission-form .card { margin-bottom: 1rem; }
.autosave-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: .65rem 1rem; margin-bottom: 1rem; box-shadow: var(--shadow-sm); font-size: .92rem; }
.autosave-bar__status { color: var(--color-muted); }
.autosave-bar__last { color: var(--color-muted); }
.autosave-bar__last strong { color: var(--color-primary); font-variant-numeric: tabular-nums; }
[data-abstract-counter].is-over { color: var(--c-rojo); font-weight: 700; }
.submission-image { max-width: 100%; max-height: 320px; border-radius: var(--radius-sm); border: 1px solid var(--color-border); }
.submission-table table { border-collapse: collapse; width: 100%; }
.submission-table th, .submission-table td { border: 1px solid var(--color-border); padding: .4rem .6rem; }
.coauthor-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.coauthor { display: grid; grid-template-columns: 1fr; gap: .5rem; padding: .75rem 0; border-bottom: 1px dashed var(--color-border); }
.coauthor:last-child { border-bottom: 0; }
.coauthor--main { padding: .75rem; background: var(--c-lavanda); border-radius: var(--radius-sm); margin-bottom: 1rem; border: 0; }
.coauthor__head { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.coauthor__form { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin: 0; }
.coauthor__form label { font-weight: 400; }
.coauthor-add { margin-top: 1rem; }

/* Tarjeta de resultado (vista del postulante) */
.card--result { border-width: 2px; }
.card--result-ok   { border-color: var(--c-verde); background: #ecfdf5; }
.card--result-fail { border-color: var(--c-rojo); background: #fef2f2; }
.public-comments { list-style: decimal inside; padding: 0; margin: .75rem 0 0; display: grid; gap: .75rem; }
.public-comments li { padding-left: .25rem; }
.public-comments li > p { margin: .25rem 0 0; white-space: pre-line; }
.result-eposter { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--color-border); }

/* ===================== Admin module ===================== */
.admin-body { background: var(--color-bg); }
.admin-topbar { background: var(--color-primary); color: #fff; padding: .75rem 1.25rem; display: flex; align-items: center; justify-content: space-between; box-shadow: var(--shadow-sm); }
.admin-topbar__brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; color: #fff; }
.admin-topbar__logo { width: 32px; height: 32px; object-fit: contain; filter: brightness(0) invert(1); }
.admin-topbar__user { display: inline-flex; align-items: center; gap: .75rem; }
.admin-topbar__user a, .admin-topbar__brand a { color: #fff; }
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 56px); }
.admin-sidebar { background: #0f2742; color: #cbd5e1; padding: 1.1rem 0; }
.admin-sidebar nav { display: flex; flex-direction: column; }
.admin-sidebar__link { color: #cbd5e1; padding: .62rem 1.25rem; text-decoration: none; border-left: 4px solid transparent; font-size: .94rem; }
.admin-sidebar__link:hover { background: rgba(255,255,255,.05); color: #fff; }
.admin-sidebar__link.is-active { background: rgba(255,255,255,.08); color: #fff; border-left-color: var(--c-turquesa); }
.admin-main { padding: 1.6rem 2rem; }
.admin-header { margin-bottom: 1.25rem; }
.admin-header h1 { color: var(--color-primary); margin: 0 0 .4rem; }
.admin-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1.3rem 1.5rem; box-shadow: var(--shadow-sm); margin-bottom: 1.5rem; overflow-x: auto; }
.admin-card h2 { margin: 0 0 1rem; font-size: 1.15rem; color: var(--color-primary); }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: .6rem .75rem; border-bottom: 1px solid var(--color-border); text-align: left; vertical-align: middle; }
.admin-table th { background: var(--color-bg); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--color-muted); }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table__actions { white-space: nowrap; display: flex; gap: .5rem; flex-wrap: wrap; }
.admin-table--deadlines td input[type="datetime-local"] { padding: .4rem .5rem; }
.inline-form { display: inline; margin: 0; }

.documents { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.documents__item { padding: .5rem 0; border-bottom: 1px dashed var(--color-border); }
.documents__item:last-child { border-bottom: 0; }
.documents__link { text-decoration: none; }
.documents__link:hover strong { text-decoration: underline; }
.documents-list { margin-top: 1.5rem; }

.export-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.export-list__item { display: flex; align-items: center; gap: 1rem; padding: .75rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: #fafbfd; }
.export-list__item strong { min-width: 12rem; }
.export-list__item .button { margin-left: auto; }

.logs-table { width: 100%; border-collapse: collapse; font-size: .92rem; margin-top: .5rem; min-width: 640px; }
.logs-table th, .logs-table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--color-border); vertical-align: top; }
.logs-table th { background: var(--color-bg); font-weight: 600; }
.logs-table code { background: var(--color-bg); padding: 0 .25rem; border-radius: 3px; font-size: .85em; }
.logs-table__diff { max-width: 36rem; word-break: break-word; }
.diff-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.diff-list li { font-size: .85em; line-height: 1.4; }
.diff-old { color: #991b1b; text-decoration: line-through; }
.diff-arrow { color: #64748b; padding: 0 .25rem; }
.diff-new { color: #065f46; font-weight: 500; }
.pagination { margin-top: 1rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

.rubric-items { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .75rem; }
.rubric-item { border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 1rem; background: #fafbfd; display: grid; gap: .75rem; }
.rubric-item__form { margin: 0; }
.rubric-item__delete { margin: 0; justify-self: end; }

.error-page { text-align: center; padding: 3rem 0; }
.error-page__code { font-size: 4rem; font-weight: 800; color: var(--color-primary); margin: 0; }

@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { padding: .5rem 0; }
    .admin-sidebar nav { flex-direction: row; flex-wrap: wrap; }
    .admin-sidebar__link { border-left: 0; border-bottom: 3px solid transparent; padding: .5rem .75rem; }
    .admin-sidebar__link.is-active { border-left: 0; border-bottom-color: var(--c-turquesa); }
    .admin-main { padding: 1rem; }
}

/* ===================================================================
   HOME PÚBLICO (vibrante + movimiento + 3D)
   =================================================================== */
/* Solo se ocultan si hay JS (progressive enhancement: sin JS, todo visible). */
.js .home .reveal { opacity: 0; transform: translateY(34px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.home .reveal.in { opacity: 1; transform: none; }
.home .reveal.s1 { transition-delay: .06s; } .home .reveal.s2 { transition-delay: .14s; }
.home .reveal.s3 { transition-delay: .22s; } .home .reveal.s4 { transition-delay: .30s; } .home .reveal.s5 { transition-delay: .38s; }

.home-section { padding: 4rem 0; position: relative; }
.home-section--soft { background: var(--color-bg); }
.section-head { max-width: 60ch; margin: 0 0 2.2rem; }
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); color: var(--color-primary); margin: .2rem 0 .4rem; }
.section-head p { color: var(--color-muted); font-size: 1.05rem; margin: 0; }
.home .blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .16; z-index: 0; animation: floaty 9s ease-in-out infinite; }

/* Hero */
.home-hero { position: relative; color: #fff; overflow: hidden; isolation: isolate;
    background: linear-gradient(125deg, #15294b 0%, #1d3557 40%, #0a4f8c 100%); }
.home-hero .mesh { position: absolute; inset: -20% -10%; z-index: -2; filter: blur(55px); opacity: .85; }
.home-hero .mesh i { position: absolute; border-radius: 50%; mix-blend-mode: screen; animation: drift 16s ease-in-out infinite; }
.home-hero .mesh i:nth-child(1){ width: 420px; height: 420px; background: #00b4a6; left: 5%; top: 0; }
.home-hero .mesh i:nth-child(2){ width: 380px; height: 380px; background: #e63946; right: 8%; top: 8%; animation-delay: -4s; }
.home-hero .mesh i:nth-child(3){ width: 340px; height: 340px; background: #0077cc; left: 30%; bottom: -10%; animation-delay: -8s; }
.home-hero .mesh i:nth-child(4){ width: 260px; height: 260px; background: #ffb703; right: 25%; bottom: -6%; animation-delay: -12s; }
.home-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .1;
    background-image: linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px);
    background-size: 46px 46px; -webkit-mask: radial-gradient(circle at 70% 40%, #000, transparent 75%); mask: radial-gradient(circle at 70% 40%, #000, transparent 75%); }
.home-hero__grid { position: relative; z-index: 2; display: grid; grid-template-columns: 1.15fr .85fr; gap: 2rem; align-items: center; padding: 4rem 0 5rem; }
.home-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -.5px; margin: .3rem 0 .5rem; color: #fff; }
.home-hero__lead { font-size: 1.16rem; color: rgba(255,255,255,.92); max-width: 36ch; }
.home-hero__cta { display: flex; gap: .9rem; flex-wrap: wrap; margin-top: 1.7rem; }

.up { opacity: 0; transform: translateY(26px); animation: up .8s cubic-bezier(.2,.7,.2,1) forwards; }
.up.d1 { animation-delay: .05s; } .up.d2 { animation-delay: .18s; } .up.d3 { animation-delay: .32s; } .up.d4 { animation-delay: .46s; }

/* Sello + anillo 3D */
.seal-stage { position: relative; justify-self: center; width: 300px; height: 300px; display: grid; place-items: center; animation: floaty 6s ease-in-out infinite; }
.seal-stage .disc { position: absolute; width: 230px; height: 230px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #eef3f9); box-shadow: var(--shadow-lg), inset 0 -10px 24px rgba(20,40,70,.08); }
.seal-stage .ring { position: absolute; width: 286px; height: 286px; border-radius: 50%;
    background: conic-gradient(from 0deg, #e63946, #ffb703, #00b4a6, #0077cc, #e63946);
    -webkit-mask: radial-gradient(circle, transparent 128px, #000 130px); mask: radial-gradient(circle, transparent 128px, #000 130px);
    animation: spin 9s linear infinite; filter: drop-shadow(0 6px 18px rgba(0,0,0,.25)); }
.seal-stage img { position: relative; width: 188px; z-index: 3; }
.seal-stage .orbit { position: absolute; width: 300px; height: 300px; animation: spin 14s linear infinite; }
.seal-stage .orbit b { position: absolute; width: 14px; height: 14px; border-radius: 50%; top: -2px; left: 50%; background: var(--c-turquesa); box-shadow: 0 0 14px var(--c-turquesa); }
.seal-stage .orbit.r2 { animation-duration: 20s; animation-direction: reverse; }
.seal-stage .orbit.r2 b { background: var(--c-amarillo); box-shadow: 0 0 14px var(--c-amarillo); top: auto; bottom: -2px; }

/* Figuras 3D flotando */
.shapes { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.shape { position: absolute; transform-style: preserve-3d; }
.cube { width: 64px; height: 64px; animation: floaty 7s ease-in-out infinite; }
.cube .inner { position: absolute; inset: 0; transform-style: preserve-3d; animation: spin3d 11s linear infinite; }
.cube .f { position: absolute; width: 64px; height: 64px; background: linear-gradient(135deg, rgba(0,180,166,.85), rgba(0,119,204,.7)); border: 1px solid rgba(255,255,255,.25); }
.cube .f1 { transform: translateZ(32px); } .cube .f2 { transform: rotateY(180deg) translateZ(32px); }
.cube .f3 { transform: rotateY(90deg) translateZ(32px); } .cube .f4 { transform: rotateY(-90deg) translateZ(32px); }
.cube .f5 { transform: rotateX(90deg) translateZ(32px); } .cube .f6 { transform: rotateX(-90deg) translateZ(32px); }
.sphere { width: 80px; height: 80px; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #ffd66b, #ffb703 45%, #d98e00); box-shadow: 0 16px 30px rgba(217,142,0,.4); animation: floaty 5.5s ease-in-out infinite; }
.ring3 { width: 90px; height: 90px; border-radius: 50%; border: 14px solid rgba(230,57,70,.85); border-right-color: rgba(255,255,255,.25); border-top-color: rgba(255,255,255,.25); animation: spin 8s linear infinite, floaty 6.5s ease-in-out infinite; }
.s-a { left: 6%; top: 18%; } .s-b { right: 38%; top: 10%; } .s-c { left: 14%; bottom: 16%; }

/* Cuenta regresiva */
.countdown { display: flex; gap: .7rem; margin-top: 2rem; flex-wrap: wrap; align-items: stretch; }
.cd { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); border-radius: 14px; padding: .7rem 1rem; text-align: center; min-width: 78px; backdrop-filter: blur(6px); }
.cd b { display: block; font-size: 1.8rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.cd span { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; opacity: .85; margin-top: .25rem; display: block; }
.cd--label { display: flex; align-items: center; justify-content: center; gap: .55rem; min-width: 220px; background: linear-gradient(135deg, rgba(255,183,3,.28), rgba(230,57,70,.28)); border-color: rgba(255,183,3,.5); font-weight: 800; font-size: 1.02rem; white-space: nowrap; padding-inline: 1.3rem; }
.cd--label .pulse { width: 11px; height: 11px; border-radius: 50%; background: var(--c-amarillo); box-shadow: 0 0 0 0 rgba(255,183,3,.6); animation: pulse 1.8s infinite; }

.wave { position: absolute; left: 0; right: 0; bottom: -1px; z-index: 2; line-height: 0; }
.wave svg { width: 100%; height: 80px; display: block; }
.ecg { stroke: rgba(255,255,255,.5); stroke-width: 3; fill: none; stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 4s ease forwards; }

/* Bases */
.bases { position: relative; z-index: 1; background: linear-gradient(120deg, #eef0ff, #f4f7ff); border-radius: 24px; box-shadow: var(--shadow); display: grid; grid-template-columns: 1.4fr 1fr; gap: 0; overflow: hidden; transition: transform .25s ease, box-shadow .25s ease; }
.bases__body { padding: 2.6rem; }
.bases__body .eyebrow { color: var(--c-rojo); }
.bases__body h2 { color: var(--color-primary); font-size: 1.9rem; margin: .2rem 0 .6rem; }
.bases ul { list-style: none; padding: 0; margin: 1.3rem 0 0; display: grid; gap: .8rem; }
.bases li { display: flex; gap: .65rem; align-items: flex-start; font-size: 1.02rem; }
.bases li svg { flex: 0 0 auto; margin-top: 3px; }
.bases__card { position: relative; background: linear-gradient(160deg, #1d3557, #0f2742); color: #fff; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 1.1rem; text-align: center; padding: 2.6rem 1.8rem; overflow: hidden; }
.bases__card::after { content: ""; position: absolute; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(0,180,166,.4), transparent 70%); top: -60px; right: -60px; }
.bases__card small { color: rgba(255,255,255,.7); z-index: 2; }
.doc3d { width: 96px; height: 112px; position: relative; animation: floaty 4.5s ease-in-out infinite; z-index: 2; }
.doc3d .page { position: absolute; inset: 0; border-radius: 10px; background: linear-gradient(160deg, #fff, #dde7f2); box-shadow: 0 18px 30px rgba(0,0,0,.35); transform: perspective(500px) rotateY(-16deg); }
.doc3d .page::before { content: "PDF"; position: absolute; left: 12px; bottom: 12px; font-weight: 800; font-size: .7rem; color: var(--c-rojo); }
.doc3d .corner { position: absolute; top: 0; right: 0; width: 30px; height: 30px; background: linear-gradient(225deg, #b9c8d8, transparent); border-top-right-radius: 10px; }

/* Divisiones */
.divisions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.1rem; }
.dcard { background: #fff; border: 1px solid var(--color-border); border-radius: 18px; padding: 1.6rem 1rem; text-align: center; box-shadow: var(--shadow); transition: transform .25s ease, box-shadow .25s ease; will-change: transform; }
.dcard img { width: 104px; height: 104px; object-fit: contain; margin: 0 auto .9rem; animation: floaty 6s ease-in-out infinite; }
.dcard:nth-child(2) img { animation-delay: -1s; } .dcard:nth-child(3) img { animation-delay: -2s; }
.dcard:nth-child(4) img { animation-delay: -3s; } .dcard:nth-child(5) img { animation-delay: -4s; }
.dcard h3 { font-size: 1rem; color: var(--color-primary); margin: 0; }

/* Pasos */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }
.step { position: relative; background: #fff; border: 1px solid var(--color-border); border-radius: 20px; padding: 2.2rem 1.4rem 1.6rem; box-shadow: var(--shadow); transition: transform .25s ease, box-shadow .25s ease; will-change: transform; }
.step__ic { width: 78px; height: 78px; margin-bottom: 1rem; perspective: 600px; }
.step__ic svg { width: 100%; height: 100%; filter: drop-shadow(0 10px 16px rgba(20,40,70,.25)); animation: tilt3d 5s ease-in-out infinite; transform-style: preserve-3d; }
.step__n { position: absolute; top: -14px; right: 18px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; box-shadow: var(--shadow); }
.step:nth-child(1) .step__n { background: var(--c-rojo); } .step:nth-child(2) .step__n { background: var(--c-azul-salud); }
.step:nth-child(3) .step__n { background: var(--c-turquesa); } .step:nth-child(4) .step__n { background: var(--c-amarillo); color: var(--color-primary); }
.step h3 { font-size: 1.12rem; color: var(--color-primary); margin: 0 0 .3rem; }
.step p { color: var(--color-muted); font-size: .96rem; min-height: 3em; margin: 0; }
.when { margin-top: 1rem; display: inline-flex; align-items: center; gap: .45rem; font-weight: 800; font-size: 1.02rem; color: var(--color-primary); background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 12px; padding: .55rem .9rem; }
.when svg { flex: 0 0 auto; }

/* CTA */
.ctaband { position: relative; overflow: hidden; color: #fff; text-align: center; border-radius: 24px; padding: 3.6rem 1.5rem; background: linear-gradient(120deg, #e63946, #c81e2c 60%, #a8141f); }
.ctaband::before, .ctaband::after { content: ""; position: absolute; border-radius: 50%; opacity: .25; }
.ctaband::before { width: 300px; height: 300px; background: #ffb703; top: -120px; left: -60px; animation: floaty 7s ease-in-out infinite; }
.ctaband::after { width: 240px; height: 240px; background: #00b4a6; bottom: -110px; right: -40px; animation: floaty 6s ease-in-out infinite reverse; }
.ctaband h2 { font-size: 2rem; position: relative; margin: 0 0 .5rem; color: #fff; }
.ctaband p { color: rgba(255,255,255,.92); max-width: 52ch; margin: 0 auto 1.6rem; position: relative; }
.ctaband .button { position: relative; }

@media (max-width: 900px) {
    .home-hero__grid { grid-template-columns: 1fr; text-align: center; padding: 3rem 0 4rem; }
    .seal-stage { order: -1; width: 230px; height: 230px; }
    .seal-stage .disc { width: 175px; height: 175px; }
    .seal-stage .ring { width: 218px; height: 218px; -webkit-mask: radial-gradient(circle, transparent 96px, #000 98px); mask: radial-gradient(circle, transparent 96px, #000 98px); }
    .seal-stage img { width: 142px; }
    .seal-stage .orbit { width: 230px; height: 230px; }
    .home-hero__cta { justify-content: center; }
    .home-hero__lead { margin-inline: auto; }
    .shape { display: none; }
    .bases { grid-template-columns: 1fr; }
    .steps { grid-template-columns: repeat(2, 1fr); gap: 1.8rem 1.4rem; }
    .divisions { grid-template-columns: repeat(3, 1fr); }
    .cd--label { min-width: 100%; }
}
@media (max-width: 560px) {
    .divisions { grid-template-columns: repeat(2, 1fr); }
    .steps { grid-template-columns: 1fr; }
}

/* ===================== Animaciones ===================== */
@keyframes drift { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(40px,-30px) scale(1.12); } 66% { transform: translate(-30px,25px) scale(.92); } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin3d { from { transform: rotateX(0) rotateY(0); } to { transform: rotateX(360deg) rotateY(360deg); } }
@keyframes up { to { opacity: 1; transform: none; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,183,3,.6); } 70% { box-shadow: 0 0 0 12px rgba(255,183,3,0); } 100% { box-shadow: 0 0 0 0 rgba(255,183,3,0); } }
@keyframes draw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .up, .home .reveal { opacity: 1 !important; transform: none !important; }
    .ecg { stroke-dashoffset: 0; }
}

/* ---------- checklist en vivo de requisitos de contraseña (password-strength.js) ---------- */
.pw-reqs { list-style: none; margin: .45rem 0 0; padding: 0; display: grid; gap: .3rem; }
.pw-reqs li { display: flex; align-items: center; gap: .5rem; font-size: .84rem; color: var(--color-muted); transition: color .15s ease; }
.pw-reqs li .pw-ic {
    width: 16px; height: 16px; flex: none; border-radius: 50%;
    border: 1.5px solid var(--color-border); background: transparent;
    display: grid; place-items: center; font-size: 11px; line-height: 1; color: transparent;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.pw-reqs li .pw-ic::before { content: "✓"; }
.pw-reqs li.ok { color: var(--c-verde); }
.pw-reqs li.ok .pw-ic { border-color: var(--c-verde); background: var(--c-verde); color: #fff; }
