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

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #000;
}

/* ===== Container ===== */
.login-container {
    background: #ffffff;
    padding: 40px 30px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    width: 380px;
    text-align: center;
}

/* ===== Logo Image ===== */
.login-container img {
    max-width: 140px;
    width: 50%;
    height: auto;
    margin-bottom: 15px;
}

/* Heading */
.login-container h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    letter-spacing: 0.5px;
    color: #ce1212;
    font-weight: 700;
}

/* ===== Form ===== */
.login-form .form-group {
    margin-bottom: 20px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 40px 12px 12px;
    background: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 8px;
    color: #333;
    outline: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.input-wrapper input:focus {
    border-color: #ce1212;
    box-shadow: 0 0 0 4px rgba(206, 18, 18, 0.1);
}

.input-wrapper label {
    position: absolute;
    top: 13px;
    left: 12px;
    font-size: 0.9rem;
    color: #777;
    pointer-events: none;
    transition: 0.3s;
    background: transparent;
}

.input-wrapper input:focus+label,
.input-wrapper input:valid+label {
    top: -9px;
    left: 10px;
    font-size: 0.75rem;
    background: #fff;
    padding: 0 4px;
    color: #ce1212;
    font-weight: 500;
}

/* Password toggle */
.password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.6;
    transition: 0.3s;
}

.password-toggle:hover {
    opacity: 1;
}

.toggle-icon::before {
    content: "👁️";
    font-size: 1.1rem;
}

/* ------------------------------------------------ */
/* UPDATED FORGOT PASSWORD (CENTER & RED)           */
/* ------------------------------------------------ */
.forgot-password {
    display: block;
    margin-top: 15px;
    /* Spacing increased */
    text-align: center;
    /* CENTERED */
    color: #ce1212;
    /* RED COLOR */
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: 0.3s;
}

.forgot-password:hover {
    color: #a30e0e;
    /* Darker red on hover */
    text-decoration: underline;
}

/* Submit Button */
.login-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    background: #ce1212;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(206, 18, 18, 0.3);
}

.login-btn:hover {
    background: #b50e0e;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(206, 18, 18, 0.4);
}

/* =========================================
   MATH CAPTCHA STYLING
   ========================================= */

.d-flex.align-items-center.gap-2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    margin-bottom: 5px;
    padding: 5px;
}

.mb-3 input.form-control {
    height: 45px;
    border-radius: 8px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    outline: none;
    transition: all 0.3s ease;
    padding: 0;
}

.mb-3 input.form-control[readonly] {
    background-color: #f1f3f5;
    border: 1px solid #dee2e6;
    color: #495057;
    width: 55px;
    cursor: default;
}

.mb-3 input#captchaAnswer {
    background-color: #ffffff;
    border: 1px solid #ced4da;
    color: #000;
    width: 70px;
}

.mb-3 input#captchaAnswer:focus {
    border-color: #ce1212;
    box-shadow: 0 0 0 4px rgba(206, 18, 18, 0.15);
}

.fw-bold {
    font-weight: 800;
    font-size: 1.4rem;
    color: #ce1212;
    margin: 0 2px;
}

#refreshCaptcha {
    width: 45px;
    height: 45px;
    min-width: 45px;
    border-radius: 50%;
    border: 1px solid #ced4da;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-left: 5px;
    color: #666;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

#refreshCaptcha:hover {
    background: #fff;
    color: #ce1212;
    border-color: #ce1212;
    box-shadow: 0 4px 10px rgba(206, 18, 18, 0.2);
}

#captchaError {
    color: #ce1212;
    font-size: 0.85rem;
    margin-top: 8px;
    display: block;
    font-weight: 500;
}

.custom-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 25px;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.custom-alert-success {
    background-color: #ecf9f0;
    color: #2e7d32;
    border-left: 4px solid #2e7d32;
}

.custom-alert-error {
    background-color: #fef2f2;
    color: #ce1212;
    border-left: 4px solid #ce1212;
}

.error-message {
    color: #ce1212;
    font-size: 0.8rem;
    margin-top: 5px;
    display: block;
    text-align: left;
    font-weight: 500;
}

.d-none {
    display: none !important;
}
