/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    font-family: 'Poppins', sans-serif;
    background: #eef2f7;
    min-height: 100vh;
}

/* ══════════════════════════════════════════════════════════════
   PRELOADER
══════════════════════════════════════════════════════════════ */
#portal-preloader {
    position: fixed; inset: 0;
    background: #0166cc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.55s ease, visibility 0.55s ease;
}
#portal-preloader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.load-container {
    position: relative;
    width: 64px; height: 64px;
    margin-bottom: 32px;
}
.load-container .slice {
    position: absolute;
    width: 13px; height: 13px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    top: 50%; left: 50%;
    margin-top: -6.5px; margin-left: -6.5px;
    animation: sliceSpin 1.3s linear infinite;
}
.load-container .slice:nth-child(1) { transform: rotate(0deg)   translateX(26px); animation-delay: 0s;       }
.load-container .slice:nth-child(2) { transform: rotate(60deg)  translateX(26px); animation-delay: -1.083s;  }
.load-container .slice:nth-child(3) { transform: rotate(120deg) translateX(26px); animation-delay: -0.866s;  }
.load-container .slice:nth-child(4) { transform: rotate(180deg) translateX(26px); animation-delay: -0.65s;   }
.load-container .slice:nth-child(5) { transform: rotate(240deg) translateX(26px); animation-delay: -0.433s;  }
.load-container .slice:nth-child(6) { transform: rotate(300deg) translateX(26px); animation-delay: -0.216s;  }
@keyframes sliceSpin {
    0%,100% { opacity: 0.12; }
    25%      { opacity: 1;    }
    75%      { opacity: 0.12; }
}

.preloader-logo {
    width: 72px; height: 72px; object-fit: contain;
    display: block; margin: 0 auto 14px;
    filter: brightness(0) invert(1) opacity(0.85);
}
.preloader-subtitle {
    color: rgba(255,255,255,0.55);
    font-size: 10px; letter-spacing: 3.5px;
    text-transform: uppercase; text-align: center;
    margin-bottom: 5px;
}
.preloader-title {
    color: #fff; font-size: 20px; font-weight: 600;
    letter-spacing: 1px; text-align: center;
}

/* ══════════════════════════════════════════════════════════════
   PAGE STRUCTURE
══════════════════════════════════════════════════════════════ */
#auth-page {
    min-height: 100vh;
    background: #eef2f7;
    opacity: 0;
    transition: opacity 0.5s ease;
}
#auth-page.visible { opacity: 1; }

/* ── Banner ── */
.login-banner {
    height: 28vh;
    min-height: 300px;
    background: #0166cc;
    position: relative;
    overflow: hidden;
}

.banner-identity {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
}
.banner-crest { margin: 0 auto 14px; }
.banner-crest img {
    width: 80px; height: 80px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}
.banner-inst {
    color: #fff;
    font-size: 11px; font-weight: 400;
    letter-spacing: 3.5px; text-transform: uppercase;
    margin-bottom: 5px;
}
.banner-sys {
    color: #fff;
    font-size: 22px; font-weight: 700;
    letter-spacing: 0.5px;
}

/* ── Card container ── */
.login-card-container {
    display: flex;
    justify-content: center;
    margin-top: -80px;
    padding: 0 20px 40px;
    position: relative;
    z-index: 10;
}

/* ── The card ── */
.main-login {
    display: flex;
    width: 100%;
    max-width: 960px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(13,38,64,0.22), 0 2px 8px rgba(13,38,64,0.1);
    min-height: 430px;
}

/* ── Card LEFT — carousel ── */
.card-left {
    width: 55%;
    background: linear-gradient(160deg, #003d80 0%, #004fa6 50%, #0166cc 100%);
    padding: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}
.card-left::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 80% 10%, rgba(44,125,177,0.18) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* ── Carousel ── */
.advert-carousel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}
.carousel-slides { flex: 1; min-height: 0; position: relative; overflow: hidden; }

.carousel-slide {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; justify-content: flex-end;
    opacity: 0;
    transition: opacity 0.75s ease;
    background: #003d80;
}
.carousel-slide.active { opacity: 1; }

