/* ======================================================
   SIMS Login Page — Modern Design
   KCMCU brand palette: blue / yellow / red / green
   ====================================================== */

:root {
    --login-primary:    #1e2da9;   /* KCMCU blue */
    --login-primary-dk: #14205e;   /* darker blue, gradient end / active state */
    --login-accent:     #3db183;   /* KCMCU green */
    --login-accent-dk:  #2c8b67;   /* darker green, hover state */
    --login-yellow:     #fff200;   /* KCMCU yellow, sparing accent use */
    --login-red:        #ff0707;   /* KCMCU red, errors/alerts */
    --login-text:       #1f2937;
    --login-muted:      #6b7280;
    --login-border:     #d9def0;
}

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

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 14px;
}

/* ---- Page layout ------------------------------------ */
.login-page {
    min-height: 100vh;
    display: flex;
}

/* ---- Left panel ------------------------------------- */
.login-left {
    width: 50%;
    flex-shrink: 0;
    background: linear-gradient(160deg, #1e2da9 0%, #14205e 100%); /* KCMCU blue gradient */
    color: #e8ecfb;
    padding: 48px 44px;
    position: relative;
    overflow: hidden;
}

/* Decorative circles */
.login-left::before,
.login-left::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(61,177,131,.08);
    pointer-events: none;
}
.login-left::before {
    width: 400px;
    height: 400px;
    top: -120px;
    right: -160px;
}
.login-left::after {
    width: 260px;
    height: 260px;
    bottom: -80px;
    left: -80px;
}

/* Brand */
.login-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 14px;
    display: block;
}

.login-org-name {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 4px;
}

.login-system-name {
    color: var(--login-accent);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
    margin-bottom: 0;
}

/* Features */
.login-features { position: relative; z-index: 1; }

.login-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px;
}

.lf-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(61,177,131,.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--login-accent);
    font-size: 1.1rem;
}

.login-feature-item h6 {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 3px;
}

.login-feature-item p {
    color: #c2c9ee;
    font-size: 0.8rem;
    margin: 0;
    line-height: 1.5;
}

/* Password policy panel (left, reset page) */
.login-policy {
    position: relative;
    z-index: 1;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 12px;
    padding: 20px 22px;
}

.login-policy-title {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 14px;
    display: flex;
    align-items: center;
}

.login-policy-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.login-policy-list li {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: #d7dbf5;
    font-size: 0.8rem;
    line-height: 1.5;
    margin-bottom: 9px;
}
.login-policy-list li:last-child { margin-bottom: 0; }

.login-policy-list li i {
    color: var(--login-accent);
    font-size: 0.7rem;
    margin-top: 4px;
    flex-shrink: 0;
}

.login-policy-list strong { color: #fff; font-weight: 600; }

/* Compact policy note shown on small screens */
.login-policy-mobile {
    margin-top: 16px;
    padding: 12px 14px;
    background: #eaf7f1;
    border: 1px solid #bfe3d3;
    border-radius: 8px;
    font-size: 0.78rem;
    color: var(--login-accent-dk);
    line-height: 1.5;
}
.login-policy-mobile strong { color: var(--login-primary); }

/* Footer left */
.login-footer-left {
    font-size: 0.75rem;
    color: #9aa3d9;
    position: relative;
    z-index: 1;
}

.login-footer-left a { color: #b7bff0; text-decoration: none; }
.login-footer-left a:hover { color: var(--login-accent); }

/* ---- Right panel (50% column) ----------------------- */
.login-right {
    width: 50%;
    flex-shrink: 0;
    background: #fff;
    display: flex;
    align-items: center;            /* vertically centre so no scroll */
    justify-content: center;
    padding: 32px 56px;
    overflow-y: auto;
}

/* ---- Form container (no inner box) ------------------ */
.login-card {
    width: 100%;
    max-width: 460px;
    background: transparent;        /* no box */
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

/* Mobile logo */
.login-logo-sm {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 8px;
}

.login-org-name-sm {
    font-size: 1rem;
    font-weight: 700;
    color: var(--login-text);
}

/* Left panel intro heading */
.login-left-intro {
    position: relative;
    z-index: 1;
}

.login-left-intro h3 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.25;
}

.login-left-intro p {
    color: #ccd3f5;
    font-size: 0.88rem;
    line-height: 1.6;
    margin: 0;
    max-width: 340px;
}

/* Logo section (top of form column) */
.login-form-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 16px;
    margin-bottom: 18px;
    border-bottom: 1px solid #eef1f4;
}

.login-form-logo-box {
    width: 124px;
    height: 124px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid #e7eef2;
    box-shadow: 0 6px 22px rgba(0,0,0,.10);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 14px;
}

.login-form-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

.login-form-org {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--login-primary);
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.login-form-sys {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--login-accent);
    margin-top: 4px;
}

