/* =========================================================
   MaestrIA
   Sistema visual de autenticación
   Login · Registro · Recuperación · Restablecimiento
========================================================= */


/* =========================================================
   RESET
========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {

    --auth-primary: #4f46e5;
    --auth-primary-dark: #3730a3;
    --auth-primary-soft: #eef2ff;

    --auth-blue: #2563eb;
    --auth-cyan: #0891b2;
    --auth-amber: #f59e0b;
    --auth-orange: #f97316;
    --auth-green: #16a34a;
    --auth-pink: #db2777;

    --auth-text: #172033;
    --auth-muted: #64748b;
    --auth-border: #dbe3ee;

    --auth-background: #f3f6fa;
    --auth-white: #ffffff;

    --auth-danger: #dc2626;
    --auth-success: #15803d;

    --auth-shadow:
        0 24px 60px rgba(15, 23, 42, 0.10);
}

html {
    min-height: 100%;
}

body.auth-page {

    min-height: 100vh;

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color: var(--auth-text);

    background:
        radial-gradient(
            circle at 8% 8%,
            rgba(37, 99, 235, 0.10),
            transparent 28%
        ),
        radial-gradient(
            circle at 92% 90%,
            rgba(245, 158, 11, 0.10),
            transparent 28%
        ),
        linear-gradient(
            145deg,
            #f8fafc 0%,
            #f2f6fb 50%,
            #f8fafc 100%
        );

    position: relative;
}


/* =========================================================
   PATRÓN EDUCATIVO GENERAL
========================================================= */

body.auth-page::before {

    content: "";

    position: fixed;
    inset: 0;

    pointer-events: none;

    opacity: 0.32;

    background-image:

        linear-gradient(
            rgba(148, 163, 184, 0.08) 1px,
            transparent 1px
        ),

        linear-gradient(
            90deg,
            rgba(148, 163, 184, 0.08) 1px,
            transparent 1px
        );

    background-size:
        32px 32px,
        32px 32px;

    z-index: 0;
}


/* =========================================================
   ESTRUCTURA GENERAL
========================================================= */

.auth-layout {

    position: relative;
    z-index: 1;

    min-height: 100vh;

    display: grid;

    grid-template-columns:
        minmax(430px, 0.95fr)
        minmax(520px, 1.05fr);

}


/* =========================================================
   PANEL EDUCATIVO / MARCA
========================================================= */

.auth-brand-panel {

    position: relative;

    min-height: 100vh;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    padding: 54px 64px;

    overflow: hidden;

    color: #ffffff;

    background:
        radial-gradient(
            circle at 18% 18%,
            rgba(255, 255, 255, 0.11),
            transparent 28%
        ),
        radial-gradient(
            circle at 85% 75%,
            rgba(96, 165, 250, 0.20),
            transparent 30%
        ),
        linear-gradient(
            145deg,
            #172554 0%,
            #253b80 44%,
            #3f46a6 100%
        );

}


/* =========================================================
   FORMAS DECORATIVAS DEL PANEL
========================================================= */

.auth-brand-panel::before {

    content: "";

    position: absolute;

    width: 520px;
    height: 520px;

    top: -280px;
    right: -250px;

    border-radius: 50%;

    border:
        1px solid rgba(255,255,255,0.12);

    background:
        rgba(255,255,255,0.035);

    box-shadow:
        0 0 0 65px rgba(255,255,255,0.025),
        0 0 0 130px rgba(255,255,255,0.018);

}


.auth-brand-panel::after {

    content: "";

    position: absolute;

    width: 360px;
    height: 360px;

    bottom: -210px;
    left: -150px;

    border-radius: 50%;

    background:
        rgba(255,255,255,0.04);

    box-shadow:
        0 0 0 55px rgba(255,255,255,0.025);

}


/* =========================================================
   ELEMENTOS ESCOLARES
   SVG integrado - no utiliza imágenes externas
========================================================= */

