/* ==========================================================================
   JAPAcademy · Sistema visual académico
   Welcome · Login · Register
   ========================================================================== */

:root {
    /* Paleta "Tinta de sello": papel bond, tinta de firma y sello de secretaría */
    --ink: #1e2532;          /* tinta de firma: texto fuerte y superficies oscuras */
    --ink-2: #283142;
    --ink-3: #3b4556;
    --paper: #f4f6f8;        /* papel bond */
    --paper-2: #e9eef3;
    --surface: #ffffff;
    --line: #d3dce6;
    --line-strong: #b7c3d1;
    --text: #1e2532;
    --muted: #5a6474;
    --seal: #563a93;         /* violeta de sello: acciones y estados oficiales */
    --seal-ink: #44307a;
    --seal-soft: #efeaf8;
    --seal-on-dark: #c9b8f2;
    --accent: var(--seal);
    --accent-soft: var(--seal-soft);
    --accent-ink: var(--seal-ink);
    --success: #2f6b3f;      /* verde Boyacá */
    --success-soft: #e6f0e8;
    --danger: #b8382f;       /* rojo de margen */
    --danger-soft: #fbedec;
    --info: #2e64a6;         /* azul de renglón */
    --info-soft: #e6eef8;

    --font-display: 'Archivo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Archivo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --display-stretch: 118%;   /* Archivo expandida para títulos */
    --data-stretch: 87.5%;     /* Archivo condensada para códigos y cifras */

    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 8px;
    --shadow-sm: none;
    --shadow: 0 1px 0 rgba(30, 37, 50, .05);
    --shadow-lg: 0 24px 48px -28px rgba(30, 37, 50, .45), 0 2px 6px rgba(30, 37, 50, .06);
    --ring: 0 0 0 3px rgba(86, 58, 147, .3);

    --container: 1180px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }

h1, h2, h3, h4 {
    font-family: var(--font-display); font-stretch: var(--display-stretch);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.015em;
    margin: 0;
    color: var(--ink);
}

p { margin: 0; }

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

/* ---------- Marca ---------- */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display); font-stretch: var(--display-stretch);
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: -0.02em;
    color: var(--ink);
}
.brand__mark {
    width: 38px; height: 38px;
    border-radius: 6px;
    background: var(--ink);
    display: grid; place-items: center;
    flex-shrink: 0;
}
.brand__mark svg { width: 22px; height: 22px; }
.brand__name span { color: var(--accent); }
.brand--light { color: #fff; }
.brand--light .brand__mark { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); }

/* ---------- Botones ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: .95rem;
    line-height: 1.2;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
    white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--ink); color: #fff; box-shadow: 0 6px 16px -8px rgba(30, 37, 50, .6); }
.btn--primary:hover { background: var(--ink-3); }

.btn--accent { background: var(--accent); color: var(--ink); }
.btn--accent:hover { background: #6a4bae; }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--surface); border-color: var(--ink); }

.btn--ghost-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .3); }
.btn--ghost-light:hover { background: rgba(255, 255, 255, .08); border-color: #fff; }

.btn--link { padding: 0; background: none; color: var(--ink-3); font-weight: 600; }
.btn--link:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }

.btn--lg { padding: 15px 26px; font-size: 1rem; border-radius: 6px; }
.btn--block { width: 100%; }

.btn[data-loading="true"] { pointer-events: none; opacity: .85; }
.btn .spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Etiquetas ---------- */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--accent-ink);
}
.eyebrow::before {
    content: "";
    width: 22px; height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

.pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px 6px 6px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: .85rem; font-weight: 600; color: var(--muted);
    box-shadow: var(--shadow-sm);
}
.pill__tag {
    background: var(--accent-soft); color: var(--accent-ink);
    padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700;
}

/* ==========================================================================
   WELCOME
   ========================================================================== */

/* Navegación */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(244, 246, 248, .85);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s ease, background .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); background: rgba(244, 246, 248, .95); }

.nav {
    display: flex; align-items: center; justify-content: space-between;
    height: 76px; gap: 24px;
}
.nav__links { display: flex; gap: 32px; list-style: none; margin: 0; padding: 0; }
.nav__links a { font-weight: 600; font-size: .95rem; color: var(--muted); transition: color .15s ease; }
.nav__links a:hover { color: var(--ink); }
.nav__actions { display: flex; align-items: center; gap: 10px; }

.nav__toggle {
    display: none;
    width: 44px; height: 44px;
    border-radius: 6px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    cursor: pointer;
    align-items: center; justify-content: center;
}
.nav__toggle svg { width: 22px; height: 22px; }

.mobile-menu {
    display: none;
    border-top: 1px solid var(--line);
    padding: 16px 0 24px;
}
.mobile-menu.is-open { display: block; }
.mobile-menu ul { list-style: none; margin: 0 0 16px; padding: 0; }
.mobile-menu li a {
    display: block; padding: 12px 0;
    font-weight: 600; color: var(--ink);
    border-bottom: 1px solid var(--line);
}
.mobile-menu .btn { width: 100%; margin-top: 10px; }

