:root {
    /* IETI logo green — aligns with school seal + dashboard green header family */
    --auth-primary: #1b7a32;
    --auth-primary-hover: #0d8010;
    --auth-primary-link: #86efac;
    --auth-focus-ring: rgba(27, 122, 50, 0.35);
    --auth-text: #ffffff;
    --auth-text-muted: rgba(255, 255, 255, 0.78);
    --auth-border: rgba(255, 255, 255, 0.55);
    --auth-glass: rgba(28, 32, 38, 0.42);
    --auth-radius: 28px;
    --auth-font: "Plus Jakarta Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body.auth-body {
    min-height: 100%;
}

body.auth-body {
    margin: 0;
    font-family: var(--auth-font);
    color: var(--auth-text);
    background: #0b1220;
    overflow-x: hidden;
}

.auth-bg {
    position: fixed;
    inset: 0;
    background: url("../images/login-bg.png") center / cover no-repeat;
    filter: blur(4px) saturate(1.08);
    transform: scale(1.03);
    z-index: 0;
}

.auth-bg-tint {
    position: fixed;
    inset: 0;
    background: linear-gradient(160deg, rgba(8, 14, 28, 0.22), rgba(12, 20, 36, 0.28));
    z-index: 1;
}

.auth-shell {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem 1.5rem;
    animation: auth-shell-in 0.7s ease both;
}

.auth-card {
    display: flex;
    width: min(920px, 100%);
    min-height: 520px;
    border-radius: var(--auth-radius);
    overflow: hidden;
    background: var(--auth-glass);
    backdrop-filter: blur(22px) saturate(1.2);
    -webkit-backdrop-filter: blur(22px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    animation: auth-card-in 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-card-form {
    flex: 1 1 50%;
    padding: 2.5rem 2.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.auth-card-media {
    flex: 1 1 50%;
    position: relative;
    min-height: 100%;
    overflow: hidden;
    background: #111;
}

.auth-media-slider,
.auth-media-slider .carousel-inner,
.auth-media-slider .carousel-item {
    height: 100%;
    min-height: inherit;
}

.auth-media-slider .carousel-item img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.auth-media-slider .carousel-indicators {
    margin-bottom: 0.75rem;
}

.auth-media-slider .carousel-indicators li {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.45);
}

.auth-media-slider .carousel-indicators li.active {
    background: #fff;
}

.auth-media-slider .carousel-control-prev,
.auth-media-slider .carousel-control-next {
    width: 12%;
    opacity: 0.75;
}

.auth-media-slider .carousel-control-prev:hover,
.auth-media-slider .carousel-control-next:hover {
    opacity: 1;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: clamp(0.5rem, 2vw, 0.85rem);
    margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
}

.auth-brand-logo {
    width: clamp(48px, 11vw, 72px);
    height: clamp(48px, 11vw, 72px);
    object-fit: cover;
    border-radius: 50%;
    background: transparent;
    padding: 0;
    flex-shrink: 0;
}

.auth-brand-name {
    font-weight: 700;
    font-size: clamp(1.05rem, 3.2vw, 1.35rem);
    letter-spacing: 0.02em;
    color: var(--auth-text);
    line-height: 1.2;
    min-width: 0;
}

.auth-title {
    font-size: clamp(1.45rem, 4vw, 2.15rem);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 clamp(0.25rem, 1vw, 0.4rem);
    color: var(--auth-text);
}

.auth-subtitle {
    margin: 0 0 clamp(0.75rem, 2.5vw, 1.1rem);
    color: var(--auth-text-muted);
    font-size: clamp(0.88rem, 2.4vw, 0.98rem);
    font-weight: 400;
}

.auth-form .form-group {
    margin-bottom: clamp(0.85rem, 2vw, 1.15rem);
}

.auth-form label,
.auth-card-form label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--auth-text);
}

.auth-form .form-control,
.auth-card-form .form-control {
    height: 48px;
    background: transparent;
    border: 1.5px solid var(--auth-border);
    border-radius: 12px;
    color: var(--auth-text);
    font-size: 0.95rem;
    padding: 0.65rem 0.95rem;
    box-shadow: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.auth-form .form-control:focus,
.auth-card-form .form-control:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: #fff;
    color: var(--auth-text);
    box-shadow: 0 0 0 3px var(--auth-focus-ring);
}

.auth-form .form-control::placeholder,
.auth-card-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.auth-password-wrap {
    position: relative;
}

.auth-password-wrap .form-control {
    padding-right: 3rem;
}

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 0.65rem;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus {
    color: #fff;
    outline: none;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0.35rem 0 1.35rem;
}

.auth-remember input[type="checkbox"] {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--auth-primary);
    cursor: pointer;
}

.auth-remember label {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 400;
    color: var(--auth-text);
    cursor: pointer;
}

.btn-auth-primary,
.btn-auth-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    padding: 0 1rem;
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.01em;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
}