/* Academic year / date bar */
.login-badge {
    display: flex;
    align-items: center;
   /* justify-content: space-between;*/
    width: 100%;
    background: #eaf7f1;
    color: var(--login-accent-dk);
    border: 1px solid #bfe3d3;
    border-left: 4px solid var(--login-accent);
    border-radius: 0;
    padding: 12px 18px;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.login-badge-left,
.login-badge-right {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.login-badge-left { margin-right: auto; }
.login-badge-right { margin-left: auto; }

.login-badge strong { font-weight: 700; margin-left: 4px; }

/* Title */
.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--login-text);
    margin-bottom: 4px;
}

.login-subtitle {
    color: var(--login-muted);
    font-size: 0.88rem;
    margin-bottom: 18px;
}

/* Form */
.login-form .form-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--login-text);
    margin-bottom: 5px;
}

.login-form .form-control {
    border-color: var(--login-border);
    border-radius: 8px;
    font-size: 0.9rem;
    padding: 10px 14px;
    transition: all .2s;
}

.login-form .form-control:focus {
    border-color: var(--login-accent);
    box-shadow: 0 0 0 3px rgba(61,177,131,.15);
}

.login-form .input-group .btn-outline-secondary {
    border-color: var(--login-border);
    color: var(--login-muted);
    border-radius: 0 8px 8px 0 !important;
}

.login-form .input-group .btn-outline-secondary:hover {
    background: #f0f4f8;
    color: var(--login-text);
}

/* Forgot password */
.login-forgot {
    font-size: 0.83rem;
    color: var(--login-accent);
    text-decoration: none;
}
.login-forgot:hover { color: var(--login-accent-dk); text-decoration: underline; }

/* Submit button */
.login-btn {
    background: var(--login-primary);
    color: #fff;
    border: none;
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    letter-spacing: .3px;
    transition: all .2s;
}

.login-btn:hover {
    background: var(--login-accent);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(61,177,131,.35);
}

/* Footer right */
.login-footer-right {
    margin-top: 18px;
    text-align: center;
    font-size: 0.76rem;
    color: var(--login-muted);
}

.login-footer-right a { color: var(--login-accent); text-decoration: none; }
.login-footer-right a:hover { text-decoration: underline; }

/* Alert overrides -- icon injected via ::before, no markup changes needed
   since these render from a plain <div class="alert alert-{type}"> emitted
   by the show_alert() PHP helper. */