.auth-brand-content::before {

    content: "";

    position: absolute;

    width: 310px;
    height: 270px;

    right: -115px;
    top: -145px;

    opacity: 0.58;

    transform: rotate(4deg);

    pointer-events: none;

    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;

    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='310' height='270' viewBox='0 0 310 270'%3E%3Cg fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3C!-- pencil --%3E%3Cg transform='translate(25 22) rotate(-28 60 14)'%3E%3Crect x='0' y='5' width='118' height='18' rx='6' fill='%23fbbf24' stroke='%23ffffff' stroke-width='2'/%3E%3Cpath d='M118 5l27 9-27 9z' fill='%23f1f5f9' stroke='%23ffffff' stroke-width='2'/%3E%3Cpath d='M145 14l-8 3v-6z' fill='%231e293b'/%3E%3Cpath d='M12 5v18' stroke='%23fb7185' stroke-width='9'/%3E%3C/g%3E%3C!-- ruler --%3E%3Cg transform='translate(162 14) rotate(18 50 14)'%3E%3Crect x='0' y='0' width='112' height='28' rx='6' fill='%2367e8f9' fill-opacity='.85' stroke='%23ffffff' stroke-width='2'/%3E%3Cpath d='M12 2v10M24 2v6M36 2v10M48 2v6M60 2v10M72 2v6M84 2v10M96 2v6' stroke='%230e7490' stroke-width='2'/%3E%3C/g%3E%3C!-- crayons --%3E%3Cg transform='translate(197 89) rotate(14)'%3E%3Crect x='0' y='10' width='20' height='92' rx='5' fill='%23fb7185' stroke='%23ffffff' stroke-width='2'/%3E%3Cpath d='M0 10L10 0l10 10' fill='%23fecdd3' stroke='%23ffffff' stroke-width='2'/%3E%3Cpath d='M5 24h10M5 83h10' stroke='%23be123c' stroke-width='2'/%3E%3Crect x='29' y='10' width='20' height='92' rx='5' fill='%2334d399' stroke='%23ffffff' stroke-width='2'/%3E%3Cpath d='M29 10L39 0l10 10' fill='%23a7f3d0' stroke='%23ffffff' stroke-width='2'/%3E%3Cpath d='M34 24h10M34 83h10' stroke='%23047857' stroke-width='2'/%3E%3C/g%3E%3C!-- book --%3E%3Cg transform='translate(25 154) rotate(-5 65 42)'%3E%3Cpath d='M65 16C47 4 25 6 5 14v65c20-8 42-10 60 3z' fill='%23ffffff' fill-opacity='.93' stroke='%23ffffff' stroke-width='2'/%3E%3Cpath d='M65 16c18-12 40-10 60-2v65c-20-8-42-10-60 3z' fill='%23e0e7ff' stroke='%23ffffff' stroke-width='2'/%3E%3Cpath d='M65 16v66' stroke='%236366f1' stroke-width='2'/%3E%3Cpath d='M18 29h34M18 40h28M78 29h34M78 40h28' stroke='%2394a3b8' stroke-width='2'/%3E%3C/g%3E%3C!-- triangle --%3E%3Cg transform='translate(173 189) rotate(9)'%3E%3Cpath d='M8 60L44 4l36 56z' fill='%23fbbf24' fill-opacity='.30' stroke='%23fcd34d' stroke-width='4'/%3E%3Cpath d='M29 48l15-24 15 24z' stroke='%23fcd34d' stroke-width='3'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");

}


/* =========================================================
   MARCA
========================================================= */

.auth-brand {

    position: relative;
    z-index: 3;

    display: flex;
    align-items: center;
    gap: 13px;

    font-size: 25px;
    font-weight: 850;

    letter-spacing: -0.6px;

}


.auth-brand-symbol {

    flex: 0 0 auto;

    width: 44px;
    height: 44px;

    display: grid;
    place-items: center;

    border-radius: 14px;

    background:
        linear-gradient(
            145deg,
            #ffffff,
            #eef2ff
        );

    color: var(--auth-primary);

    font-size: 20px;
    font-weight: 900;

    box-shadow:
        0 10px 30px rgba(0,0,0,0.16);

}


/* =========================================================
   CONTENIDO DEL PANEL
========================================================= */

