:root {
    --primary: #ff2222; /* Brand Red */
    --primary-dark: #d90429;
    --dark: #0f172a;
    --gray: #64748b;
    --light-bg: #f8fafc;
    --border-color: #cbd5e1;
    --white: #ffffff;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--dark);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-card {
    background: var(--white);
    max-width: 440px;
    width: 100%;
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

/* Header & Brand Icon */
.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.brand-icon {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 34, 34, 0.1);
    color: var(--primary);
    font-size: 1.8rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    margin: 0 auto 15px auto;
}

.login-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.login-header p {
    font-size: 0.9rem;
    color: var(--gray);
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
}

.label-row label {
    margin-bottom: 0;
}

.forgot-link {
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* Input Fields with Icons */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon > i {
    position: absolute;
    left: 15px;
    color: var(--gray);
    font-size: 0.95rem;
}

.input-with-icon input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    outline: none;
    background-color: var(--white);
    color: var(--dark);
    transition: all 0.2s ease;
}

.input-with-icon input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 34, 34, 0.1);
}

/* Toggle password visibility button */
.toggle-password {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    font-size: 0.95rem;
}

.toggle-password:hover {
    color: var(--dark);
}

/* Remember Me Checkbox */
.form-remember {
    margin-bottom: 25px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 28px;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--gray);
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.2s;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--primary);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Action Button */
.btn {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(255, 34, 34, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

/* Footer Link */
.login-footer {
    border-top: 1px solid #f1f5f9;
    margin-top: 25px;
    padding-top: 20px;
    text-align: center;
    font-size: 0.88rem;
    color: var(--gray);
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* ===========================
   LOADING OVERLAY STYLES
   =========================== */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

#loading-overlay img {
    width: 9%;
    height: 19%;
    object-fit: contain;
    margin-bottom: 15px;
    background-color: #FFF;
    border-radius: 6px;
}

#loading-overlay p {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--white);
    letter-spacing: 0.3px;
}

/* ===========================
   ERROR MODAL POPUP STYLES
   =========================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: var(--white);
    max-width: 380px;
    width: 100%;
    padding: 30px 25px;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-backdrop.active .modal-card {
    transform: translateY(0);
}

.modal-icon {
    width: 55px;
    height: 55px;
    background-color: rgba(255, 34, 34, 0.1);
    color: var(--primary);
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    margin: 0 auto 15px auto;
}

.modal-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.modal-card p {
    font-size: 0.9rem;
    color: var(--gray);
    line-height: 1.5;
    margin-bottom: 25px;
}

.modal-card .btn {
    width: 100%;
}

/* --- Slide to Login Component Styles --- */
.sld_lgn_wrapper {
    position: relative;
    width: 100%;
    height: 52px;
    background-color: #f2f2f6;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 15px;
    box-sizing: border-box;
    border: 1px solid #d4d5d9;
    user-select: none;
}
.sld_lgn_track_text {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #686b78;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 1;
    pointer-events: none;
}
.sld_lgn_handle {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 75px;
    height: 49px;
    background: linear-gradient(to bottom right, #fc8019, #ff2222);
    border-radius: 9px 40px 40px 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    cursor: grab;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.sld_lgn_handle:active {
    cursor: grabbing;
}
.sld_lgn_fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: rgb(75 149 62);
    border-radius: 9px 40px 40px 9px;
    z-index: 2;
    pointer-events: none;
}
.sld_lgn_success .sld_lgn_handle {
    background: #1ba672;
}
.sld_lgn_success .sld_lgn_fill {
    background: rgba(27, 166, 114, 0.15);
}