.slide-img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0.82;
}
.slide-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.80) 0%, rgba(0,0,0,0.25) 55%, transparent 100%);
    pointer-events: none;
}
.slide-lower {
    position: relative;
    padding: 16px 22px 18px;
}
.slide-caption {
    color: #fff; font-size: 15px; font-weight: 700;
    line-height: 1.4; margin-bottom: 6px;
    text-align: justify;
}
.slide-subtitle {
    color: rgba(255,255,255,0.72); font-size: 11px;
    line-height: 1.7; text-align: justify;
}
.slide-url {
    display: inline-block; margin-top: 8px;
    color: #6dd1f7; font-size: 11px; text-decoration: none;
}
.slide-url:hover { color: #9de5ff; text-decoration: underline; }

/* Carousel nav */
.carousel-nav {
    padding: 13px 28px 18px;
    display: flex; align-items: center; justify-content: space-between;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.carousel-dots { display: flex; gap: 6px; align-items: center; }
.c-dot {
    height: 5px; width: 5px; border-radius: 50%;
    background: rgba(255,255,255,0.28);
    cursor: pointer;
    transition: width 0.3s ease, background 0.3s ease;
    border: none; padding: 0; outline: none;
}
.c-dot.active { background: rgba(255,255,255,0.88); width: 16px; border-radius: 3px; }
.c-arrow {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.85); font-size: 16px;
    cursor: pointer; outline: none;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}
.c-arrow:hover { background: rgba(255,255,255,0.25); color: #fff; }
.carousel-arrows { display: flex; gap: 6px; }

/* ── Card RIGHT ── */
.card-right {
    flex: 1;
    background: #fff;
    padding: 40px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-heading { margin-bottom: 28px; }
.form-heading .portal-label {
    display: block; color: #0166cc;
    font-size: 10px; font-weight: 600; letter-spacing: 3px;
    text-transform: uppercase; margin-bottom: 6px;
}
.form-heading h1 { color: #003d80; font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.form-heading p  { color: #8a9bb0; font-size: 12.5px; }

.auth-alert {
    background: #fff5f5; border: 1px solid #feb2b2; border-radius: 8px;
    padding: 11px 14px; margin-bottom: 18px; font-size: 12.5px; color: #c53030;
    display: flex; align-items: center; gap: 7px;
}
.auth-alert i { font-size: 16px; flex-shrink: 0; }

.field-group { margin-bottom: 18px; }
.auth-label  { display: block; font-size: 12px; font-weight: 500; color: #4a5568; margin-bottom: 6px; }

.auth-input {
    display: flex; align-items: stretch;
    border: 1.5px solid #dde3ea; border-radius: 8px; overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #f8fafc;
}
.auth-input:focus-within {
    border-color: #0166cc;
    box-shadow: 0 0 0 3px rgba(26,78,112,0.1);
    background: #fff;
}
.auth-input.is-invalid { border-color: #fc8181; }
.auth-input .inp-icon {
    display: flex; align-items: center; justify-content: center;
    padding: 0 14px; color: #a0aab5; font-size: 17px; background: transparent; border: none;
    transition: color 0.2s;
}
.auth-input:focus-within .inp-icon { color: #0166cc; }
.auth-input input {
    flex: 1; border: none; background: transparent; outline: none;
    padding: 12px 4px 12px 0;
    font-size: 13.5px; font-family: 'Poppins', sans-serif; color: #1a202c;
}
.auth-input input::placeholder { color: #b8c4ce; font-size: 13px; }
.toggle-pw {
    display: flex; align-items: center; justify-content: center;
    padding: 0 13px; background: transparent; border: none;
    cursor: pointer; color: #a0aab5; font-size: 17px; transition: color 0.15s;
}
.toggle-pw:hover { color: #0166cc; }
.auth-error { color: #e53e3e; font-size: 11.5px; margin-top: 5px; display: flex; align-items: center; gap: 4px; }

.auth-meta {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 22px;
}
.check-label {
    display: flex; align-items: center; gap: 7px;
    font-size: 12.5px; color: #4a5568; cursor: pointer; user-select: none;
}
.check-label input[type="checkbox"] { width: 14px; height: 14px; accent-color: #0166cc; cursor: pointer; }
.forgot-link { font-size: 12.5px; color: #0166cc; text-decoration: none; font-weight: 500; }
.forgot-link:hover { color: #003d80; text-decoration: underline; }

.btn-signin {
    width: 100%; padding: 13px;
    background: #0166cc;
    color: #fff; font-family: 'Poppins', sans-serif;
    font-size: 13px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase;
    border: none; border-radius: 8px; cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-signin:hover {
    background: #003d80;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(13,38,64,0.3);
}
.btn-signin:active   { transform: translateY(0); }
.btn-signin:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }
.btn-signin .spinner-border { width: 14px; height: 14px; border-width: 2px; }

.security-badge {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin-top: 22px; padding-top: 18px;
    border-top: 1px solid #f0f4f8;
    color: #a0aab5; font-size: 11px;
}
.security-badge i { font-size: 14px; color: #68d391; }

.login-footer {
    text-align: center;
    padding: 8px 20px 18px;
    color: #9aabb8; font-size: 11px; line-height: 1.8;
}
.login-footer a { color: #8a9bb0; text-decoration: none; }
.login-footer a:hover { color: #0166cc; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════ */

/* ② Tablet: 700–899px */
@media (max-width: 899px) {
    .login-banner           { height: 26vh; min-height: 280px; }
    .banner-crest           { margin-bottom: 12px; }
    .banner-crest img       { width: 68px; height: 68px; }
    .banner-sys             { font-size: 20px; }
    .login-card-container   { margin-top: -70px; padding: 0 20px 36px; }
    .main-login             { min-height: 390px; }
    .card-left              { width: 50%; }
    .card-right             { padding: 32px 28px; }
    .form-heading h1        { font-size: 22px; }
}

/* ③ Mobile: ≤699px */
@media (max-width: 699px) {
    .login-banner           { height: 24vh; min-height: 240px; }
    .banner-crest           { margin-bottom: 10px; }
    .banner-crest img       { width: 58px; height: 58px; }
    .banner-sys             { font-size: 18px; }
    .login-card-container   { margin-top: -65px; padding: 0 16px 36px; }
    .main-login             { flex-direction: column; min-height: unset; border-radius: 10px; }
    .card-left              { display: none; }
    .card-right             { padding: 30px 28px 32px; }
    .form-heading h1        { font-size: 22px; }
    .field-group            { margin-bottom: 16px; }
}

/* ④ Small phones: ≤480px */
@media (max-width: 480px) {
    .login-banner           { height: 22vh; min-height: 210px; }
    .banner-crest           { margin-bottom: 8px; }
    .banner-crest img       { width: 48px; height: 48px; }
    .banner-sys             { font-size: 16px; }
    .banner-inst            { font-size: 9.5px; letter-spacing: 2px; }
    .login-card-container   { margin-top: -60px; padding: 0 12px 28px; }
    .main-login             { border-radius: 9px; }
    .card-right             { padding: 24px 20px 28px; }
    .form-heading h1        { font-size: 20px; }
    .form-heading p         { font-size: 12px; }
    .field-group            { margin-bottom: 14px; }
    .auth-meta              { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 18px; }
    .btn-signin             { padding: 12px; font-size: 12.5px; }
    .security-badge         { font-size: 10.5px; flex-wrap: wrap; justify-content: center; }
    .login-footer           { padding: 6px 14px 14px; font-size: 10.5px; }
}

/* ⑤ Tiny phones: ≤360px */
@media (max-width: 360px) {
    .login-banner           { height: 20vh; min-height: 190px; }
    .banner-inst            { display: none; }
    .banner-sys             { font-size: 14px; }
    .login-card-container   { margin-top: -56px; padding: 0 10px 24px; }
    .card-right             { padding: 20px 16px 24px; }
    .form-heading h1        { font-size: 18px; }
    .form-heading p         { display: none; }
    .security-badge         { display: none; }
    .login-footer           { font-size: 10px; padding: 5px 10px 14px; }
}