.auth-brand-content {

    position: relative;
    z-index: 2;

    width: 100%;
    max-width: 550px;

}


.auth-eyebrow {

    display: inline-flex;
    align-items: center;

    margin-bottom: 20px;

    padding: 7px 12px;

    border:
        1px solid rgba(255,255,255,0.22);

    border-radius: 999px;

    background:
        rgba(255,255,255,0.09);

    backdrop-filter:
        blur(6px);

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 0.9px;
    text-transform: uppercase;

}


.auth-brand-content h1 {

    max-width: 620px;

    margin-bottom: 22px;

    font-size:
        clamp(38px, 4vw, 61px);

    line-height: 1.04;

    letter-spacing: -2px;

    text-wrap: balance;

}


.auth-brand-content > p {

    max-width: 490px;

    color:
        rgba(255,255,255,0.80);

    font-size: 16px;
    line-height: 1.7;

}


/* =========================================================
   BENEFICIOS
========================================================= */

.auth-benefits {

    display: grid;
    gap: 12px;

    max-width: 490px;

    margin-top: 34px;

}


.auth-benefit {

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 10px 12px;

    border:
        1px solid rgba(255,255,255,0.08);

    border-radius: 12px;

    background:
        rgba(255,255,255,0.045);

    color:
        rgba(255,255,255,0.91);

    font-size: 13px;
    line-height: 1.45;

}


.auth-check {

    flex: 0 0 auto;

    width: 25px;
    height: 25px;

    display: grid;
    place-items: center;

    border-radius: 8px;

    background:
        rgba(255,255,255,0.13);

    color: #ffffff;

    font-size: 13px;
    font-weight: 900;

}


/* =========================================================
   PIE DEL PANEL
========================================================= */

.auth-brand-footer {

    position: relative;
    z-index: 3;

    color:
        rgba(255,255,255,0.52);

    font-size: 11px;
    line-height: 1.5;

}


/* =========================================================
   PANEL DEL FORMULARIO
========================================================= */

.auth-form-panel {

    position: relative;

    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 42px 55px;

}


/* Decoración: plumones / crayolas */

.auth-form-panel::before {

    content: "";

    position: absolute;

    width: 180px;
    height: 150px;

    top: 26px;
    right: 24px;

    opacity: 0.42;

    pointer-events: none;

    transform: rotate(5deg);

    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;

    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='150' viewBox='0 0 180 150'%3E%3Cg fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg transform='translate(18 12) rotate(-20 55 12)'%3E%3Crect x='0' y='3' width='105' height='18' rx='6' fill='%23fbbf24' stroke='%23d97706' stroke-width='2'/%3E%3Cpath d='M105 3l24 9-24 9z' fill='%23fde68a' stroke='%23d97706' stroke-width='2'/%3E%3Cpath d='M129 12l-7 3V9z' fill='%23334155'/%3E%3C/g%3E%3Cg transform='translate(118 55) rotate(18)'%3E%3Crect x='0' y='9' width='17' height='70' rx='4' fill='%23fb7185' stroke='%23e11d48' stroke-width='2'/%3E%3Cpath d='M0 9L8.5 0 17 9' fill='%23fecdd3' stroke='%23e11d48' stroke-width='2'/%3E%3C/g%3E%3Cg transform='translate(82 70) rotate(10)'%3E%3Crect x='0' y='9' width='17' height='66' rx='4' fill='%2360a5fa' stroke='%232563eb' stroke-width='2'/%3E%3Cpath d='M0 9L8.5 0 17 9' fill='%23bfdbfe' stroke='%232563eb' stroke-width='2'/%3E%3C/g%3E%3Cpath d='M20 115h45' stroke='%2394a3b8' stroke-width='3'/%3E%3Cpath d='M25 123h28' stroke='%23cbd5e1' stroke-width='3'/%3E%3C/g%3E%3C/svg%3E");

}


/* =========================================================
   TARJETA DEL FORMULARIO
========================================================= */

