/* ================================================================
   AUTH MODERN - Login / Mail Recovery pages
   Student / Professor / Admin
   Palette: #375a82 combined with white
   Layout: CSS grid, 1 column on mobile/tablet, 2 on desktop.
   ================================================================ */

.auth-body {
    margin: 0;
    min-height: 100%;
    background: #f4f6fb;
    font-family: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    color: #1e293b;
    overflow-x: hidden;
}

/* ================================================================
   SHELL / GRID
   ================================================================ */
.auth-shell {
    --auth-accent: #375a82;
    --auth-accent-2: #4d7399;
    --auth-accent-rgb: 55, 90, 130;

    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    max-width: 100%;
    background:
        radial-gradient(1200px 600px at 100% 0%, rgba(var(--auth-accent-rgb), .10), transparent 60%),
        radial-gradient(900px 500px at 0% 100%, rgba(var(--auth-accent-rgb), .08), transparent 55%),
        #f4f6fb;
}

@media (min-width: 992px) {
    .auth-shell {
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    }
}

/* ================================================================
   BRAND PANEL
   ================================================================ */
.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
    min-width: 0;
    padding: 1.5rem 1.25rem;
    overflow: hidden;
    background: linear-gradient(145deg, #375a82 0%, #4d7399 55%, #5b81a6 100%);
    color: #fff;
}

.auth-brand__mark {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 200px;
    padding: 1rem;
}

.auth-brand__mark .logo {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 180px;
}

.auth-brand__mark .logo::before,
.auth-brand__mark .logo::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--brand-logo);
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
}

.auth-brand__mark .logo::before {
    clip-path: inset(0 0 32% 0);
}

.auth-brand__mark .logo::after {
    clip-path: inset(68% 0 0 0);
    filter: brightness(0) invert(1);
}

.auth-brand__inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
    width: 100%;
    max-width: 34rem;
    margin: 0 auto;
}

.auth-brand__logo {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    margin-bottom: 1.1rem;
    color: #375a82;
    text-decoration: none;
    transition: opacity .2s ease;
}

.auth-brand__logo:hover,
.auth-brand__logo:focus-visible {
    color: #375a82;
    opacity: .85;
}

/* Old logo artwork, kept from the previous design */
.auth-brand__logo img {
    height: 42px;
    width: auto;
    max-width: 46vw;
    object-fit: contain;
    flex: 0 0 auto;
}

.auth-brand__foot {
    margin: 0;
    font-size: .8rem;
    color: rgba(255, 255, 255, .6);
    overflow-wrap: break-word;
}

.auth-brand__foot a {
    color: rgba(255, 255, 255, .92);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, .35);
}

.auth-brand__foot a:hover,
.auth-brand__foot a:focus-visible {
    color: #fff;
    border-bottom-color: #fff;
}

/* ================================================================
   FORM PANEL
   ================================================================ */
.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 1.75rem 1.25rem 2.5rem;
}

.auth-card {
    width: 100%;
    max-width: 27rem;
    background: #fff;
    border-radius: 20px;
    padding: 1.75rem 1.5rem;
    border: 1px solid rgba(15, 23, 42, .06);
    box-shadow:
        0 24px 60px -30px rgba(var(--auth-accent-rgb), .45),
        0 2px 6px rgba(15, 23, 42, .04);
    animation: authCardIn .45s cubic-bezier(.22, .8, .36, 1) both;
}

@keyframes authCardIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-card {
        animation: none;
    }
}

.auth-card__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .32rem .7rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--auth-accent);
    background: rgba(var(--auth-accent-rgb), .1);
    max-width: 100%;
}

.auth-card__title {
    margin: 1rem 0 .4rem;
    font-size: clamp(1.3rem, 4.5vw, 1.55rem);
    font-weight: 700;
    letter-spacing: -.01em;
    color: #0f172a;
    overflow-wrap: break-word;
}

.auth-card__subtitle {
    margin: 0 0 1.5rem;
    color: #64748b;
    font-size: .92rem;
    line-height: 1.6;
    overflow-wrap: break-word;
}

/* ================================================================
   FORM CONTROLS
   ================================================================ */
.auth-field {
    margin-bottom: 1.05rem;
}

.auth-field label {
    display: block;
    font-size: .82rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: .4rem;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-wrap__icon {
    position: absolute;
    left: .9rem;
    font-size: 1rem;
    color: #94a3b8;
    pointer-events: none;
}

.auth-field .form-control {
    height: 3rem;
    width: 100%;
    min-width: 0;
    border-radius: 12px;
    border: 1px solid #dfe5ee;
    background: #fbfcfe;
    padding: .6rem .9rem .6rem 2.5rem;
    font-size: 1rem;
    color: #0f172a;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.auth-field .form-control::placeholder {
    color: #a8b3c2;
}

.auth-field .form-control:focus {
    background: #fff;
    border-color: var(--auth-accent-2);
    box-shadow: 0 0 0 4px rgba(var(--auth-accent-rgb), .12);
}

.auth-field .form-control.is-invalid {
    border-color: #e11d48;
    background-image: none;
    padding-right: .9rem;
}

.auth-toggle {
    position: absolute;
    right: .4rem;
    border: 0;
    background: transparent;
    color: #94a3b8;
    padding: .5rem .55rem;
    border-radius: 8px;
    cursor: pointer;
    line-height: 1;
    transition: color .2s ease, background-color .2s ease;
}

.auth-toggle:hover,
.auth-toggle:focus-visible {
    color: var(--auth-accent);
    background: rgba(var(--auth-accent-rgb), .08);
}

.auth-invalid-feedback {
    display: block;
    margin-top: .4rem;
    font-size: .8rem;
    color: #e11d48;
    overflow-wrap: break-word;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    width: 100%;
    min-height: 3rem;
    padding: .75rem 1.25rem;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease;
}

.auth-btn:focus-visible {
    outline: 2px solid var(--auth-accent);
    outline-offset: 2px;
}

.auth-btn:active {
    transform: translateY(1px);
}

.auth-btn--primary {
    color: #fff;
    background: linear-gradient(135deg, var(--auth-accent) 0%, var(--auth-accent-2) 100%);
    box-shadow: 0 14px 26px -16px rgba(var(--auth-accent-rgb), .9);
}

.auth-btn--primary:hover {
    color: #fff;
    box-shadow: 0 18px 30px -16px rgba(var(--auth-accent-rgb), .95);
}

.auth-btn--google {
    color: #1f2937;
    background: #fff;
    border-color: #dfe5ee;
    box-shadow: 0 8px 18px -14px rgba(15, 23, 42, .45);
}

.auth-btn--google:hover,
.auth-btn--google:focus-visible {
    color: #0f172a;
    background: #f8fafc;
    border-color: #cbd5e1;
}

.auth-btn__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: #fff;
    font-size: 1.05rem;
    flex: 0 0 22px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.3rem 0 1.05rem;
    color: #94a3b8;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e8edf5;
}

