:root {
    --primary-color: #0066CC;
    --primary-dark: #004C99;
    --secondary-color: #00A3FF;
    --accent-orange: #FF9800;
    --text-primary: #0F3F62;
    --text-secondary: #666666;
    --input-border: #E0E0E0;
    --input-focus: #0066CC;
}

[data-theme="dark"] {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --secondary-color: #60a5fa;
    --text-primary: #f8fafc;
    --text-secondary: #9ca3af;
    --bg-light: #0a0f1d;
    --bg-white: #111827;
    --border-color: #1f2937;
    --input-border: #1f2937;
    --input-focus: #3b82f6;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #0F5E9C;
    /* Dark blue background for safety */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    overflow-x: hidden;
}

/* Background Curve Container */
.login-container {
    background-color: white;
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
}

/* Top Section with blue curve */
.top-section {
    background: url('https://raw.githubusercontent.com/gist/placeholder/pattern.png'), linear-gradient(135deg, #00A3FF 0%, #0066CC 100%);
    position: relative;
    padding-top: 20px;
    padding-bottom: 80px;
    overflow: hidden;
}

/* The curved shape at the bottom of top section */
.top-section::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: white;
    clip-path: ellipse(65% 100% at 50% 100%);
}

/* Decorative circles/shapes like in reference */
.shape-1 {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.shape-2 {
    position: absolute;
    top: 40px;
    left: 10%;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

/* Illustration */
.illustration-container {
    text-align: center;
    position: relative;
    z-index: 2;
    margin-top: 20px;
}

.illustration-img {
    width: 80%;
    max-width: 320px;
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15));
}

/* Login Form Section */
.login-form-section {
    padding: 30px;
    background: white;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.login-title {
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
}

/* Input Styles */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-control {
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 12px 12px 12px 45px;
    /* Space for icon */
    font-size: 15px;
    height: 50px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 20px;
    z-index: 10;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 10;
}

/* Forgot Password Link */
.forgot-password {
    text-align: right;
    margin-bottom: 24px;
}

.forgot-password a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

/* Login Button */
.btn-login {
    background: linear-gradient(135deg, #89C4F4 0%, #5D9CEC 100%);
    /* Light blue like reference */
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 700;
    height: 50px;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(93, 156, 236, 0.3);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(93, 156, 236, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

/* Footer/Copyright */
.login-footer {
    text-align: center;
    margin-top: auto;
    padding-top: 20px;
    color: #999;
    font-size: 12px;
}

/* Floating Input Animation (Optional - keeping simple for now based on image) */
/* The reference image has placeholders inside, so using standard inputs is fine */

@media (min-width: 768px) {
    body {
        background-color: #f0f2f5;
        align-items: center;
        justify-content: center;
    }

    [data-theme="dark"] body {
        background-color: #040813;
    }

    .login-container {
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
        border-radius: 20px;
        overflow: hidden;
        min-height: auto;
        height: auto;
    }
}

/* Dark Mode Overrides */
[data-theme="dark"] .login-container,
[data-theme="dark"] .login-form-section {
    background-color: var(--bg-white) !important;
}

[data-theme="dark"] .top-section {
    background: linear-gradient(135deg, #111827 0%, #1e2937 100%) !important;
}

[data-theme="dark"] .top-section::after {
    background-color: var(--bg-white) !important;
}

[data-theme="dark"] .shape-1,
[data-theme="dark"] .shape-2 {
    background: rgba(255, 255, 255, 0.03) !important;
}

[data-theme="dark"] .form-control {
    background-color: rgba(255, 255, 255, 0.03) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .form-control::placeholder {
    color: var(--text-secondary) !important;
    opacity: 0.5 !important;
}

[data-theme="dark"] .input-icon {
    color: var(--text-secondary) !important;
    opacity: 0.7;
}

[data-theme="dark"] .form-control:focus {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--primary-color) !important;
}

[data-theme="dark"] .btn-login {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .login-footer {
    color: var(--text-light) !important;
    opacity: 0.5;
}

[data-theme="dark"] .forgot-password a,
[data-theme="dark"] .text-center p a {
    color: var(--primary-color) !important;
}

[data-theme="dark"] i.input-icon {
    color: var(--primary-color) !important;
    opacity: 0.8;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    cursor: pointer;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.3);
}

.theme-toggle i {
    font-size: 20px;
}

[data-theme="dark"] .theme-toggle {
    background: rgba(0, 0, 0, 0.3);
    color: #f8fafc;
    border-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
    .theme-toggle {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }
}

/* Toast Dark Mode Overrides */
[data-theme="dark"] .toast {
    background-color: rgba(17, 24, 39, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .toast.bg-success {
    border-left: 4px solid #10b981 !important;
}

[data-theme="dark"] .toast.bg-danger {
    border-left: 4px solid #ef4444 !important;
}

[data-theme="dark"] .toast.bg-warning {
    border-left: 4px solid #f59e0b !important;
}

[data-theme="dark"] .toast.bg-info {
    border-left: 4px solid #3b82f6 !important;
}

[data-theme="dark"] .toast-body {
    color: #f8fafc !important;
}

[data-theme="dark"] .btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.8;
}

/* SweetAlert2 Dark Mode Refinements */
[data-theme="dark"] .swal2-popup {
    background-color: var(--bg-white) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
    border-radius: 20px !important;
}

[data-theme="dark"] .swal2-title {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .swal2-html-container {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .swal2-icon {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .swal2-success-circular-line-left,
[data-theme="dark"] .swal2-success-circular-line-right,
[data-theme="dark"] .swal2-success-fix {
    background-color: transparent !important;
}

[data-theme="dark"] .swal2-confirm {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
    border-radius: 12px !important;
}

[data-theme="dark"] .swal2-cancel {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-primary) !important;
    border-radius: 12px !important;
}

[data-theme="dark"] .swal2-timer-progress-bar {
    background-color: var(--primary-color) !important;
}

[data-theme="dark"] .swal2-input,
[data-theme="dark"] .swal2-textarea {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .swal2-input:focus,
[data-theme="dark"] .swal2-textarea:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}