.auth-form-container {

    position: relative;
    z-index: 2;

    width: 100%;
    max-width: 500px;

    padding: 36px 38px 30px;

    border:
        1px solid rgba(203,213,225,0.80);

    border-radius: 22px;

    background:
        rgba(255,255,255,0.91);

    backdrop-filter:
        blur(12px);

    box-shadow:
        0 24px 60px rgba(15,23,42,0.09),
        inset 0 1px 0 rgba(255,255,255,0.9);

}


/* Línea decorativa superior */

.auth-form-container::before {

    content: "";

    position: absolute;

    top: 0;
    left: 34px;
    right: 34px;

    height: 3px;

    border-radius:
        0 0 8px 8px;

    background:
        linear-gradient(
            90deg,
            #2563eb,
            #4f46e5,
            #f59e0b,
            #f97316
        );

    opacity: 0.82;

}


/* =========================================================
   MARCA MÓVIL
========================================================= */

.auth-mobile-brand {
    display: none;
}


/* =========================================================
   ENCABEZADO DEL FORMULARIO
========================================================= */

.auth-form-header {

    margin-bottom: 28px;

}


.auth-form-header h2 {

    margin-bottom: 9px;

    color: #172033;

    font-size: 31px;
    line-height: 1.15;

    letter-spacing: -1px;

}


.auth-form-header p {

    max-width: 430px;

    color: var(--auth-muted);

    font-size: 14px;
    line-height: 1.6;

}


/* =========================================================
   FILAS DE CAMPOS
========================================================= */

.auth-field-row {

    display: grid;

    grid-template-columns:
        minmax(0,1fr)
        minmax(0,1fr);

    gap: 15px;

}


/* =========================================================
   CAMPOS
========================================================= */

.auth-field {

    margin-bottom: 18px;

}


.auth-field label {

    display: block;

    margin-bottom: 7px;

    color: #334155;

    font-size: 12px;
    font-weight: 750;

}


.auth-field input {

    width: 100%;
    height: 49px;

    padding:
        0 14px;

    border:
        1px solid var(--auth-border);

    border-radius: 11px;

    outline: none;

    background:
        rgba(255,255,255,0.96);

    color: var(--auth-text);

    font-family: inherit;
    font-size: 14px;

    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        background .2s ease,
        transform .15s ease;

}


.auth-field input::placeholder {
    color: #a1adbd;
}


.auth-field input:hover {

    border-color: #bdc9d8;

}


.auth-field input:focus {

    border-color:
        var(--auth-primary);

    background:
        #ffffff;

    box-shadow:
        0 0 0 4px rgba(79,70,229,0.09);

}


/* =========================================================
   CONTRASEÑAS
========================================================= */

.auth-password-wrap {
    position: relative;
}


.auth-password-wrap input {
    padding-right: 78px;
}


.auth-show-password {

    position: absolute;

    top: 50%;
    right: 13px;

    transform:
        translateY(-50%);

    border: 0;
    outline: none;

    padding: 4px 0;

    background: transparent;

    color:
        var(--auth-primary);

    font-family: inherit;

    font-size: 11px;
    font-weight: 800;

    cursor: pointer;

}


.auth-show-password:hover {
    color: var(--auth-primary-dark);
}


.auth-password-help {

    margin-top: 6px;

    color: var(--auth-muted);

    font-size: 10px;
    line-height: 1.45;

}


/* =========================================================
   TÉRMINOS
========================================================= */

.auth-terms {

    display: flex;
    align-items: flex-start;

    gap: 9px;

    margin:
        2px 0 22px;

}


.auth-terms input {

    flex: 0 0 auto;

    width: 17px;
    height: 17px;

    margin-top: 1px;

    accent-color:
        var(--auth-primary);

}


.auth-terms label {

    color: var(--auth-muted);

    font-size: 11px;
    line-height: 1.5;

}


.auth-terms a {

    color:
        var(--auth-primary);

    font-weight: 700;
    text-decoration: none;

}


.auth-terms a:hover {
    text-decoration: underline;
}


/* =========================================================
   BOTÓN PRINCIPAL
========================================================= */

