/* =====================================================================
   TENANCY - AI SCHOOL · Hoja de estilos maestra
   Ubicación: public_html/assets/css/app.css
   Identidad: tech-university premium (navy · índigo · teal · blueprint)
   ===================================================================== */

/* ------------------------------------------------------------------
   1. TOKENS DE DISEÑO
   ----------------------------------------------------------------- */
:root {
    /* Color — núcleo */
    --navy:        #0E1A33;
    --navy-soft:   #1B2A4A;
    --indigo:      #3A5AF0;
    --indigo-dark: #2942C4;
    --teal:        #0FB5A6;
    --violet:      #8B5CF6;

    /* Color — neutros */
    --ink:     #0B1220;
    --slate:   #5A6270;
    --muted:   #8A93A6;
    --line:    #E3E7F2;
    --line-soft:#EEF1FA;
    --bg:      #F6F8FD;
    --surface: #FFFFFF;

    /* Color — estados */
    --success: #12B76A;
    --warning: #E8A13A;
    --danger:  #E5484D;

    /* Tipografías */
    --font-display: 'Sora', system-ui, -apple-system, sans-serif;
    --font-body:    'Inter', system-ui, -apple-system, sans-serif;
    --font-mono:    'JetBrains Mono', ui-monospace, 'Courier New', monospace;

    /* Escala tipográfica */
    --fs-xs:   0.75rem;
    --fs-sm:   0.8125rem;
    --fs-base: 0.9375rem;
    --fs-md:   1.0625rem;
    --fs-lg:   1.25rem;
    --fs-xl:   1.5rem;
    --fs-2xl:  1.875rem;
    --fs-3xl:  2.375rem;
    --fs-4xl:  3.25rem;

    /* Radios */
    --r-sm:  8px;
    --r:     12px;
    --r-lg:  16px;
    --r-xl:  24px;
    --r-pill: 999px;

    /* Sombras (tintadas con navy para calidez fría) */
    --shadow-sm: 0 1px 2px rgba(14,26,51,.06), 0 1px 3px rgba(14,26,51,.04);
    --shadow:    0 4px 16px rgba(14,26,51,.08), 0 2px 6px rgba(14,26,51,.05);
    --shadow-lg: 0 24px 60px rgba(14,26,51,.16), 0 8px 24px rgba(14,26,51,.08);
    --ring:      0 0 0 4px rgba(58,90,240,.16);

    /* Movimiento */
    --t:      160ms cubic-bezier(.4, 0, .2, 1);
    --t-slow: 320ms cubic-bezier(.4, 0, .2, 1);

    /* Layout */
    --container: 1160px;
    --nav-h: 72px;
}

/* ------------------------------------------------------------------
   2. RESET / BASE
   ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; }

body {
    font-family: var(--font-body);
    font-size: var(--fs-base);
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }

::selection { background: rgba(58,90,240,.18); color: var(--navy); }

/* ------------------------------------------------------------------
   3. TIPOGRAFÍA
   ----------------------------------------------------------------- */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--navy);
    line-height: 1.15;
    letter-spacing: -0.02em;
    font-weight: 700;
}
h1 { font-size: var(--fs-4xl); font-weight: 800; }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p  { color: var(--slate); }
strong { color: var(--ink); font-weight: 600; }

.lead { font-size: var(--fs-md); color: var(--slate); line-height: 1.65; }

/* Eyebrow: etiqueta mono estilo "código de curso" — firma de la marca */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--teal);
}
.eyebrow::before {
    content: "";
    width: 22px;
    height: 1px;
    background: var(--teal);
    opacity: .7;
}

.text-gradient {
    background: linear-gradient(100deg, var(--indigo), var(--teal));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ------------------------------------------------------------------
   4. LAYOUT
   ----------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 24px;
}
.section { padding-block: clamp(3.5rem, 8vw, 6rem); }

/* Grilla blueprint — el motivo firma sobre fondos navy */
.grid-bg {
    background-color: var(--navy);
    background-image:
        linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
    background-size: 28px 28px;
    background-position: center;
}