.btn-auth-primary {
    border: 0;
    background: var(--auth-primary);
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.btn-auth-primary:hover,
.btn-auth-primary:focus {
    background: var(--auth-primary-hover);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-auth-secondary {
    margin-top: 0.75rem;
    border: 1.5px solid var(--auth-border);
    background: transparent;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn-auth-secondary:hover,
.btn-auth-secondary:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #fff;
    color: #fff;
    text-decoration: none;
}

.auth-forgot {
    display: block;
    text-align: center;
    margin-top: 1.15rem;
    color: var(--auth-primary-link);
    font-size: 0.95rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-forgot:hover,
.auth-forgot:focus {
    color: #fff;
}

.auth-legal {
    margin: 1.5rem 0 0;
    max-width: 36rem;
    text-align: center;
    font-size: 0.8rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.78);
}

.auth-legal a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-legal a:hover {
    color: var(--auth-primary-link);
}

.auth-shell-document {
    justify-content: flex-start;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.auth-card-document {
    width: min(820px, 100%);
    min-height: 0;
    max-height: calc(100vh - 6.5rem);
    overflow: hidden;
}

.auth-document-panel {
    flex: 1 1 auto;
    width: 100%;
    max-height: calc(100vh - 6.5rem);
    overflow-y: auto;
    padding: 2rem 2.25rem 2.25rem;
    justify-content: flex-start;
}

.auth-document {
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.95rem;
    line-height: 1.65;
}

.auth-document .auth-title {
    margin-bottom: 0.25rem;
}

.auth-document .auth-subtitle {
    margin-bottom: 1.5rem;
}

.auth-document h2 {
    margin: 1.5rem 0 0.65rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

.auth-document p,
.auth-document ul {
    margin: 0 0 0.85rem;
    color: rgba(255, 255, 255, 0.88);
}

.auth-document ul {
    padding-left: 1.25rem;
}

.auth-document li {
    margin-bottom: 0.35rem;
}

.auth-document strong {
    color: #fff;
    font-weight: 600;
}

.auth-document .btn-auth-primary {
    max-width: 220px;
    margin-left: auto;
    margin-right: auto;
}

.auth-document .btn-auth-secondary {
    max-width: 220px;
    margin-left: auto;
    margin-right: auto;
}

.auth-card-form .alert {
    border-radius: 12px;
    font-size: 0.9rem;
}

.auth-card-form .alert-danger {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(248, 113, 113, 0.45);
    color: #fecaca;
}

.auth-card-form .alert-success {
    background: rgba(34, 197, 94, 0.18);
    border: 1px solid rgba(74, 222, 128, 0.4);
    color: #bbf7d0;
}

.auth-card-form .alert .close {
    color: inherit;
    opacity: 0.8;
    text-shadow: none;
}

.auth-card-form .text-danger,
.auth-card-form .validation-summary-errors,
.auth-card-form .field-validation-error {
    color: #fecaca !important;
}

.auth-card-form .text-muted {
    color: var(--auth-text-muted) !important;
}

@keyframes auth-shell-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes auth-card-in {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 991.98px) {
    .auth-card {
        min-height: 0;
        flex-direction: column;
    }

    .auth-card-media {
        min-height: 220px;
        order: -1;
    }

    .auth-media-slider {
        min-height: 220px;
    }

    .auth-card-form {
        padding: 1.75rem 1.5rem 2rem;
    }
}

@media (max-width: 575.98px) {
    .auth-shell {
        padding: 1rem 0.75rem 1.25rem;
        justify-content: flex-start;
        padding-top: 1.25rem;
    }

    .auth-card {
        border-radius: 20px;
        width: 100%;
    }

    .auth-card-media {
        display: block;
        min-height: 140px;
        order: -1;
    }

    .auth-media-slider {
        min-height: 140px;
    }

    .auth-card-form {
        padding: 1.35rem 1.2rem 1.5rem;
        flex: 1 1 auto;
        width: 100%;
    }

    .auth-brand {
        margin-bottom: 0.85rem;
    }

    .auth-subtitle {
        margin-bottom: 0.7rem;
    }

    .auth-form .form-group {
        margin-bottom: 0.85rem;
    }

    .auth-remember {
        margin: 0.2rem 0 1rem;
    }

    .auth-form .form-control,
    .auth-card-form .form-control {
        height: 44px;
        font-size: 16px;
    }

    .auth-legal {
        font-size: 0.75rem;
        margin-top: 1.15rem;
        max-width: 100%;
        padding: 0 0.25rem;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .auth-shell-document {
        padding-top: 1rem;
        padding-bottom: 1.25rem;
    }

    .auth-card-document,
    .auth-document-panel {
        max-height: none;
        overflow: visible;
    }

    .auth-document-panel {
        padding: 1.25rem 1.15rem 1.5rem;
    }

    .auth-document .btn-auth-primary,
    .auth-document .btn-auth-secondary {
        max-width: none;
        width: 100%;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .auth-shell {
        justify-content: flex-start;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .auth-card-media,
    .auth-media-slider {
        min-height: 100px;
    }

    .auth-card-form {
        padding: 1rem 1.15rem 1.15rem;
    }

    .auth-brand {
        margin-bottom: 0.65rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-shell,
    .auth-card,
    .btn-auth-primary {
        animation: none;
        transition: none;
    }
}