.auth-submit-btn {

    width: 100%;
    min-height: 50px;

    border: 0;
    border-radius: 11px;

    background:
        linear-gradient(
            135deg,
            #4f46e5,
            #4338ca
        );

    color: #ffffff;

    font-family: inherit;
    font-size: 14px;
    font-weight: 800;

    cursor: pointer;

    box-shadow:
        0 10px 24px rgba(79,70,229,0.20);

    transition:
        transform .15s ease,
        box-shadow .2s ease,
        filter .2s ease;

}


.auth-submit-btn:hover {

    transform:
        translateY(-1px);

    box-shadow:
        0 14px 28px rgba(79,70,229,0.25);

    filter:
        brightness(1.03);

}


.auth-submit-btn:active {

    transform:
        translateY(0);

}


.auth-submit-btn:focus-visible {

    outline:
        3px solid rgba(79,70,229,0.22);

    outline-offset: 3px;

}


.auth-submit-btn:disabled {

    opacity: .68;
    cursor: not-allowed;

    transform: none;

}


/* =========================================================
   ENLACES INFERIORES
========================================================= */

.auth-login-link {

    margin-top: 22px;

    text-align: center;

    color: var(--auth-muted);

    font-size: 12px;

}


.auth-login-link a {

    color:
        var(--auth-primary);

    font-weight: 800;

    text-decoration: none;

}


.auth-login-link a:hover {
    text-decoration: underline;
}


/* =========================================================
   NOTA DE SEGURIDAD
========================================================= */

.auth-security-note {

    margin-top: 24px;

    padding-top: 17px;

    border-top:
        1px solid #e7ecf3;

    text-align: center;

    color: #94a3b8;

    font-size: 10px;
    line-height: 1.55;

}


/* =========================================================
   MENSAJES
========================================================= */

.auth-message {

    margin-bottom: 18px;

    padding:
        12px 14px;

    border-radius: 10px;

    font-size: 12px;
    line-height: 1.5;

}


.auth-message-error {

    border:
        1px solid #fecaca;

    background:
        #fff5f5;

    color:
        #991b1b;

}


.auth-message-success {

    border:
        1px solid #bbf7d0;

    background:
        #f0fdf4;

    color:
        #166534;

}


/* =========================================================
   LINK DENTRO DE MENSAJES
========================================================= */

.auth-message a {

    color: inherit;

    text-decoration: underline;

}


/* =========================================================
   LOGIN - ENLACE "OLVIDASTE CONTRASEÑA"
   También mejora el estilo inline existente.
========================================================= */

.auth-form-container form + .auth-login-link {
    margin-top: 22px;
}


/* =========================================================
   TABLET / LAPTOP PEQUEÑA
========================================================= */

@media (max-width: 1100px) {

    .auth-layout {

        grid-template-columns:
            minmax(360px, .82fr)
            minmax(480px, 1.18fr);

    }

    .auth-brand-panel {

        padding:
            46px 42px;

    }

    .auth-brand-content h1 {

        font-size:
            clamp(34px, 4.5vw, 49px);

    }

    .auth-brand-content::before {

        width: 250px;
        height: 220px;

        right: -100px;
        top: -130px;

        opacity: .44;

    }

    .auth-form-panel {

        padding:
            34px;

    }

}


/* =========================================================
   TABLET / CELULAR
========================================================= */

@media (max-width: 900px) {

    body.auth-page {

        background:
            radial-gradient(
                circle at 0% 0%,
                rgba(37,99,235,.11),
                transparent 28%
            ),
            radial-gradient(
                circle at 100% 100%,
                rgba(245,158,11,.10),
                transparent 30%
            ),
            linear-gradient(
                145deg,
                #f8fafc,
                #f2f6fb
            );

    }


    .auth-layout {

        display: block;

        min-height: 100vh;

    }


    .auth-brand-panel {
        display: none;
    }


    .auth-form-panel {

        min-height: 100vh;

        align-items: center;

        padding:
            34px 22px;

    }


    .auth-form-panel::before {

        width: 150px;
        height: 125px;

        top: 14px;
        right: 8px;

        opacity: .27;

    }


    .auth-form-container {

        max-width: 520px;

        padding:
            32px 34px 28px;

        border-radius:
            20px;

    }


    .auth-mobile-brand {

        display: flex;
        align-items: center;

        gap: 10px;

        margin-bottom:
            30px;

        color:
            var(--auth-primary);

        font-size: 21px;
        font-weight: 850;

    }


    .auth-mobile-brand .auth-brand-symbol {

        width: 39px;
        height: 39px;

        border:
            1px solid #dbe4ff;

        border-radius: 12px;

        background:
            linear-gradient(
                145deg,
                #eef2ff,
                #ffffff
            );

        box-shadow:
            0 8px 22px rgba(79,70,229,.10);

    }

}


