/* ==========================================================================
   Inicio de sesión SISMAT - I.E. Dorada
   Mismo lenguaje visual de los formularios de matrícula.
   ========================================================================== */

:root {
    --lg-blue: #2B4C9B;
    --lg-blue-dark: #1E3A7B;
    --lg-blue-soft: #EAF0FB;
    --lg-green: #13985A;
    --lg-green-dark: #0F7D49;
    --lg-red: #D93036;
    --lg-red-soft: #FDECEC;
    --lg-amber: #B7791F;
    --lg-ink: #1F2A44;
    --lg-text: #3D4A63;
    --lg-muted: #6B7690;
    --lg-line: #D5DCE8;
    --lg-bg: #F2F5FA;
}

* {
    box-sizing: border-box;
}

body.lg-body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--lg-blue) 0, var(--lg-blue) 260px, var(--lg-bg) 260px);
    background-repeat: no-repeat;
    background-color: var(--lg-bg);
    color: var(--lg-text);
    font-family: "Roboto", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

.lg-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 40px 16px 16px;
}

.lg-card {
    width: 100%;
    max-width: 440px;
    padding: 28px 28px 24px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(23, 37, 77, .16), 0 2px 6px rgba(23, 37, 77, .06);
}

/* ---------- Encabezado ---------- */
.lg-head {
    text-align: center;
    margin-bottom: 20px;
}

.lg-logo {
    width: 88px;
    height: 88px;
    object-fit: contain;
    margin-bottom: 8px;
}

.lg-kicker {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--lg-blue);
}

.lg-head h1 {
    margin: 4px 0 2px;
    font-size: 21px;
    line-height: 1.25;
    font-weight: 700;
    color: var(--lg-ink);
}

.lg-head p {
    margin: 0;
    color: var(--lg-muted);
}

/* ---------- Mensaje ---------- */
.lg-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 18px;
    padding: 12px 12px 12px 14px;
    border-radius: 12px;
    background: var(--lg-red-soft);
    color: #7A1E22;
    font-size: 14px;
}

.lg-alert strong {
    flex: 1 1 auto;
    font-weight: 500;
}

.lg-alert-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border-radius: 50%;
    background: var(--lg-red);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
}

.lg-alert-close {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    margin: -4px -2px 0 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #7A1E22;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.lg-alert-close:hover {
    background: rgba(217, 48, 54, .12);
}

/* ---------- Rol ---------- */
.lg-roles {
    margin: 0 0 4px;
    padding: 0;
    border: 0;
}

.lg-roles legend,
.lg-field label {
    display: block;
    margin-bottom: 6px;
    padding: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--lg-ink);
}

.lg-req {
    color: var(--lg-red);
}

/* Sin JavaScript se usa el select original; con JavaScript, los botones */
.lg-role-grid {
    display: none;
}

.js .lg-role-grid {
    display: flex;
    gap: 8px;
}

.js .lg-hidden-select {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.lg-role {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1 1 0;
    min-width: 0;
    padding: 12px 6px;
    border: 1.5px solid var(--lg-line);
    border-radius: 12px;
    background: #fff;
    color: var(--lg-text);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.lg-role svg {
    width: 26px;
    height: 26px;
    color: var(--lg-muted);
}

.lg-role:hover {
    border-color: #AFC0E3;
}

.lg-role.is-active {
    border-color: var(--lg-blue);
    background: var(--lg-blue-soft);
    color: var(--lg-ink);
    box-shadow: 0 0 0 3px rgba(43, 76, 155, .15);
}

.lg-role.is-active svg {
    color: var(--lg-blue);
}

/* ---------- Campos ---------- */
.lg-field {
    margin-top: 16px;
}

.lg-field input[type="text"],
.lg-field input[type="password"],
.lg-field select,
.lg-hidden-select {
    display: block;
    width: 100%;
    height: 48px;
    padding: 10px 14px;
    border: 1.5px solid var(--lg-line);
    border-radius: 10px;
    background: #fff;
    color: var(--lg-ink);
    font: inherit;
    font-size: 16px; /* evita el zoom automático en iPhone */
    transition: border-color .15s ease, box-shadow .15s ease;
}

.lg-field input:focus,
.lg-field select:focus {
    outline: 0;
    border-color: var(--lg-blue);
    box-shadow: 0 0 0 4px rgba(43, 76, 155, .15);
}

.lg-field input::placeholder {
    color: #9AA3B8;
}

.lg-field.has-error input,
.lg-field.has-error select {
    border-color: var(--lg-red);
    background: #FFF8F8;
}

.lg-field select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B7690' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px 7px;
}

.lg-pass {
    position: relative;
}

.lg-pass input {
    padding-right: 50px !important;
}

.lg-pass-toggle {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--lg-muted);
    cursor: pointer;
}

.lg-pass-toggle:hover,
.lg-pass-toggle.is-on {
    color: var(--lg-blue);
    background: var(--lg-blue-soft);
}

.lg-date {
    display: flex;
    gap: 8px;
}

.lg-date select:nth-child(1) {
    flex: 0 0 26%;
}

.lg-date select:nth-child(2) {
    flex: 1 1 auto;
    min-width: 0;
}

.lg-date select:nth-child(3) {
    flex: 0 0 30%;
}

.lg-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--lg-amber);
}

.lg-caps {
    display: none;
}

.lg-caps.is-visible {
    display: block;
}

.lg-field-error {
    display: block;
    font-size: 13px;
    line-height: 1.35;
    color: var(--lg-red);
}

.lg-field-error:not(:empty) {
    margin-top: 6px;
}

/* Mostrar solo los campos del rol elegido (las clases las pone login.js) */
.rol-none .lg-fields,
.rol-none .lg-only-student,
.rol-student .lg-only-staff,
.rol-staff .lg-only-student {
    display: none;
}

/* ---------- Botón ---------- */
.lg-submit {
    display: block;
    width: 100%;
    height: 52px;
    margin-top: 22px;
    border: 0;
    border-radius: 12px;
    background: var(--lg-green);
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s ease;
    -webkit-appearance: none;
}

.lg-submit:hover {
    background: var(--lg-green-dark);
}

.lg-submit.is-sending {
    opacity: .75;
    pointer-events: none;
}

.lg-help {
    margin: 14px 0 0;
    font-size: 13px;
    text-align: center;
    color: var(--lg-muted);
}

/* ---------- Pie ---------- */
.lg-footer {
    margin-top: 20px;
    font-size: 13px;
    color: var(--lg-muted);
}

.lg-footer a {
    color: var(--lg-blue);
}

/* ---------- Celular ---------- */
@media (max-width: 480px) {
    .lg-wrap {
        padding-top: 20px;
    }

    .lg-card {
        padding: 22px 18px 20px;
        border-radius: 18px;
    }

    .lg-logo {
        width: 72px;
        height: 72px;
    }

    .lg-head h1 {
        font-size: 19px;
    }

    .lg-role {
        padding: 10px 4px;
        font-size: 12px;
    }
}

/* Enlace «¿El documento tiene letras?» (2026-11-18) */
.lg-letras {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 0;
    border: 0;
    background: none;
    color: var(--lg-blue, #2B4C9B);
    font: inherit;
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}
