* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #8b5cf6;
    --dark: #0f172a;
    --dark-light: #1e293b;
    --dark-lighter: #334155;
    --light: #f8fafc;
    --gray: #94a3b8;
    --gray-light: #475569;
    --success: #10b981;
    --error: #ef4444;
    --border-radius: 16px;
    --shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--light);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("/themes/default/img/frontend/backgrounds/login.jpg");
    background-size: cover;
    background-position: center;
    filter: blur(6px) brightness(0.2);
    z-index: -1;
    transform: scale(1.1);
}

.container {
    display: flex;
    width: 100%;
    max-width: 1000px;
    height: 600px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--dark-light);
    border: 1px solid var(--dark-lighter);
    animation: fadeIn 0.8s ease-out;
}

.login-section {
    flex: 1;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--dark-light);
    position: relative;
    overflow: hidden;
}

.login-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient);
}

.graphic-section {
    flex: 1;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.graphic-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("/themes/default/img/frontend/backgrounds/login.jpg");
    background-size: cover;
    background-position: center;
    opacity: 0.1;
    z-index: 0;
}

.graphic-content {
    text-align: center;
    color: white;
    z-index: 1;
    max-width: 100%;
    position: relative;
    animation: slideUp 0.8s ease-out 0.2s both;
}

.graphic-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.graphic-content p {
    font-size: 1.1rem;
    opacity: 0.9;
    line-height: 1.6;
}

.logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo img {
    height: 60px;
    max-width: 100%;
    filter: brightness(0) invert(1);
}

.welcome-text {
    margin-bottom: 2rem;
    text-align: center;
}

.welcome-text h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--light);
}

.welcome-text p {
    color: var(--gray);
    font-size: 1rem;
}

.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    animation: slideIn 0.4s ease-out;
    font-size: 0.9rem;
    position: relative;
    z-index: 2;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert i {
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--light);
}

.input-with-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    transition: var(--transition);
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--dark);
    color: var(--light);
    position: relative;
    z-index: 2;
}

.form-control::placeholder {
    color: var(--gray);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: var(--dark);
}

.form-control:focus + .input-icon {
    color: var(--primary);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.checkbox-container {
    display: flex;
    align-items: center;
}

.checkbox {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 0.5rem;
}

.checkbox input {
    opacity: 0;
    width: 0;
    height: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: var(--dark);
    border: 1px solid var(--gray-light);
    border-radius: 4px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.checkbox input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "✓";
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    display: none;
}

.checkbox input:checked ~ .checkmark:after {
    display: block;
}

.forgot-password {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    font-weight: 500;
    position: relative;
    z-index: 10;
}

.forgot-password:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.btn {
    display: block;
    width: 100%;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    position: relative;
    overflow: hidden;
    z-index: 2;
}

.btn-primary {
    background: var(--gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.support-link {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
    color: var(--gray);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    position: relative;
    z-index: 10;
}

.support-link:hover {
    color: var(--primary);
}

.password-field {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition);
    z-index: 3;
}

.password-toggle:hover {
    color: var(--primary);
    background-color: rgba(99, 102, 241, 0.1);
}

.password-toggle:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.input-with-icon.password-field .form-control {
    padding-right: 45px;
}

.loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.loading span {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin: 0 2px;
    background-color: white;
    animation: loading 1.4s infinite ease-in-out both;
}

.loading span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading span:nth-child(2) {
    animation-delay: -0.16s;
}

.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1; /* Changed from 0 to 1 to be above background but below content */
    pointer-events: none; /* This prevents shapes from blocking clicks */
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.08);
    animation: float 15s infinite ease-in-out;
    pointer-events: none; /* Ensure shapes don't block clicks */
}

.shape-1 {
    width: 100px;
    height: 100px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 150px;
    height: 150px;
    bottom: 10%;
    right: 10%;
    animation-delay: -5s;
}

.shape-3 {
    width: 70px;
    height: 70px;
    top: 50%;
    right: 20%;
    animation-delay: -10s;
}

/* Content wrapper to ensure clickability */
.content-wrapper {
    position: relative;
    z-index: 10;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loading {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    33% {
        transform: translateY(-20px) rotate(120deg);
    }
    66% {
        transform: translateY(10px) rotate(240deg);
    }
}

/* Additional dark theme enhancements */
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--light);
    -webkit-box-shadow: 0 0 0px 1000px var(--dark) inset;
    transition: background-color 5000s ease-in-out 0s;
}

@media (max-width: 768px) {
    body {
        padding: 0.5rem;
        overflow-y: auto;
        background: var(--dark);
    }
    
    .container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        border: 1px solid var(--dark-lighter);
    }
    
    .graphic-section {
        padding: 2rem 1rem;
        min-height: 250px;
    }
    
    .graphic-content h2 {
        font-size: 1.5rem;
    }
    
    .graphic-content p {
        font-size: 1rem;
    }
    
    .login-section {
        padding: 2rem 1.5rem;
        background: var(--dark-light);
    }
}

@media (max-height: 700px) {
    .container {
        height: auto;
        min-height: auto;
    }
    
    .login-section {
        padding: 2rem;
    }
}