/* Hero */
.hero {
    position: relative;
    padding: 72px 0 96px;
    overflow: hidden;
}
.hero::before {
    /* cuadrícula tipo cuaderno */
    content: "";
    position: absolute; inset: 0;
    background-image:
        linear-gradient(to right, rgba(30, 37, 50, .045) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(30, 37, 50, .045) 1px, transparent 1px);
    background-size: 40px 40px;
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 60% 40%, #000 30%, transparent 75%);
    mask-image: radial-gradient(ellipse 80% 70% at 60% 40%, #000 30%, transparent 75%);
    pointer-events: none;
}
.hero__grid {
    position: relative;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 64px;
    align-items: center;
}
.hero__title {
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 600;
    margin: 22px 0 22px;
}
.hero__title em {
    font-style: italic;
    font-weight: 500;
    color: var(--ink-3);
    position: relative;
    white-space: nowrap;
}
.hero__title em::after {
    content: "";
    position: absolute; left: 0; right: 0; bottom: .05em;
    height: .18em;
    background: var(--accent);
    opacity: .35;
    border-radius: 4px;
    z-index: -1;
}
.hero__lead { font-size: 1.15rem; color: var(--muted); max-width: 540px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero__checks {
    display: flex; flex-wrap: wrap; gap: 10px 24px;
    margin: 30px 0 0; padding: 0; list-style: none;
    font-size: .92rem; color: var(--muted); font-weight: 500;
}
.hero__checks li { display: flex; align-items: center; gap: 8px; }
.hero__checks svg { width: 18px; height: 18px; color: var(--success); flex-shrink: 0; }

/* Mockup del hero */
.mock { position: relative; padding: 24px 0 40px 32px; }
.mock__card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 26px;
}
.mock__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.mock__head h3 { font-size: 1.15rem; }
.mock__head small { display: block; font-family: var(--font-body); color: var(--muted); font-size: .8rem; font-weight: 500; margin-top: 4px; letter-spacing: 0; }
.mock__badge {
    font-size: .75rem; font-weight: 700;
    background: var(--success-soft); color: var(--success);
    padding: 5px 10px; border-radius: 999px;
}
.grade-row {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-top: 1px dashed var(--line);
}
.grade-row__icon {
    width: 36px; height: 36px; border-radius: 6px;
    display: grid; place-items: center;
    font-family: var(--font-display); font-stretch: var(--display-stretch); font-weight: 700; font-size: .95rem;
}
.grade-row__name { font-weight: 600; font-size: .92rem; }
.grade-row__bar { height: 6px; border-radius: 6px; background: var(--paper-2); margin-top: 6px; overflow: hidden; }
.grade-row__bar span { display: block; height: 100%; border-radius: 6px; }
.grade-row__score { font-family: var(--font-display); font-stretch: var(--display-stretch); font-weight: 700; font-size: 1.15rem; color: var(--ink); }

.c-blue  { background: var(--info-soft); color: var(--info); }
.c-gold  { background: var(--accent-soft); color: var(--accent-ink); }
.c-green { background: var(--success-soft); color: var(--success); }
.c-rose  { background: #fbe9ef; color: #a23b62; }
.bar-blue  { background: var(--info); }
.bar-gold  { background: var(--accent); }
.bar-green { background: var(--success); }
.bar-rose  { background: #c25079; }

.float {
    position: absolute;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 16px;
    display: flex; align-items: center; gap: 12px;
    animation: floaty 6s ease-in-out infinite;
}
.float__icon { width: 40px; height: 40px; border-radius: 6px; display: grid; place-items: center; flex-shrink: 0; }
.float__icon svg { width: 20px; height: 20px; }
.float strong { display: block; font-size: .95rem; color: var(--ink); line-height: 1.2; }
.float span { font-size: .8rem; color: var(--muted); }
.float--attendance { left: -8px; bottom: 0; }
.float--task { right: -14px; top: -6px; animation-delay: -3s; }

.ring {
    --p: 96;
    width: 44px; height: 44px; border-radius: 50%;
    background: conic-gradient(var(--success) calc(var(--p) * 1%), var(--paper-2) 0);
    display: grid; place-items: center;
    flex-shrink: 0;
}
.ring::after { content: ""; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); }

@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* Franja de niveles */
.levels {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}
.levels__inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 24px; padding: 26px 24px; flex-wrap: wrap;
}
.levels__label { font-size: .85rem; font-weight: 600; color: var(--muted); }
.levels__list { display: flex; gap: 36px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.levels__list li {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-display); font-stretch: var(--display-stretch); font-size: 1.1rem; font-weight: 600; color: var(--ink);
}
.levels__list svg { width: 22px; height: 22px; color: var(--accent); }

/* Secciones */
.section { padding: 104px 0; }
.section--tight { padding: 80px 0; }
.section__head { max-width: 680px; margin-bottom: 56px; }
.section__head--center { text-align: center; margin-left: auto; margin-right: auto; }
.section__head--center .eyebrow { justify-content: center; }
.section__title { font-size: clamp(1.9rem, 3.4vw, 2.75rem); margin: 16px 0 16px; }
.section__lead { color: var(--muted); font-size: 1.08rem; }

/* Funcionalidades */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.feature {
    background: var(--surface);
    padding: 34px 30px 36px;
    transition: background .2s ease;
}
.feature:hover { background: #f8fafc; }
.feature__icon {
    width: 48px; height: 48px; border-radius: 8px;
    display: grid; place-items: center;
    margin-bottom: 22px;
}
.feature__icon svg { width: 24px; height: 24px; }
.feature h3 { font-size: 1.25rem; margin-bottom: 10px; }
.feature p { color: var(--muted); font-size: .97rem; }

/* Roles */
.roles-section { background: var(--ink); color: #e4e8ef; position: relative; overflow: hidden; }
.roles-section::before {
    content: "";
    position: absolute; inset: 0;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, .04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, .04) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}
.roles-section .container { position: relative; }
.roles-section .section__title { color: #fff; }
.roles-section .section__lead { color: #b3bccb; }
.roles-section .eyebrow { color: var(--accent); }

.roles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.role {
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.role:hover { transform: translateY(-4px); background: rgba(255, 255, 255, .07); border-color: rgba(86, 58, 147, .5); }
.role__num { font-family: var(--font-display); font-stretch: var(--display-stretch); font-size: .9rem; color: var(--accent); font-weight: 600; }
.role h3 { color: #fff; font-size: 1.35rem; margin: 14px 0 10px; }
.role p { font-size: .94rem; color: #b3bccb; }
.role ul { list-style: none; margin: 18px 0 0; padding: 18px 0 0; border-top: 1px solid rgba(255, 255, 255, .1); }
.role li { display: flex; gap: 8px; font-size: .88rem; color: #e4e8ef; padding: 4px 0; }
.role li svg { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; margin-top: 4px; }

/* Pasos */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: step; }
.step { position: relative; padding-top: 28px; border-top: 2px solid var(--ink); }
.step__num {
    font-family: var(--font-display); font-stretch: var(--display-stretch);
    font-size: 3.2rem; line-height: 1; font-weight: 500; font-style: italic;
    color: var(--accent);
    display: block; margin-bottom: 16px;
}
.step h3 { font-size: 1.3rem; margin-bottom: 8px; }
.step p { color: var(--muted); }

/* CTA */
.cta {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 64px;
    display: grid;
    grid-template-columns: 1.3fr auto;
    align-items: center;
    gap: 40px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.cta::after {
    content: "";
    position: absolute; right: -80px; top: -80px;
    width: 280px; height: 280px; border-radius: 50%;
    background: radial-gradient(circle, var(--accent-soft), transparent 70%);
    pointer-events: none;
}
.cta h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin-bottom: 12px; }
.cta p { color: var(--muted); font-size: 1.05rem; }
.cta__actions { display: flex; gap: 12px; flex-wrap: wrap; position: relative; z-index: 1; }

/* Footer */
.site-footer { padding: 56px 0 40px; border-top: 1px solid var(--line); margin-top: 104px; }
.footer__grid { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer__about { max-width: 320px; }
.footer__about p { color: var(--muted); font-size: .93rem; margin-top: 14px; }
.footer__cols { display: flex; gap: 64px; flex-wrap: wrap; }
.footer__col h4 { font-family: var(--font-body); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 14px; }
.footer__col ul { list-style: none; margin: 0; padding: 0; }
.footer__col li { padding: 4px 0; }
.footer__col a { font-size: .95rem; font-weight: 500; color: var(--ink); }
.footer__col a:hover { color: var(--accent-ink); }
.footer__bottom {
    display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line);
    font-size: .85rem; color: var(--muted);
}

/* Aparición al hacer scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   AUTH (Login / Register)
   ========================================================================== */

.auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

/* Panel institucional */
.auth__aside {
    position: relative;
    background: var(--ink);
    color: #e4e8ef;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}
.auth__aside::before {
    content: "";
    position: absolute; inset: 0;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 36px 36px;
    pointer-events: none;
}
.auth__aside::after {
    content: "";
    position: absolute; right: -160px; bottom: -160px;
    width: 460px; height: 460px; border-radius: 50%;
    border: 1px solid rgba(86, 58, 147, .25);
    box-shadow: 0 0 0 60px rgba(86, 58, 147, .04), 0 0 0 120px rgba(86, 58, 147, .03);
    pointer-events: none;
}
.auth__aside > * { position: relative; z-index: 1; }

.auth__headline { max-width: 460px; }
.auth__headline .eyebrow { color: var(--accent); }
.auth__headline h2 {
    color: #fff;
    font-size: clamp(2rem, 3.2vw, 2.9rem);
    font-weight: 500;
    margin: 18px 0 18px;
}
.auth__headline h2 em { color: var(--accent); font-style: italic; }
.auth__headline p { color: #b3bccb; font-size: 1.05rem; }

.auth__points { list-style: none; margin: 36px 0 0; padding: 0; display: grid; gap: 16px; }
.auth__points li { display: flex; gap: 14px; align-items: flex-start; }
.auth__points .ico {
    width: 38px; height: 38px; border-radius: 6px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .12);
    display: grid; place-items: center; flex-shrink: 0;
    color: var(--accent);
}
.auth__points .ico svg { width: 18px; height: 18px; }
.auth__points strong { display: block; color: #fff; font-weight: 600; font-size: .98rem; }
.auth__points span { font-size: .9rem; color: #b3bccb; }

.auth__note {
    display: flex; gap: 14px; align-items: center;
    padding: 18px 20px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    font-size: .9rem; color: #cdd4df;
    max-width: 460px;
}
.auth__note svg { width: 22px; height: 22px; color: var(--accent); flex-shrink: 0; }

/* Panel del formulario */
.auth__main {
    display: flex;
    flex-direction: column;
    padding: 32px 48px;
    background: var(--paper);
}
.auth__topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.auth__topbar .brand { display: none; }
.auth__back { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; font-weight: 600; color: var(--muted); }
.auth__back:hover { color: var(--ink); }
.auth__back svg { width: 16px; height: 16px; }
.auth__switch { font-size: .9rem; color: var(--muted); }
.auth__switch a { font-weight: 700; color: var(--ink); margin-left: 4px; }
.auth__switch a:hover { color: var(--accent-ink); }

.auth__body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 0; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card__title { font-size: clamp(1.9rem, 3vw, 2.4rem); margin: 14px 0 10px; }
.auth-card__subtitle { color: var(--muted); margin-bottom: 32px; }

.auth__footer { text-align: center; font-size: .82rem; color: var(--muted); }

/* Formularios */
.form { display: grid; gap: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.field label,
.field .label {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: .88rem; font-weight: 600; color: var(--ink);
    margin-bottom: 8px;
}
.field label a { font-weight: 600; font-size: .85rem; color: var(--ink-3); }
.field label a:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }

.input-wrap { position: relative; }
.input-wrap > svg {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px; color: #7d8797; pointer-events: none;
    transition: color .15s ease;
}
.input {
    width: 100%;
    height: 50px;
    padding: 0 14px 0 44px;
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: 6px;
    font-size: .98rem;
    color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: #8b95a4; }
.input:hover { border-color: var(--line-strong); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input-wrap:focus-within > svg { color: var(--accent-ink); }
.input--has-action { padding-right: 48px; }

.input.is-invalid { border-color: var(--danger); background: #fff8f7; }
.input.is-invalid:focus { box-shadow: 0 0 0 4px rgba(180, 35, 24, .15); }

.input-action {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 38px; height: 38px;
    border: 0; border-radius: 6px;
    background: transparent;
    color: #7d8797;
    display: grid; place-items: center;
    cursor: pointer;
}
.input-action:hover { background: var(--paper); color: var(--ink); }
.input-action svg { width: 18px; height: 18px; }
.input-action .icon-hide { display: none; }
.input-action[aria-pressed="true"] .icon-show { display: none; }
.input-action[aria-pressed="true"] .icon-hide { display: block; }

.field-error {
    display: flex; gap: 6px; align-items: flex-start;
    margin-top: 8px;
    font-size: .85rem; font-weight: 500; color: var(--danger);
}
.field-error svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.field-hint { margin-top: 8px; font-size: .83rem; color: var(--muted); }

.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .92rem; color: var(--text); user-select: none; }
.check input {
    appearance: none; -webkit-appearance: none;
    width: 20px; height: 20px; margin: 0;
    border: 1.5px solid var(--line-strong);
    border-radius: 6px;
    background: var(--surface);
    display: grid; place-items: center;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
    flex-shrink: 0;
}
.check input::after {
    content: "";
    width: 10px; height: 6px;
    border-left: 2px solid #fff; border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translate(1px, -1px) scale(0);
    transition: transform .15s ease;
}
.check input:checked { background: var(--ink); border-color: var(--ink); }
.check input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.check input:focus-visible { box-shadow: var(--ring); }
.check a { font-weight: 600; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; }

.form-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Medidor de contraseña */
.strength { margin-top: 10px; }
.strength__bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.strength__bars span { height: 4px; border-radius: 4px; background: var(--line); transition: background .2s ease; }
.strength__label { font-size: .8rem; color: var(--muted); margin-top: 6px; font-weight: 500; }
.strength[data-level="1"] .strength__bars span:nth-child(-n+1) { background: var(--danger); }
.strength[data-level="2"] .strength__bars span:nth-child(-n+2) { background: var(--accent); }
.strength[data-level="3"] .strength__bars span:nth-child(-n+3) { background: #4e8a4f; }
.strength[data-level="4"] .strength__bars span:nth-child(-n+4) { background: var(--success); }

/* Alertas */
.alert {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 14px 16px;
    border-radius: 6px;
    font-size: .92rem;
    margin-bottom: 24px;
    border: 1px solid transparent;
}
.alert svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.alert--success { background: var(--success-soft); color: #24532f; border-color: #c3dcc8; }
.alert--danger { background: var(--danger-soft); color: #8e2a23; border-color: #efc9c5; }

.divider {
    display: flex; align-items: center; gap: 14px;
    margin: 28px 0;
    font-size: .82rem; color: var(--muted); font-weight: 500;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.auth-alt { text-align: center; font-size: .95rem; color: var(--muted); }
.auth-alt a { font-weight: 700; color: var(--ink); }
.auth-alt a:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1080px) {
    .roles { grid-template-columns: repeat(2, 1fr); }
    .auth__aside { padding: 40px; }
    .auth__main { padding: 28px 32px; }
}

@media (max-width: 960px) {
    .nav__links, .nav__actions .btn { display: none; }
    .nav__toggle { display: inline-flex; }

    .hero { padding: 48px 0 72px; }
    .hero__grid { grid-template-columns: 1fr; gap: 48px; }
    .mock { padding: 20px 8px 48px; max-width: 520px; }
    .float--task { right: 0; }
    .float--attendance { left: 0; }

    .features { grid-template-columns: repeat(2, 1fr); }
    .steps { grid-template-columns: 1fr; gap: 36px; }
    .cta { grid-template-columns: 1fr; padding: 44px 32px; }

    .auth { grid-template-columns: 1fr; }
    .auth__aside { display: none; }
    .auth__topbar .brand { display: inline-flex; }
    .auth__back { display: none; }
}

@media (max-width: 640px) {
    .container { padding: 0 16px; }
    .section { padding: 72px 0; }
    .section__head { margin-bottom: 40px; }
    .features { grid-template-columns: 1fr; }
    .roles { grid-template-columns: 1fr; }
    .levels__inner { padding: 22px 16px; }
    .levels__list { gap: 18px 24px; }
    .hero__cta .btn { flex: 1 1 100%; }
    .float { padding: 10px 12px; }
    .float strong { font-size: .85rem; }
    .float--task { top: -14px; }
    .mock__card { padding: 20px; }
    .footer__cols { gap: 40px; }
    .site-footer { margin-top: 72px; }

    .auth__main { padding: 20px 16px; }
    .auth__switch span { display: none; }
    .auth__body { padding: 28px 0; align-items: flex-start; }
    .form-row { grid-template-columns: 1fr; }
}

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

/* ==========================================================================
   Welcome: gestión institucional (módulos por área)
   ========================================================================== */
.grade-row__icon svg { width: 18px; height: 18px; }

.levels__list--modules { gap: 10px 12px; justify-content: flex-end; }
.levels__list--modules li {
    font-family: var(--font-body); font-size: .88rem; font-weight: 600;
    padding: 7px 14px 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
    gap: 8px;
}
.levels__list--modules svg { width: 17px; height: 17px; }
.levels__inner:has(.levels__list--modules) { flex-direction: column; align-items: flex-start; gap: 14px; }
.levels__inner:has(.levels__list--modules) .levels__list { justify-content: flex-start; }

.areas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.area {
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 30px 28px;
    box-shadow: var(--shadow-sm);
    scroll-margin-top: 96px;
}
.area__head { padding-bottom: 20px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.area__num { font-family: var(--font-display); font-stretch: var(--display-stretch); font-style: italic; font-size: 1.05rem; color: var(--accent-ink); font-weight: 600; }
.area__head h3 { font-size: 1.45rem; margin: 6px 0 6px; }
.area__head p { color: var(--muted); font-size: .95rem; }
.area__list { list-style: none; margin: 0; padding: 0; display: grid; }
.area__list li { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px dashed var(--line); }
.area__list li:last-child { border-bottom: 0; padding-bottom: 0; }
.area__icon { width: 42px; height: 42px; border-radius: 6px; display: grid; place-items: center; flex-shrink: 0; }
.area__icon svg { width: 21px; height: 21px; }
.area__list strong { display: block; color: var(--ink); font-size: 1rem; margin-bottom: 2px; }
.area__list span { display: block; color: var(--muted); font-size: .9rem; line-height: 1.5; }

.area--dark { background: var(--ink); border-color: var(--ink); position: relative; overflow: hidden; }
.area--dark::before {
    content: ""; position: absolute; inset: 0;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, .04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, .04) 1px, transparent 1px);
    background-size: 32px 32px; pointer-events: none;
}
.area--dark > * { position: relative; }
.area--dark .area__head { border-bottom-color: rgba(255, 255, 255, .12); }
.area--dark .area__num { color: var(--accent); }
.area--dark h3, .area--dark .area__list strong { color: #fff; }
.area--dark .area__head p, .area--dark .area__list span { color: #b3bccb; }
.area--dark .area__list li { border-bottom-color: rgba(255, 255, 255, .12); }
.area--dark .area__icon { background: rgba(86, 58, 147, .15); color: var(--accent); }

.areas__more {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin-top: 28px;
    color: var(--muted); font-size: .95rem; text-align: center;
}
.areas__more svg { width: 18px; height: 18px; color: var(--accent-ink); flex-shrink: 0; }

.section--tight-top { padding-top: 0; }

@media (max-width: 1080px) {
    .areas { grid-template-columns: minmax(0, 1fr); max-width: 680px; }
}
@media (max-width: 640px) {
    .area { padding: 24px 20px; }
    .levels__list--modules li { font-size: .82rem; padding: 6px 12px 6px 9px; }
    .areas__more { align-items: flex-start; text-align: left; justify-content: flex-start; }
}

/* Verificación de correo */
.verify-box{display:flex;gap:.75rem;align-items:flex-start;padding:1rem 1.1rem;margin:0 0 1.25rem;border:1px dashed var(--line, var(--line-strong));border-radius: 8px;background:var(--surface-2, rgba(0,0,0,.025));color:var(--ink-2, inherit);font-size:.92rem;line-height:1.5}
.verify-box svg{flex:none;width:20px;height:20px;margin-top:2px;color:var(--accent, currentColor)}
.verify-box p{margin:0}

/* ==========================================================================
   Estudiantes y familias (welcome)
   ========================================================================== */
.family-section { background: var(--paper-2); }
.family { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 56px; align-items: center; scroll-margin-top: 96px; }
.family__intro .section__lead { max-width: 560px; }
.family__list { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; }
.family__list li { display: flex; gap: 14px; align-items: flex-start; }
.family__list strong { display: block; color: var(--ink); font-size: 1rem; margin-bottom: 2px; }
.family__list span:not(.area__icon) { display: block; color: var(--muted); font-size: .9rem; line-height: 1.5; }

.process { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 30px 28px; box-shadow: var(--shadow); }
.process__head { padding-bottom: 18px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.process__tag { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent-soft); padding: 5px 10px; border-radius: 999px; }
.process__tag svg { width: 14px; height: 14px; }
.process__head h3 { font-size: 1.45rem; margin: 12px 0 4px; }
.process__head p { color: var(--muted); font-size: .95rem; }
.process__steps { list-style: none; margin: 0; padding: 0; }
.process__steps li { position: relative; display: flex; gap: 14px; padding: 14px 0; }
.process__steps li:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 46px; bottom: -10px; width: 2px; background: var(--line); }
.process__num { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-weight: 700; font-size: .9rem; background: var(--ink); color: #fff; position: relative; z-index: 1; }
.process__num svg { width: 16px; height: 16px; }
.process__steps li.is-done .process__num { background: var(--success); }
.process__steps strong { display: block; color: var(--ink); font-size: .98rem; }
.process__steps span:not(.process__num) { display: block; color: var(--muted); font-size: .88rem; line-height: 1.5; }

.roles { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 1080px) {
    .family { grid-template-columns: minmax(0, 1fr); gap: 40px; max-width: 720px; }
    .roles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .family__list { grid-template-columns: minmax(0, 1fr); }
    .process { padding: 24px 20px; }
    .roles { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Registro · selección de institución educativa
   ========================================================================== */
.form-group { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 6px; margin: 0; background: var(--paper); display: grid; gap: 16px; min-width: 0; }
.form-group > legend { padding: 0 8px; margin-left: -8px; }
.form-group__title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-ink); }
.form-group__title svg { width: 16px; height: 16px; }
.form-group .field-hint:last-child { margin-bottom: 10px; }
.input--select {
    appearance: none; -webkit-appearance: none; cursor: pointer;
    padding-right: 40px; text-overflow: ellipsis;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d6677' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
}
.input--select:disabled { cursor: not-allowed; background-color: var(--paper-2); color: var(--muted); }
.alert--warning { background: var(--accent-soft); color: var(--accent-ink); border-color: #d9cdf0; }

/* ==========================================================================
   Panel lateral de acceso: contenido junto y fijo mientras el formulario se desplaza
   ========================================================================== */
.auth { align-items: start; }
.auth__aside {
    position: sticky; top: 0;
    height: 100vh; min-height: 100vh;
    justify-content: flex-start;
    gap: 40px;
    overflow: hidden;
}
.auth__main { min-height: 100vh; }
.auth__headline h2 { margin: 14px 0 14px; }
.auth__points { margin-top: 28px; gap: 14px; }
.auth__note { margin-top: auto; }
/* La cuadrícula decorativa va en el fondo del panel para que lo cubra completo */
.auth__aside {
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 36px 36px;
    background-attachment: local;
}
.auth__aside::before { display: none; }
@media (max-height: 820px) {
    .auth__aside { gap: 26px; padding-top: 32px; padding-bottom: 32px; }
    .auth__headline h2 { font-size: clamp(1.7rem, 2.4vw, 2.2rem); margin: 10px 0 10px; }
    .auth__headline p { font-size: .98rem; }
    .auth__points { margin-top: 20px; gap: 10px; }
    .auth__points span { font-size: .86rem; }
    .auth__note { padding: 14px 16px; font-size: .85rem; }
}
@media (max-height: 700px) {
    .auth__note { display: none; }
}


/* ==========================================================================
   Tinta de sello · ajustes de la dirección visual
   Papel bond y tinta; el sello de secretaría es el único gesto fuerte.
   ========================================================================== */

/* Títulos: Archivo expandida, sin cursivas ni palabras resaltadas */
h1, h2, h3, h4 { font-stretch: var(--display-stretch); font-weight: 750; letter-spacing: -0.02em; }
h4 { font-stretch: 105%; letter-spacing: -0.01em; }
/* El título principal usa la misma escala que los títulos de sección (DESIGN.md) */
.hero__title { font-size: clamp(1.9rem, 3.4vw, 2.75rem); font-weight: 750; letter-spacing: -0.02em; line-height: 1.12; margin: 16px 0; }
.hero__title em,
.auth__headline h2 em { font-style: normal; font-weight: inherit; color: inherit; white-space: normal; }
.hero__title em::after { display: none; }
.auth__headline h2 { font-weight: 750; }
.step__num, .area__num { font-style: normal; font-weight: 800; }
.step__num { font-size: 2.6rem; color: var(--seal); }

/* Marca: un sello cuadrado con visto bueno */
.brand { font-stretch: var(--display-stretch); font-weight: 800; letter-spacing: -0.01em; }
.brand__mark { background: none; border: 0; width: 36px; height: 36px; }
.brand__mark svg { width: 36px; height: 36px; }
.brand__name span { color: inherit; }
.brand--light .brand__mark { background: none; border: 0; }

/* Rótulos en frase normal, sin mayúsculas espaciadas */
.eyebrow { font-size: .9rem; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--seal); }
.eyebrow::before { display: none; }
.pill { box-shadow: none; border-radius: var(--radius); }
.pill__tag { border-radius: var(--radius-sm); }

/* Botones: el violeta se reserva para la acción principal */
.btn { border-radius: var(--radius); }
.btn--primary { background: var(--seal); color: #fff; box-shadow: none; }
.btn--primary:hover { background: var(--seal-ink); }
.btn--accent { background: var(--seal); color: #fff; }
.btn--accent:hover { background: #6a4bae; }
.btn--ghost { border-width: 2px; }

/* Superficies oscuras (tinta): el violeta se aclara para conservar el contraste */
.roles-section .eyebrow,
.auth__headline .eyebrow,
.role__num,
.role li svg { color: var(--seal-on-dark); }
.role:hover { transform: none; border-color: rgba(201, 184, 242, .45); }

/* Sin brillos ni halos decorativos */
.cta::after,
.auth__aside::after { display: none; }
.cta { box-shadow: none; }
.process, .mock__card { box-shadow: none; }

/* ---------- Sello de secretaría ---------- */
.sello {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 8px;
    border: 2px solid currentColor; border-radius: var(--radius-sm);
    color: var(--seal);
    font-family: var(--font-display);
    font-size: .72rem; font-weight: 800; font-stretch: 112%;
    letter-spacing: .08em; text-transform: uppercase;
    line-height: 1.2; white-space: nowrap;
}
.sello--ok { color: var(--success); }
.sello--bad { color: var(--danger); }
.sello--draft { color: var(--muted); border-style: dashed; }
.sello--lg {
    flex-direction: column; gap: 4px;
    padding: 9px 16px 8px;
    border-width: 3px; border-radius: var(--radius);
    outline: 1.5px solid currentColor; outline-offset: 3px;
    font-size: 1.1rem; line-height: 1;
    transform: rotate(-5deg);
    opacity: .92;
    mix-blend-mode: multiply;
    -webkit-mask-image: radial-gradient(circle at 30% 40%, #000 55%, rgba(0, 0, 0, .72) 75%, #000 100%);
    mask-image: radial-gradient(circle at 30% 40%, #000 55%, rgba(0, 0, 0, .72) 75%, #000 100%);
}
.sello--lg small { font-size: .6rem; letter-spacing: .12em; font-weight: 700; font-variant-numeric: tabular-nums; }
.sello--drop { animation: sello-cae .5s cubic-bezier(.2, .9, .3, 1.2) .5s both; }
@keyframes sello-cae {
    0% { opacity: 0; transform: translateY(-18px) scale(1.5) rotate(-12deg); }
    70% { opacity: .95; }
    100% { opacity: .92; transform: translateY(0) scale(1) rotate(-5deg); }
}
@media (prefers-reduced-motion: reduce) {
    .sello--drop { animation: none; }
}

/* ---------- Bienvenida: hoja del formato de renovación ---------- */
.paper-form-wrap { position: relative; padding: 16px 0 44px; display: flex; justify-content: center; }
.paper-form {
    width: 100%; max-width: 480px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 26px 28px 30px;
    display: grid; gap: 14px;
    transform: rotate(1.2deg);
}
.paper-form__head { display: flex; justify-content: space-between; gap: 12px; border-bottom: 2px solid var(--ink); padding-bottom: 10px; }
.paper-form__head strong { font-family: var(--font-display); font-stretch: 112%; font-size: .95rem; }
.paper-form__head span,
.paper-form .is-data { font-stretch: var(--data-stretch); font-variant-numeric: tabular-nums; }
.paper-form__head span { font-size: .82rem; color: var(--muted); }
.paper-form__grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); border: 1px solid #9aa6b5; font-size: .82rem; }
.paper-form__grid dt,
.paper-form__grid dd { margin: 0; padding: 8px 10px; border-bottom: 1px solid #9aa6b5; }
.paper-form__grid dt { background: var(--paper); font-weight: 700; border-right: 1px solid #9aa6b5; }
.paper-form__grid dt:nth-last-of-type(1),
.paper-form__grid dd:last-child { border-bottom: 0; }
.paper-form__consents { display: grid; gap: 6px; font-size: .82rem; }
.paper-form__signs { display: flex; gap: 28px; margin-top: 18px; }
.paper-form__signs span { flex: 1; border-top: 1px solid var(--ink); padding-top: 6px; font-size: .75rem; color: var(--ink-3); }
.paper-form-wrap .sello--lg { position: absolute; right: 4%; bottom: 10px; font-size: 1.5rem; }
@media (max-width: 560px) {
    .paper-form { padding: 20px 18px 24px; transform: none; }
    .paper-form-wrap .sello--lg { font-size: 1.15rem; right: 2%; }
}
.brand__mark { color: var(--seal); }
.brand--light .brand__mark { color: var(--seal-on-dark); }
.brand--light .brand__check { stroke: var(--ink); }

/* Rótulos en frase normal: solo el sello va en mayúsculas */
.footer__col h4,
.process__tag,
.form-group__title { text-transform: none; letter-spacing: 0; font-size: .86rem; }
.auth__points .ico,
.auth__note svg { color: var(--seal-on-dark); }

/* Códigos (DANE, NIT, documentos): Archivo condensada con cifras alineadas */
code, kbd, samp { font-family: var(--font-body); font-stretch: var(--data-stretch); font-variant-numeric: tabular-nums; font-weight: 600; }

/* ==========================================================================
   Documentos legales: términos, política de datos y solicitudes
   ========================================================================== */
.t-danger { color: var(--danger); }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--radius); }
.skip-link:focus { top: 12px; }

.legal-body { background: var(--paper); color: var(--text); }
.legal-top { background: var(--surface); border-bottom: 1px solid var(--line); }
.legal-top__inner { max-width: 1120px; margin: 0 auto; padding: 14px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.legal-top__nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; font-size: .92rem; font-weight: 600; }
.legal-top__nav a:not(.btn) { color: var(--ink-3); padding: 6px 0; border-bottom: 2px solid transparent; }
.legal-top__nav a:not(.btn):hover { color: var(--ink); }
.legal-top__nav a[aria-current="page"] { color: var(--seal-ink); border-bottom-color: var(--seal); }
.legal-main { max-width: 1120px; margin: 0 auto; padding: 40px 24px 72px; }
.legal-foot { border-top: 1px solid var(--line); }
.legal-foot__inner { max-width: 1120px; margin: 0 auto; padding: 18px 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: .85rem; color: var(--muted); }

.legal-doc { display: grid; grid-template-columns: minmax(0, 70ch) minmax(200px, 1fr); column-gap: 56px; row-gap: 8px; align-items: start; }
.legal-doc > * { grid-column: 1; }
.legal-doc--narrow { grid-template-columns: minmax(0, 70ch); }
.legal-doc__head { display: grid; gap: 10px; padding-bottom: 22px; margin-bottom: 8px; border-bottom: 2px solid var(--ink); justify-items: start; }
.legal-doc__head h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.05; font-weight: 800; }
.legal-doc__meta { font-size: .88rem; font-weight: 600; color: var(--muted); }
.legal-doc__lead { font-size: 1.08rem; color: var(--ink-3); }
.legal-doc section { padding: 26px 0 6px; scroll-margin-top: 16px; }
.legal-doc h2 { font-size: 1.35rem; margin-bottom: 12px; font-weight: 750; }
.legal-doc h3 { font-size: 1.02rem; margin: 18px 0 6px; font-stretch: 105%; }
.legal-doc p, .legal-doc li { line-height: 1.65; }
.legal-doc p + p { margin-top: 12px; }
.legal-doc ul { margin: 8px 0 0; padding-left: 1.2em; display: grid; gap: 6px; }
.legal-doc a:not(.btn) { color: var(--info); text-decoration: underline; text-underline-offset: 3px; }
.legal-doc__also { margin-top: 24px; font-weight: 600; }

/* Índice de contenido: columna lateral fija en escritorio */
.legal-toc { grid-column: 2; grid-row: 1 / span 30; position: sticky; top: 24px; padding: 4px 0 4px 20px; border-left: 1px solid var(--line-strong); }
.legal-toc ol { margin: 0; padding-left: 1.4em; display: grid; gap: 7px; font-size: .88rem; }
.legal-toc a { color: var(--ink-3); }
.legal-toc a:hover { color: var(--seal-ink); text-decoration: underline; text-underline-offset: 3px; }

/* Datos del Responsable */
.legal-card { margin: 16px 0; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 18px 20px; display: grid; gap: 14px; }
.legal-card__picker { display: grid; gap: 6px; }
.legal-card__picker label { font-size: .88rem; font-weight: 700; }
.legal-card__picker-row { display: flex; gap: 10px; flex-wrap: wrap; }
.legal-card__picker-row .select { flex: 1 1 260px; }
.legal-card__hint { font-size: .92rem; color: var(--muted); }
.legal-card__facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 24px; }
.legal-card__facts > div { padding: 9px 0; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.legal-card__facts dt { font-size: .8rem; font-weight: 700; color: var(--muted); }
.legal-card__facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.legal-card__facts--boxed { margin: 18px 0; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 6px 20px; }

.table-scroll { overflow-x: auto; }
.legal-table { width: 100%; border-collapse: collapse; font-size: .94rem; background: var(--surface); border: 1px solid var(--line-strong); }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.legal-table th { background: var(--paper); font-size: .85rem; }
.legal-table td:first-child { font-weight: 700; white-space: nowrap; }
.legal-defs { margin: 0; display: grid; }
.legal-defs > div { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 4px 16px; padding: 9px 0; border-top: 1px solid var(--line); }
.legal-defs dt { font-weight: 700; }
.legal-defs dd { margin: 0; color: var(--ink-3); }
.legal-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 16px 0; }
.legal-steps > div { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 16px 18px; }
.legal-steps h3 { margin-top: 0; }

/* Formularios legales */
.legal-terms { list-style: none; padding: 0 !important; margin: 4px 0 8px !important; }
.legal-form { display: grid; gap: 20px; margin-top: 12px; }
.legal-form fieldset { margin: 0; padding: 18px 20px 20px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); display: grid; gap: 16px; }
.legal-form fieldset[hidden] { display: none; }
.legal-form legend { padding: 0 6px; margin-left: -6px; font-weight: 750; font-stretch: 105%; }
.legal-form textarea { min-height: 120px; resize: vertical; }
.radio-list { display: grid; gap: 8px; margin-top: 4px; }
.input-pair { display: flex; gap: 8px; }
.input-pair .select { flex: 0 0 auto; }
.input-pair .input { flex: 1 1 auto; min-width: 0; }
.legal-accept { display: grid; gap: 12px; margin-top: 18px; }
.legal-accept__note { font-size: .88rem; color: var(--muted); }
.legal-accept__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.legal-doc .sello--lg { margin: 4px 0 10px 4px; }

.auth__footer a, .dash__footer a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.auth__footer a:hover, .dash__footer a:hover { color: var(--seal-ink); }

@media (max-width: 900px) {
    .legal-doc { grid-template-columns: minmax(0, 1fr); }
    .legal-toc { grid-column: 1; grid-row: auto; position: static; border-left: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; }
    .legal-defs > div { grid-template-columns: minmax(0, 1fr); }
}
/* Listas con nombres largos de instituciones: no imponen su ancho en el celular */
.legal-card, .legal-card > *, .legal-form, .legal-form fieldset, .legal-form .field { min-width: 0; }
.legal-card .select, .legal-form .select { width: 100%; max-width: 100%; min-width: 0; text-overflow: ellipsis; }
.legal-card__picker-row .select { width: auto; flex: 1 1 200px; }
.input-pair .select { width: auto; flex: 0 0 auto; }
.legal-doc > * { min-width: 0; }
.legal-card__picker { grid-template-columns: minmax(0, 1fr); } .legal-card__picker-row { min-width: 0; }

/* Formularios legales y de solicitudes: casillas alineadas a la izquierda, áreas de texto con la letra del sitio */
textarea { font: inherit; }
.field .check { display: flex; justify-content: flex-start; align-items: flex-start; margin-bottom: 0; font-weight: 500; }
.field .check input { margin-top: 2px; }
.check input[type="radio"] { border-radius: 50%; }
.legal-form .field label:not(.check) { justify-content: flex-start; gap: 6px; }
.legal-form textarea, .hd-form textarea { height: auto; min-height: 140px; padding: 12px 14px; line-height: 1.55; }
.hd-form textarea[rows="3"] { min-height: 90px; }

/* ==========================================================================
   Solicitudes sobre datos personales (diseño de acceso)
   ========================================================================== */
.form-group[hidden] { display: none; }
.label-optional { font-weight: 500; color: var(--muted); font-size: .8rem; }
.field label .label-optional { margin-left: auto; }
.form-row--doc { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }

/* Área de texto con ícono, como los demás campos */
.input--area { height: auto; min-height: 132px; padding: 12px 14px 12px 44px; line-height: 1.55; resize: vertical; }
.input-wrap--area > svg { top: 15px; transform: none; }

/* Opciones en filas seleccionables */
.choice-list { display: grid; gap: 8px; }
.choice {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 14px; cursor: pointer;
    background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius);
    transition: border-color .15s ease, background .15s ease;
}
.choice:hover { border-color: var(--line-strong); }
.choice input {
    appearance: none; -webkit-appearance: none; flex-shrink: 0;
    width: 20px; height: 20px; margin: 1px 0 0; border-radius: 50%;
    border: 1.5px solid var(--line-strong); background: var(--surface);
    display: grid; place-items: center; cursor: pointer;
}
.choice input::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--seal); transform: scale(0); transition: transform .12s ease; }
.choice input:checked { border-color: var(--seal); }
.choice input:checked::after { transform: scale(1); }
.choice input:focus-visible { box-shadow: var(--ring); }
.choice:has(input:checked) { border-color: var(--seal); background: var(--seal-soft); }
.choice__text { display: grid; gap: 2px; min-width: 0; }
.choice__text strong { font-size: .95rem; color: var(--ink); }
.choice__text span { font-size: .86rem; color: var(--ink-3); }
.choice__text em { font-style: normal; font-size: .78rem; font-weight: 600; color: var(--muted); font-stretch: var(--data-stretch); }

.form-note { font-size: .85rem; color: var(--muted); text-align: center; }
.form-note a { color: var(--ink-3); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Comprobante de radicado */
.auth-card > .sello--lg { margin: 6px 0 6px 4px; }
.receipt { margin: 22px 0; display: grid; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.receipt > div { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 4px 16px; padding: 12px 16px; border-top: 1px solid var(--line); }
.receipt > div:first-child { border-top: 0; }
.receipt dt { font-size: .85rem; font-weight: 700; color: var(--muted); }
.receipt dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.receipt__main dd code { font-size: 1.35rem; font-weight: 800; color: var(--seal-ink); }
@media (max-width: 560px) {
    .form-row--doc { grid-template-columns: minmax(0, 1fr); }
    .receipt > div { grid-template-columns: minmax(0, 1fr); }
}
/* Las opciones son etiquetas dentro de un campo: se alinean a la izquierda */
.field label.choice { justify-content: flex-start; align-items: flex-start; margin-bottom: 0; font-weight: 500; }
/* Panel institucional fijo a la altura de la ventana cuando el formulario es largo */
@media (min-width: 961px) {
    .auth__aside { position: sticky; top: 0; height: 100vh; align-self: start; overflow-y: auto; }
}
