:root {
    --primary-color: #4F46E5;
    /* Indigo-600 */
    --primary-hover: #4338CA;
    /* Indigo-700 */
    --secondary-color: #0EA5E9;
    /* Sky-500 */
    --accent-color: #8B5CF6;
    /* Violet-500 */
    --surface-color: #ffffff;
    --background-color: #F3F4F6;
    --text-main: #111827;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;
    --success-color: #10B981;
    --danger-color: #EF4444;
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --font-family: 'DM Sans', 'Inter', sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-main);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Background Animation */
.bg-animated {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    opacity: 0.1;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Header */
.navbar-brand img {
    height: 40px;
}

.modern-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

/* Main Layout */
.login-wrapper {
    display: flex;
    min-height: 100vh;
    padding-top: 80px;
    /* Header height */
    align-items: center;
    justify-content: center;
}

.login-card-container {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    max-width: 1100px;
    width: 90%;
    overflow: hidden;
    margin: 2rem auto;
    min-height: 600px;
}

/* Left Column - Branding */
.branding-section {
    flex: 1;
    background: linear-gradient(135deg, #0EA5E9 0%, #2563EB 100%);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: white;
    position: relative;
    overflow: hidden;
}

.branding-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 2rem;
    width: fit-content;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.brand-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.brand-content p {
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.features-list li {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.features-list li i {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 0.75rem;
}

/* Right Column - Form */
.form-section {
    flex: 1;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: white;
}

.form-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.form-header h2 {
    font-size: 1.8rem;
    color: var(--text-main);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.form-header p {
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.2s ease;
    background-color: #F9FAFB;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: white;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper i {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    z-index: 5;
    width: 1.5rem;
    text-align: center;
}

/* Left side icon (envelope, lock) */
.input-icon-wrapper i:not(.password-toggle) {
    left: 0.75rem;
    pointer-events: none;
}

.input-with-icon {
    padding-left: 3.5rem !important;
}

.password-toggle {
    left: auto !important;
    right: 1rem !important;
    cursor: pointer;
    padding: 0.25rem;
    z-index: 10;
}

.password-toggle:hover {
    color: var(--primary-color);
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.forgot-password:hover {
    text-decoration: underline;
}

.btn-primary {
    width: 100%;
    padding: 0.875rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.register-prompt {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.register-prompt a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* Footer (Simplified - Inside Card) */
.simple-footer {
    text-align: center;
    padding-top: 2rem;
    margin-top: auto;
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-top: 1px solid var(--background-color);
}

.simple-footer p {
    margin-bottom: 0.5rem;
}

.simple-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    margin: 0 0.5rem;
    font-size: 0.8rem;
}

.simple-footer a:hover {
    color: var(--primary-color);
}

/* Responsive - Tablet View (Glassmorphism) */
@media (max-width: 992px) and (min-width: 577px) {

    /* Glassmorphism Background */
    body {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        min-height: 100vh;
    }

    .bg-animated {
        opacity: 0.1 !important;
    }

    .modern-header {
        display: none !important;
    }

    .branding-section {
        display: none;
    }

    .login-wrapper {
        padding-top: 0;
        align-items: center;
        height: 100vh;
        background: transparent;
        padding: 2rem;
    }

    /* Glass Card */
    .login-card-container {
        border-radius: 25px;
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-top: 1px solid rgba(255, 255, 255, 0.5);
        border-left: 1px solid rgba(255, 255, 255, 0.5);
        max-width: 550px;
        width: 100%;
        margin: 0 auto;
        height: auto;
        min-height: auto;
        box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
        background: rgba(255, 255, 255, 0.5);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        overflow: hidden;
    }

    .form-section {
        padding: 3rem 2.5rem;
        background: transparent;
    }

    /* Typography */
    .form-header h2 {
        color: #1a1a1a;
        text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
    }

    .form-header p {
        color: #4a4a4a;
    }

    /* Glass Inputs */
    .form-control {
        background-color: rgba(255, 255, 255, 0.25);
        border: 1px solid rgba(255, 255, 255, 0.4);
        color: #1a1a1a;
    }

    .form-control::placeholder {
        color: rgba(0, 0, 0, 0.4);
    }

    .form-control:focus {
        background-color: rgba(255, 255, 255, 0.35);
        box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.6);
    }

    .input-icon-wrapper i:not(.password-toggle) {
        color: rgba(0, 0, 0, 0.5);
    }

    .password-toggle {
        color: rgba(0, 0, 0, 0.5);
    }

    /* Shining Button */
    .btn-primary {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: #ffffff;
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
        position: relative;
        overflow: hidden;
    }

    .btn-primary::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: linear-gradient(45deg,
                transparent,
                rgba(255, 255, 255, 0.3),
                transparent);
        transform: rotate(45deg);
        animation: shine 3s infinite;
    }

    @keyframes shine {
        0% {
            left: -50%;
        }

        100% {
            left: 150%;
        }
    }

    .btn-primary:active {
        transform: scale(0.98);
        background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    }

    .form-check-label,
    .forgot-password,
    .register-prompt {
        color: #3a3a3a;
    }

    .register-prompt a {
        color: #1a1a1a;
    }

    /* Tablet Logo - Centered White Box */
    .text-center.mb-4.d-lg-none {
        background: transparent;
        display: block;
        padding: 0;
        margin: 0 auto 2rem auto !important;
        width: 100%;
        text-align: center;
        box-shadow: none;
        border: none;
    }

    .text-center.mb-4.d-lg-none img {
        height: 60px !important;
        filter: none;
        margin: 0 auto;
        display: inline-block;
    }
}

/* Fallback for smaller tablets */
@media (max-width: 576px) {

    /* Glassmorphism Background */
    body {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        min-height: 100vh;
    }

    .bg-animated {
        opacity: 0.1 !important;
        /* Keep faint texture */
    }

    .branding-section {
        display: none !important;
    }

    .modern-header {
        display: none !important;
    }

    .login-wrapper {
        padding-top: 0;
        padding: 0.75rem;
        align-items: center;
        justify-content: center;
        height: 100vh;
        background: transparent;
        display: flex;
    }

    /* Glass Card */
    .login-card-container {
        border-radius: 20px;
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-top: 1px solid rgba(255, 255, 255, 0.5);
        /* Highlight */
        border-left: 1px solid rgba(255, 255, 255, 0.5);
        /* Highlight */
        width: 100%;
        max-width: 100%;
        margin: 0;
        height: auto;
        min-height: auto;
        box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
        background: rgba(255, 255, 255, 0.5);
        /* Glass Base - darker for better visibility */
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        overflow: hidden;
    }

    .form-section {
        padding: 1.5rem 1.25rem;
        justify-content: center;
        background: transparent;
        min-height: auto;
    }

    /* Ensure all elements are responsive */
    * {
        box-sizing: border-box;
    }

    .form-section *,
    .login-card-container * {
        max-width: 100%;
    }

    /* Typography on Glass */
    .form-header {
        text-align: center;
        margin-bottom: 1.75rem;
    }

    .form-header h2 {
        font-size: 1.65rem;
        font-weight: 700;
        letter-spacing: -0.5px;
        color: #1a1a1a;
        /* Dark text for visibility */
        margin-bottom: 0.5rem;
        text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
    }

    .form-header p {
        font-size: 0.95rem;
        color: #4a4a4a;
    }

    /* Glass Inputs */
    .form-control {
        background-color: rgba(255, 255, 255, 0.25);
        border: 1px solid rgba(255, 255, 255, 0.4);
        border-radius: 15px;
        padding: 1rem 1rem;
        font-size: 16px;
        height: 50px;
        color: #1a1a1a;
        transition: all 0.2s;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .form-control::placeholder {
        color: rgba(0, 0, 0, 0.4);
    }

    .form-control:focus {
        background-color: rgba(255, 255, 255, 0.35);
        box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.6);
    }

    .input-with-icon {
        padding-left: 3rem !important;
        padding-right: 1rem !important;
    }

    .input-icon-wrapper i:not(.password-toggle) {
        color: rgba(0, 0, 0, 0.5);
        left: 1.25rem;
    }

    .password-toggle {
        right: 1.25rem !important;
        color: rgba(0, 0, 0, 0.5);
    }

    .form-group {
        margin-bottom: 1.25rem;
    }

    .form-label {
        display: none;
    }

    /* Glass Buttons with Shining Effect */
    .btn-primary {
        width: 100%;
        max-width: 100%;
        height: 50px;
        border-radius: 15px;
        font-size: 1.05rem;
        font-weight: 600;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: #ffffff;
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
        margin-top: 1rem;
        border: none;
        position: relative;
        overflow: hidden;
        box-sizing: border-box;
    }

    .btn-primary::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: linear-gradient(45deg,
                transparent,
                rgba(255, 255, 255, 0.3),
                transparent);
        transform: rotate(45deg);
        animation: shine 3s infinite;
    }

    @keyframes shine {
        0% {
            left: -50%;
        }

        100% {
            left: 150%;
        }
    }

    .btn-primary:active {
        transform: scale(0.98);
        background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    }

    .form-check-label {
        color: #3a3a3a;
    }

    .forgot-password {
        color: #2a2a2a;
        font-weight: 600;
    }

    .register-prompt {
        font-size: 1rem;
        color: #4a4a4a;
        margin-top: 2rem;
    }

    .register-prompt a {
        color: #1a1a1a;
        text-decoration: underline;
    }

    /* Footer adjustments */
    .simple-footer {
        padding: 1rem;
        font-size: 0.75rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        opacity: 0.8;
        color: rgba(255, 255, 255, 0.6);
    }

    .simple-footer a {
        color: rgba(255, 255, 255, 0.8);
    }

    /* Mobile Logo - Centered White Box */
    .text-center.mb-4.d-lg-none {
        background: rgba(255, 255, 255, 0.95);
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0.875rem 1.5rem;
        border-radius: 14px;
        margin: 0 auto 1.5rem auto !important;
        width: fit-content;
        max-width: 85%;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.8);
    }

    .text-center.mb-4.d-lg-none img {
        height: 45px !important;
        filter: none;
        /* Show original logo colors */
        margin-bottom: 0;
        display: block;
    }
}

/* Captcha Styling */
#captchaImage {
    height: 48px !important;
    width: auto;
    min-width: 120px;
    object-fit: cover;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

#captchaImage:hover {
    border-color: var(--primary-color);
}

.captcha-refresh-btn {
    height: 48px;
    width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.captcha-refresh-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    cursor: pointer;
}

.captcha-refresh-btn i {
    transition: transform 0.3s ease;
}

.captcha-refresh-btn:hover i {
    transform: rotate(180deg);
    color: var(--primary-color);
}

/* Glassmorphism Adjustments */
@media (max-width: 992px) {
    #captchaImage {
        border-color: rgba(255, 255, 255, 0.4) !important;
        opacity: 0.95;
    }

    .captcha-refresh-btn {
        border-color: rgba(255, 255, 255, 0.4);
        background: rgba(255, 255, 255, 0.2);
    }

    .captcha-refresh-btn:hover {
        background: rgba(255, 255, 255, 0.4);
        border-color: rgba(255, 255, 255, 0.6);
    }
}