/* ------------------------------------------------------------------
   5. BOTONES
   ----------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--fs-base);
    line-height: 1;
    padding: 0.85rem 1.6rem;
    border-radius: var(--r);
    border: 1px solid transparent;
    transition: transform var(--t), box-shadow var(--t), background var(--t), border-color var(--t);
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--indigo);
    color: #fff;
    box-shadow: 0 6px 18px rgba(58,90,240,.28);
}
.btn-primary:hover {
    background: var(--indigo-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(58,90,240,.36);
}

.btn-ghost {
    background: transparent;
    color: var(--navy);
    border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--indigo); color: var(--indigo); background: #fff; }

.btn-light { background: #fff; color: var(--navy); box-shadow: var(--shadow-sm); }
.btn-light:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.btn-block { width: 100%; }
.btn-lg { padding: 1.05rem 2rem; font-size: var(--fs-md); }
.btn-sm { padding: 0.6rem 1.1rem; font-size: var(--fs-sm); }

/* ------------------------------------------------------------------
   6. FORMULARIOS
   ----------------------------------------------------------------- */
.field { margin-bottom: 1.15rem; }

.label {
    display: block;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 0.5rem;
}

.input, .textarea, .select {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: var(--fs-base);
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    transition: border-color var(--t), box-shadow var(--t);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }

.input:focus, .textarea:focus, .select:focus {
    outline: none;
    border-color: var(--indigo);
    box-shadow: var(--ring);
}
.input.is-invalid, .textarea.is-invalid, .select.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(229,72,77,.12);
}

.field-error {
    display: block;
    margin-top: 0.4rem;
    font-size: var(--fs-sm);
    color: var(--danger);
}

.input-group { position: relative; }
.input-group .input { padding-right: 3rem; }
.input-toggle {
    position: absolute;
    right: 0.5rem; top: 50%;
    transform: translateY(-50%);
    padding: 0.4rem 0.6rem;
    color: var(--muted);
    font-size: var(--fs-sm);
    font-family: var(--font-mono);
}
.input-toggle:hover { color: var(--indigo); }

/* Checkbox */
.check {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: var(--fs-sm);
    color: var(--slate);
    line-height: 1.5;
    cursor: pointer;
}
.check input {
    width: 18px; height: 18px;
    margin-top: 1px;
    accent-color: var(--indigo);
    cursor: pointer;
    flex-shrink: 0;
}
.check a { color: var(--indigo); font-weight: 600; }

/* ------------------------------------------------------------------
   7. ALERTAS (flash messages)
   ----------------------------------------------------------------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.85rem 1.1rem;
    border-radius: var(--r);
    font-size: var(--fs-sm);
    line-height: 1.5;
    margin-bottom: 1.1rem;
    border: 1px solid transparent;
}
.alert-icon { flex-shrink: 0; font-weight: 700; font-family: var(--font-mono); }
.alert-success { background: #E7F8F0; color: #0A6B41; border-color: #BCEBD4; }
.alert-error   { background: #FDECEC; color: #A32328; border-color: #F6C9CB; }
.alert-info    { background: #EAEFFF; color: #2942C4; border-color: #CBD6FB; }
.alert-warning { background: #FDF3E4; color: #97671A; border-color: #F5DDB4; }

/* ------------------------------------------------------------------
   8. NAVBAR
   ----------------------------------------------------------------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--nav-h);
    background: rgba(246,248,253,.82);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}
.nav-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}
.brand { display: inline-flex; align-items: baseline; gap: 7px; }
.brand-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    color: var(--navy);
}
.brand-sub {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    color: var(--teal);
    text-transform: uppercase;
}
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-link {
    font-size: var(--fs-base);
    font-weight: 500;
    color: var(--slate);
    transition: color var(--t);
    position: relative;
}
.nav-link:hover, .nav-link.active { color: var(--navy); }
.nav-link.active::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -26px;
    height: 2px; background: var(--indigo); border-radius: 2px;
}
.nav-actions { display: flex; align-items: center; gap: 0.9rem; }
.nav-actions-desktop { display: flex; align-items: center; gap: 0.9rem; }
.nav-mobile-actions { display: none; }

.nav-toggle { display: none; padding: 0.4rem; color: var(--navy); }

/* ------------------------------------------------------------------
   9. FOOTER
   ----------------------------------------------------------------- */
.footer { background: var(--navy); color: rgba(255,255,255,.72); }
.footer-top {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 2.5rem;
    padding-block: 3.5rem;
}
.footer .brand-name { color: #fff; }
.footer p { color: rgba(255,255,255,.6); font-size: var(--fs-sm); margin-top: 0.9rem; max-width: 30ch; }
.footer-col h5 {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 1rem;
    font-weight: 600;
}
.footer-col a { display: block; color: rgba(255,255,255,.72); font-size: var(--fs-base); padding: 0.35rem 0; transition: color var(--t); }
.footer-col a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    padding-block: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: var(--fs-sm);
    color: rgba(255,255,255,.5);
}