.alert {
    position: relative;
    border-radius: 8px;
    font-size: 0.85rem;
    padding-left: 2.6rem;
    border-left-width: 4px;
    margin-bottom: 18px;
    box-shadow: 0 3px 10px rgba(20, 30, 60, .06);
    animation: lgFadeUp .35s cubic-bezier(.34, 1.56, .64, 1) both;
}
.alert::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
}
.alert-success::before { content: "\f058"; color: #18a558; }  /* circle-check */
.alert-danger::before  { content: "\f057"; color: #ed5565; }  /* circle-xmark */
.alert-warning::before { content: "\f071"; color: #f8ac59; }  /* triangle-exclamation */
.alert-info::before    { content: "\f05a"; color: #23c6c8; }  /* circle-info */

/* Responsive */
@media (max-width: 991.98px) {
    .login-left { display: none !important; }
    .login-right {
        width: 100%;
        background: #fff;
        padding: 40px 24px;
    }
}

@media (max-width: 480px) {
    .login-right { padding: 28px 18px; }
}

/* ====================================================
   LOGIN PAGE — entrance animations & micro-interactions
   ==================================================== */

@keyframes lgFadeUp   { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes lgFadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes lgPop      { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: scale(1); } }
@keyframes lgSlideL   { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
@keyframes lgFloat    { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* Left panel slides in from the left; its decorative circles drift */
.login-left { animation: lgSlideL .6s cubic-bezier(.22,1,.36,1) both; overflow: hidden; }
.login-left::before { animation: lgFloat 7s ease-in-out infinite; }
.login-left::after  { animation: lgFloat 9s ease-in-out infinite reverse; }

/* Left content staggered */
.login-left-intro { animation: lgFadeUp .55s cubic-bezier(.22,1,.36,1) both .15s; }
.login-feature-item { animation: lgFadeUp .5s cubic-bezier(.22,1,.36,1) both; }
.login-feature-item:nth-child(1) { animation-delay: .28s; }
.login-feature-item:nth-child(2) { animation-delay: .38s; }
.login-feature-item:nth-child(3) { animation-delay: .48s; }
.login-footer-left { animation: lgFadeIn .8s ease both .6s; }
/* feature icon hover lift */
.lf-icon { transition: transform .2s ease, background .2s ease; }
.login-feature-item:hover .lf-icon { transform: translateY(-3px) scale(1.06); background: rgba(61,177,131,.28); }

/* Policy panel (reset page) */
.login-policy { animation: lgFadeUp .55s cubic-bezier(.22,1,.36,1) both .3s; }
.login-policy-list li { animation: lgSlideL .4s ease both; }
.login-policy-list li:nth-child(1) { animation-delay: .4s; }
.login-policy-list li:nth-child(2) { animation-delay: .47s; }
.login-policy-list li:nth-child(3) { animation-delay: .54s; }
.login-policy-list li:nth-child(4) { animation-delay: .61s; }
.login-policy-list li:nth-child(5) { animation-delay: .68s; }
.login-policy-list li:nth-child(6) { animation-delay: .75s; }

/* Right column fades up */
.login-right { animation: lgFadeIn .5s ease both; }
.login-form-header { animation: lgFadeUp .55s cubic-bezier(.22,1,.36,1) both .15s; }
.login-form-logo-box { animation: lgPop .55s cubic-bezier(.34,1.56,.64,1) both .2s; transition: transform .25s ease, box-shadow .25s ease; }
.login-form-logo-box:hover { transform: translateY(-3px) rotate(-2deg); box-shadow: 0 10px 28px rgba(0,0,0,.16); }

.login-badge   { animation: lgFadeUp .5s ease both .28s; }
.login-title   { animation: lgFadeUp .5s ease both .34s; }
.login-subtitle{ animation: lgFadeUp .5s ease both .4s; }

/* Form fields rise in, staggered */
.login-form .mb-3,
.login-form .mb-4,
.login-form .input-group,
.login-form > .d-flex { animation: lgFadeUp .5s cubic-bezier(.22,1,.36,1) both; }
.login-form .mb-3:nth-of-type(1) { animation-delay: .46s; }
.login-form .mb-3:nth-of-type(2) { animation-delay: .54s; }
.login-form .d-flex { animation-delay: .6s; }
.login-btn { animation: lgFadeUp .5s cubic-bezier(.22,1,.36,1) both .66s; }

/* Input focus lift */
.login-form .form-control { transition: border-color .15s, box-shadow .2s, transform .15s; }
.login-form .form-control:focus { transform: translateY(-1px); }

/* Button shine + lift already in base; add subtle press */
.login-btn:active { transform: translateY(0) scale(.99); }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .login-left, .login-left::before, .login-left::after,
    .login-left-intro, .login-feature-item, .login-footer-left,
    .login-policy, .login-policy-list li, .login-right,
    .login-form-header, .login-form-logo-box, .login-badge,
    .login-title, .login-subtitle, .login-form .mb-3, .login-form .mb-4,
    .login-form .input-group, .login-form > .d-flex, .login-btn {
        animation: none !important;
    }
}

/* ====================================================
   LOGIN — admin slideshow (carousel in the left panel)
   ==================================================== */
.login-slideshow {
    position: relative;
    z-index: 1;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,.28);
}
.login-slide-link { display: block; text-decoration: none; }

.login-slide {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background-size: cover;        /* fill the slide, cropping overflow so it always fits */
    background-position: center center;
    background-repeat: no-repeat;
    background-color: #14205e;     /* shown behind transparent / letterboxed images */
    display: block;
}
.login-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* fallback for browsers without aspect-ratio */
@supports not (aspect-ratio: 16 / 10) {
    .login-slide { height: 260px; }
}



/* Indicators — placed OUTSIDE / below the slideshow */
.login-slide-dots {
    position: static;                 /* override Bootstrap's absolute positioning */
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 12px 0 0;
    padding: 0;
}
.login-slide-dots [data-bs-target] {
    width: 8px; height: 8px; border-radius: 50%;
    border: none; margin: 0;
    background: rgba(255,255,255,.35);
    opacity: 1; transition: background .2s, width .2s;
}
.login-slide-dots .active {
    background: var(--login-accent);
    width: 20px; border-radius: 5px;
}
.login-slideshow .carousel-control-prev,
.login-slideshow .carousel-control-next { width: 12%; opacity: 0; transition: opacity .2s; }
.login-slideshow:hover .carousel-control-prev,
.login-slideshow:hover .carousel-control-next { opacity: .9; }
.login-slideshow .carousel-control-prev-icon,
.login-slideshow .carousel-control-next-icon {
    background-color: rgba(0,0,0,.35);
    border-radius: 50%;
    width: 34px; height: 34px;
    background-size: 55%;
}

/* CTA button below the slideshow (updates with active slide) */
.login-slide-wrap { position: relative; z-index: 1; text-align: center; }
.login-slide-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    background: var(--login-accent);
    color: #fff !important;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 11px 20px;
    border-radius: 8px;
    text-decoration: none;
    transition: transform .12s ease, box-shadow .2s ease, background .15s ease;
}
.login-slide-cta:hover {
    background: var(--login-accent-dk);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(61,177,131,.4);
    color: #fff !important;
    text-decoration: none;
}
.login-slide-cta i { font-size: 0.75rem; }


.required {
    color: red;
    font-size: 12px;
}