/* =========================================================
   CELULAR
========================================================= */

@media (max-width: 600px) {

    body.auth-page::before {

        opacity: .22;

        background-size:
            28px 28px,
            28px 28px;

    }


    .auth-form-panel {

        min-height: 100svh;

        align-items:
            flex-start;

        padding:
            20px 12px 28px;

    }


    .auth-form-panel::before {

        width: 115px;
        height: 95px;

        top: 10px;
        right: 3px;

        opacity: .22;

    }


    .auth-form-container {

        max-width: none;

        margin:
            0 auto;

        padding:
            25px 20px 24px;

        border-radius:
            18px;

        box-shadow:
            0 15px 38px rgba(15,23,42,.08);

    }


    .auth-form-container::before {

        left: 20px;
        right: 20px;

    }


    .auth-mobile-brand {

        margin-bottom:
            26px;

        font-size:
            20px;

    }


    .auth-form-header {

        margin-bottom:
            24px;

    }


    .auth-form-header h2 {

        font-size:
            27px;

        letter-spacing:
            -.7px;

    }


    .auth-form-header p {

        font-size:
            13px;

    }


    .auth-field-row {

        grid-template-columns:
            1fr;

        gap: 0;

    }


    .auth-field {

        margin-bottom:
            16px;

    }


    .auth-field input {

        min-height:
            50px;

        font-size:
            16px;

    }


    .auth-submit-btn {

        min-height:
            51px;

        font-size:
            14px;

    }


    .auth-security-note {

        margin-top:
            22px;

    }

}


/* =========================================================
   CELULAR PEQUEÑO
========================================================= */

@media (max-width: 390px) {

    .auth-form-panel {

        padding:
            12px 8px 22px;

    }


    .auth-form-container {

        padding:
            23px 16px 22px;

        border-radius:
            16px;

    }


    .auth-mobile-brand {

        margin-bottom:
            22px;

    }


    .auth-form-header h2 {

        font-size:
            25px;

    }


    .auth-form-header p {

        font-size:
            12px;

    }


    .auth-password-wrap input {

        padding-right:
            72px;

    }

}


/* =========================================================
   ALTURA REDUCIDA
   Útil en laptops y registro largo
========================================================= */

@media (
    min-width: 901px
) and (
    max-height: 780px
) {

    .auth-brand-panel {

        padding:
            34px 50px;

    }


    .auth-brand-content h1 {

        font-size:
            clamp(34px, 3.5vw, 48px);

        margin-bottom:
            16px;

    }


    .auth-brand-content > p {

        font-size:
            14px;

    }


    .auth-benefits {

        margin-top:
            22px;

        gap:
            8px;

    }


    .auth-benefit {

        padding:
            7px 10px;

        font-size:
            12px;

    }


    .auth-form-panel {

        padding:
            24px 42px;

    }


    .auth-form-container {

        padding:
            27px 34px 24px;

    }


    .auth-form-header {

        margin-bottom:
            21px;

    }


    .auth-field {

        margin-bottom:
            14px;

    }


    .auth-field input {

        height:
            45px;

    }


    .auth-security-note {

        margin-top:
            18px;

        padding-top:
            14px;

    }

}


/* =========================================================
   ACCESIBILIDAD
========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {

        scroll-behavior: auto !important;

        transition-duration:
            0.01ms !important;

        animation-duration:
            0.01ms !important;

        animation-iteration-count:
            1 !important;

    }

}