@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
    --auth-navy: #243b6b;
    --auth-teal: #16b4a5;
    --auth-cyan: #4bd4c7;
    --auth-ink: #1f2d45;
    --auth-muted: #71819f;
    --auth-line: rgba(123, 142, 175, 0.22);
    --auth-bg: #edf3ff;
    --auth-panel: rgba(255, 255, 255, 0.94);
}

html, body {
    min-height: 100%;
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    background:
        radial-gradient(circle at 12% 18%, rgba(74, 212, 199, 0.18) 0, transparent 18%),
        radial-gradient(circle at 86% 15%, rgba(255, 255, 255, 0.12) 0, transparent 15%),
        linear-gradient(135deg, #149ea4 0%, #324f92 100%);
}

body.auth-shell {
    position: relative;
    overflow-x: hidden;
}

body.auth-shell::before,
body.auth-shell::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
}

body.auth-shell::before {
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.08) 0 6px, transparent 6px);
    background-size: 64px 64px;
    opacity: 0.36;
}

body.auth-shell::after {
    background:
        linear-gradient(130deg, transparent 0 72%, rgba(255,255,255,0.08) 72% 73%, transparent 73%),
        linear-gradient(320deg, transparent 0 16%, rgba(255,255,255,0.08) 16% 17%, transparent 17%);
}

.auth-layout {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 1.06fr) minmax(340px, 0.94fr);
    gap: 0;
    align-items: stretch;
    max-width: 1120px;
    margin: 0 auto;
    padding: 42px 24px;
}

.auth-cover,
.auth-panel {
    min-height: 720px;
}

.auth-cover {
    position: relative;
    padding: 40px 48px;
    color: #fff;
    border-radius: 26px 0 0 26px;
    overflow: hidden;
    background:
        linear-gradient(rgba(36, 59, 107, 0.72), rgba(36, 59, 107, 0.8)),
        url('https://www.iestpceam.edu.pe/wp-content/uploads/2025/07/IESTP-CEAM-UIAGM.jpg') center/cover no-repeat;
}

.auth-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(145deg, rgba(75, 212, 199, 0.12), transparent 35%),
        linear-gradient(320deg, rgba(255, 255, 255, 0.04), transparent 28%);
}

.auth-cover__brand,
.auth-cover__content {
    position: relative;
    z-index: 1;
}

.auth-cover__brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
}

.auth-cover__brand img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 14px;
    background: rgba(255,255,255,0.92);
    padding: 6px;
}

.auth-cover__brand span {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.auth-cover__content {
    position: absolute;
    left: 48px;
    right: 48px;
    bottom: 52px;
    max-width: 520px;
}

.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.14);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.11em;
}

.auth-cover__content h1 {
    margin: 22px 0 14px;
    font-size: clamp(1.75rem, 2.5vw, 2.45rem);
    font-weight: 800;
    line-height: 1.12;
}

.auth-cover__content p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.72;
    color: rgba(255,255,255,0.88);
}

.auth-cover__quote {
    margin-top: 28px;
    padding: 22px 24px;
    border-radius: 22px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
}

.auth-cover__quote i {
    font-size: 2.4rem;
    color: var(--auth-cyan);
    margin-bottom: 10px;
}

.auth-cover__quote p {
    font-style: italic;
    margin: 0;
}

.auth-panel {
    padding: 52px 48px;
    background: var(--auth-panel);
    border-radius: 0 26px 26px 0;
    backdrop-filter: blur(12px);
    box-shadow: 0 24px 60px rgba(20, 35, 67, 0.18);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-panel__header h2 {
    margin: 18px 0 10px;
    color: var(--auth-navy);
    font-size: 2rem;
    font-weight: 800;
}

.auth-panel__header p {
    margin: 0 0 28px;
    color: var(--auth-muted);
    line-height: 1.65;
}

.auth-alert {
    border-radius: 16px;
    border: 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-field label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    color: var(--auth-ink);
}

.auth-field__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.auth-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: #6883b8;
    text-decoration: none;
}

.auth-link:hover {
    color: var(--auth-navy);
    text-decoration: none;
}

.auth-input {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 56px;
    border-radius: 18px;
    border: 1px solid var(--auth-line);
    background: #fff;
    box-shadow: 0 10px 22px rgba(28, 46, 84, 0.06);
}

.auth-input:focus-within {
    border-color: rgba(35, 92, 176, 0.36);
    box-shadow: 0 12px 24px rgba(36, 83, 152, 0.12);
}

.auth-input__icon {
    width: 54px;
    text-align: center;
    color: #7f90ad;
    flex: 0 0 auto;
}

.auth-input input {
    width: 100%;
    border: 0;
    background: transparent;
    outline: 0;
    color: var(--auth-ink);
    font-weight: 600;
    padding: 0 18px 0 0;
}

.auth-input input::placeholder {
    color: #9aa9c2;
    font-weight: 500;
}

.password-toggle {
    width: 42px;
    height: 42px;
    margin-right: 8px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: #8090ad;
}

.password-toggle:hover {
    background: #eef4ff;
    color: var(--auth-navy);
}

.auth-form__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2px;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--auth-ink);
    font-weight: 600;
    cursor: pointer;
}

.auth-submit {
    width: 100%;
    min-height: 56px;
    margin-top: 6px;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--auth-teal) 0%, #1ca8a4 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 18px 30px rgba(22, 180, 165, 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 34px rgba(22, 180, 165, 0.34);
}

.auth-submit__icon {
    opacity: 0.88;
    font-size: 0.92rem;
}

.overlay-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(18, 28, 54, 0.82);
}

#loadingOverlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.overlay-spinner {
    position: relative;
    z-index: 1;
}

.overlay-spinner p {
    font-size: 1.05rem;
    font-weight: 700;
}

.auth-authbox {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 18px;
    position: relative;
    z-index: 1;
}

.auth-authbox__card {
    width: min(100%, 520px);
    padding: 38px 34px;
    border-radius: 26px;
    background: rgba(255,255,255,0.96);
    box-shadow: 0 24px 56px rgba(20, 35, 67, 0.18);
}

.auth-authbox__title {
    margin: 14px 0 8px;
    color: var(--auth-navy);
    font-weight: 800;
}

.auth-authbox__text {
    color: var(--auth-muted);
    line-height: 1.7;
    margin-bottom: 24px;
}

.auth-backlink {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    color: #5d76a9;
    font-weight: 700;
    text-decoration: none;
}

@media (max-width: 991.98px) {
    .auth-layout {
        grid-template-columns: 1fr;
        max-width: 620px;
        padding: 20px 16px;
    }

    .auth-cover,
    .auth-panel {
        min-height: auto;
    }

    .auth-cover {
        border-radius: 24px 24px 0 0;
        min-height: 320px;
        padding: 28px;
    }

    .auth-cover__content {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        max-width: none;
        margin-top: 32px;
    }

    .auth-panel {
        border-radius: 0 0 24px 24px;
        padding: 34px 24px;
    }
}

@media (max-width: 575.98px) {
    .auth-cover {
        padding: 24px 20px;
    }

    .auth-panel {
        padding: 28px 18px;
    }

    .auth-cover__brand span {
        font-size: 1.25rem;
    }

    .auth-cover__content h1 {
        font-size: 1.7rem;
    }

    .auth-authbox__card {
        padding: 28px 18px;
    }
}