/* ------------------------------------------------------------------
   10. AUTENTICACIÓN (split-screen)
   ----------------------------------------------------------------- */
.auth {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 100vh;
}

/* Panel de marca (izquierda) */
.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem;
    color: #fff;
    overflow: hidden;
}
.auth-brand::after { /* resplandor índigo */
    content: "";
    position: absolute;
    width: 480px; height: 480px;
    right: -140px; top: -120px;
    background: radial-gradient(circle, rgba(58,90,240,.55), transparent 62%);
    filter: blur(20px);
    pointer-events: none;
}
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand .brand-name { color: #fff; }
.auth-brand-headline {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: #fff;
    max-width: 14ch;
}
.auth-brand-headline em { font-style: normal; color: var(--teal); }
.auth-brand-text { color: rgba(255,255,255,.72); margin-top: 1.1rem; max-width: 34ch; font-size: var(--fs-md); }

.auth-badges { display: flex; flex-direction: column; gap: 0.85rem; margin-top: 2rem; }
.auth-badge { display: flex; align-items: center; gap: 0.7rem; color: rgba(255,255,255,.85); font-size: var(--fs-base); }
.auth-badge span {
    display: grid; place-items: center;
    width: 26px; height: 26px; flex-shrink: 0;
    border-radius: 7px;
    background: rgba(15,181,166,.16);
    color: var(--teal);
    font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700;
}
.auth-note { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: .1em; color: rgba(255,255,255,.45); }

/* Panel de formulario (derecha) */
.auth-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 2.5rem 1.5rem;
    background: var(--surface);
}
.auth-card { width: 100%; max-width: 400px; animation: rise var(--t-slow) both; }
.auth-card .eyebrow { margin-bottom: 1rem; }
.auth-card h1 { font-size: var(--fs-2xl); margin-bottom: 0.5rem; }
.auth-card .sub { color: var(--slate); margin-bottom: 1.9rem; font-size: var(--fs-base); }

.auth-mobile-brand { display: none; }

.auth-alt {
    margin-top: 1.6rem;
    padding-top: 1.4rem;
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: var(--fs-base);
    color: var(--slate);
}
.auth-alt a { color: var(--indigo); font-weight: 600; }
.auth-forgot { font-size: var(--fs-sm); color: var(--indigo); font-weight: 500; }
.field-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }

/* ------------------------------------------------------------------
   11. UTILIDADES
   ----------------------------------------------------------------- */
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.text-center { text-align: center; }
.hidden { display: none; }

/* ------------------------------------------------------------------
   12. ANIMACIONES
   ----------------------------------------------------------------- */
@keyframes rise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ------------------------------------------------------------------
   13. FOCO VISIBLE (accesibilidad)
   ----------------------------------------------------------------- */
:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; border-radius: 4px; }

/* ------------------------------------------------------------------
   14. RESPONSIVE
   ----------------------------------------------------------------- */
@media (max-width: 900px) {
    .footer-top { grid-template-columns: 1fr 1fr; gap: 2rem; }
    .auth { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-mobile-brand {
        display: flex; justify-content: center;
        padding-top: 2rem;
        background: var(--surface);
    }
}
@media (max-width: 720px) {
    :root { --fs-4xl: 2.5rem; --fs-3xl: 1.9rem; }
    .nav-links { display: none; }
    .nav-actions-desktop { display: none; }
    .nav-toggle { display: block; }
    .nav-links.open {
        display: flex; flex-direction: column; align-items: flex-start;
        gap: 1rem; position: absolute; top: var(--nav-h); left: 0; right: 0;
        background: var(--surface); padding: 1.5rem 24px;
        border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
        max-height: calc(100vh - var(--nav-h)); overflow-y: auto;
    }
    .nav-mobile-actions { display: flex; flex-direction: column; gap: .6rem; width: 100%; margin-top: .6rem; padding-top: 1rem; border-top: 1px solid var(--line); }
    .nav-link.active::after { display: none; }
    .footer-top { grid-template-columns: 1fr; gap: 1.75rem; }
    .footer-bottom { flex-direction: column; text-align: center; }
}

/* ------------------------------------------------------------------
   15. MOVIMIENTO REDUCIDO
   ----------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}