/* ================= RESET ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

/* ================= BODY ================= */
body {
    min-height: 100vh;
    background: url('/images/bgr.jpeg') no-repeat center center / cover;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
}

/* Background overlay to soften the background image */
body::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.12);
    z-index: 0;
}

/* ================= CONTAINER ================= */
.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    animation: fadeUp 0.5s ease both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ================= CARD ================= */
.login-card {
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* ================= TOP SECTION (Classroom Background Cover inside Card) ================= */
.top-section {
    background: linear-gradient(rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.88)), url('/images/bgr.jpeg') no-repeat center center / cover;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    border-bottom: none;
    border-radius: 28px 28px 0 0;
    padding: 40px 20px 45px; /* Added bottom padding to accommodate overlap */
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* ================= CARD ILLUSTRATION ================= */
.card-image {
    display: flex;
    justify-content: center;
    width: 100%;
}

.card-illustration {
    width: 92%;
    max-width: 340px;
    height: auto;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.18));
    animation: floatCard 4s ease-in-out infinite;
    transform-origin: center;
}

@keyframes floatCard {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50%       { transform: translateY(-6px) rotate(1deg); }
}

/* ================= BOTTOM SECTION (Solid White with Beautiful Curves) ================= */
.bottom-section {
    background: #ffffff;
    border-radius: 28px; /* Rounds all corners including top to create the curve above tabs */
    margin-top: -25px; /* Overlaps with the transparent top section */
    padding: 35px 30px 25px;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 2;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.18);
    border: 1.5px solid rgba(255, 255, 255, 0.9);
}

.form-container {
    width: 100%;
}

/* ================= TABS ================= */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 22px;
    background: #f1f5f9;
    border-radius: 50px;
    padding: 5px;
}

.tab {
    flex: 1;
    padding: 11px 12px;
    border-radius: 50px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab:hover {
    color: #1e6fef;
}

.tab.active {
    background: #1e6fef;
    color: #fff;
    box-shadow: 0 4px 12px rgba(30, 111, 239, 0.35);
    pointer-events: none;
}

.tab i {
    font-size: 13px;
}

/* ================= ALERT ERROR ================= */
.alert-error {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #ef4444;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ================= INPUT GROUP ================= */
.input-group {
    position: relative;
    margin-bottom: 16px;
}

.input-group input {
    width: 100%;
    height: 50px;
    padding: 0 48px;
    border-radius: 50px;
    border: 1px solid #fef3c7;
    background: #fef3c7; /* Soft yellow matching the reference */
    font-size: 14px;
    color: #1e293b;
    transition: all 0.25s ease;
    outline: none;
}

.input-group input:focus {
    background: #fde68a;
    border-color: #fde68a;
    box-shadow: 0 0 0 3px rgba(30, 111, 239, 0.15);
}

.input-group input::placeholder {
    color: #94a3b8;
    font-size: 13.5px;
}

/* ICONS */
.icon-left {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #3b82f6;
    font-size: 15px;
}

.icon-right {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #94a3b8;
    font-size: 15px;
    transition: color 0.2s;
}

.icon-right:hover {
    color: #1e6fef;
}

/* ================= SUBMIT BUTTON ================= */
.submit {
    width: 100%;
    padding: 14px;
    border-radius: 50px;
    border: none;
    background: #1e6fef;
    color: #fff;
    font-weight: 600;
    font-size: 15.5px;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-top: 6px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 14px rgba(30, 111, 239, 0.35);
}

.submit:hover {
    background: #1558c9;
    transform: translateY(-2.5px);
    box-shadow: 0 6px 18px rgba(30, 111, 239, 0.45);
}

.submit:active {
    transform: translateY(0);
}

.submit.loading {
    opacity: 0.75;
    pointer-events: none;
}

/* ================= FOOTER ================= */
.footer-text {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    margin-top: 24px;
    text-align: center;
}

.footer-address {
    font-size: 10.5px;
    color: #94a3b8;
    text-align: center;
    margin-top: 6px;
    line-height: 1.5;
    padding: 0 5px;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 480px) {
    body {
        padding: 12px;
    }

    .login-container {
        max-width: 100%;
    }

    .top-section {
        padding: 30px 15px 40px;
    }

    .card-illustration {
        width: 85%;
    }

    .bottom-section {
        padding: 28px 20px 20px;
    }

    .tab {
        font-size: 13px;
        padding: 9px 10px;
    }
}

/* Hide Edge native password reveal icon */
input[type='password']::-ms-reveal,
input[type='password']::-ms-clear {
    display: none;
}

/* ================= CAPTCHA ================= */
.captcha-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.captcha-img-wrapper {
    flex: 1;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.22) 0%, rgba(249, 115, 22, 0.22) 50%, rgba(59, 130, 246, 0.22) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid rgba(15, 23, 42, 0.08);
    border-radius: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0 20px;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.1);
}

.captcha-img-wrapper img {
    max-height: 34px;
    width: auto;
    object-fit: contain;
    border-radius: 6px;
    mix-blend-mode: multiply;
    filter: contrast(1.15) brightness(0.95);
}

.btn-refresh {
    width: 50px;
    height: 50px;
    border-radius: 50px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.btn-refresh:hover {
    background: #f1f5f9;
    color: #1e6fef;
    border-color: #cbd5e1;
    transform: rotate(180deg);
}

.btn-refresh:active {
    transform: scale(0.95);
}

.btn-refresh i {
    font-size: 16px;
}

/* Loading animation for refresh button */
.btn-refresh.spinning i {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