/* ================================================================
   ALERTS
   ================================================================ */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .85rem 1rem;
    border-radius: 14px;
    font-size: .88rem;
    line-height: 1.55;
    margin-bottom: 1.1rem;
    border: 1px solid transparent;
    overflow-wrap: break-word;
}

.auth-alert i {
    font-size: 1.05rem;
    line-height: 1.4;
    flex: 0 0 auto;
}

.auth-alert--error {
    color: #9f1239;
    background: #fff1f4;
    border-color: #fecdd6;
}

.auth-alert--success {
    color: #065f46;
    background: #ecfdf5;
    border-color: #a7f3d5;
}

.auth-alert--info {
    color: #1e40af;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.auth-masked-email {
    font-weight: 700;
    word-break: break-all;
}

/* ================================================================
   MOBILE APP STRIP
   ================================================================ */
.auth-app {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.4rem;
    padding: 1rem;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(var(--auth-accent-rgb), .10), rgba(var(--auth-accent-rgb), .04));
    border: 1px dashed rgba(var(--auth-accent-rgb), .3);
}

.auth-app__qr {
    width: 72px;
    height: 72px;
    object-fit: contain;
    background: #fff;
    border-radius: 10px;
    padding: 4px;
    flex: 0 0 72px;
}

.auth-app__text {
    min-width: 0;
}

.auth-app__title {
    font-size: .88rem;
    font-weight: 800;
    color: var(--auth-accent);
    margin: 0 0 .15rem;
}

.auth-app__desc {
    font-size: .8rem;
    color: #64748b;
    line-height: 1.45;
    margin: 0 0 .45rem;
}

.auth-app__link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .82rem;
    font-weight: 700;
    color: var(--auth-accent);
    text-decoration: none;
    min-height: 32px;
}

.auth-app__link:hover,
.auth-app__link:focus-visible {
    color: var(--auth-accent-2);
}

.auth-foot {
    text-align: center;
    font-size: .8rem;
    color: #94a3b8;
    margin: 1.35rem 0 0;
    line-height: 1.6;
}

.auth-foot a {
    color: var(--auth-accent);
    font-weight: 600;
    text-decoration: none;
}

.auth-foot a:hover,
.auth-foot a:focus-visible {
    text-decoration: underline;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

/* Phones: hide the brand panel entirely */
@media (max-width: 767.98px) {
    .auth-brand {
        display: none;
    }

    .auth-brand__logo img {
        height: 38px;
        max-width: 58vw;
    }

    .auth-panel {
        padding: 1.5rem 1rem 2.25rem;
        align-items: flex-start;
    }

    .auth-card {
        padding: 1.5rem 1.15rem;
        border-radius: 18px;
    }

    .auth-app {
        flex-direction: column;
        text-align: center;
        gap: .75rem;
    }

    .auth-app__qr {
        width: 104px;
        height: 104px;
        flex: 0 0 104px;
    }
}

/* Small phones */
@media (max-width: 359.98px) {
    .auth-panel {
        padding: 1.25rem .75rem 2rem;
    }

    .auth-card {
        padding: 1.35rem 1rem;
    }

    .auth-btn {
        font-size: .88rem;
        padding: .7rem .85rem;
    }
}

/* Tablets: still stacked, but give the panels more room */
@media (min-width: 768px) and (max-width: 991.98px) {
    .auth-brand {
        padding: 2.25rem 2rem;
    }

    .auth-brand__inner {
        max-width: 38rem;
    }

    .auth-brand__foot {
        display: block;
    }

    .auth-panel {
        padding: 2.5rem 2rem 3rem;
    }

    .auth-card {
        max-width: 30rem;
        padding: 2.25rem 2rem;
    }
}

/* Desktop: the brand panel fills its column */
@media (min-width: 992px) {
    .auth-brand {
        padding: 3rem 3rem;
        justify-content: space-between;
    }

    .auth-brand__inner {
        gap: 2rem;
        max-width: 32rem;
    }

    .auth-brand__logo img {
        height: 44px;
        max-width: none;
    }

    .auth-brand__foot {
        margin-top: auto;
    }

    .auth-panel {
        padding: 3rem 2.5rem;
    }

    .auth-card {
        max-width: 29.6rem;
        padding: 2.5rem 2.25rem;
    }

    .auth-card__title {
        font-size: 1.6rem;
    }
}

/* Short viewports (landscape phone): keep the panel compact */
@media (max-height: 520px) and (max-width: 991.98px) {
    .auth-brand {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
}