:root {
    --primary: #e94560;
    --primary-dark: #c23a51;
    --secondary: #0f3460;
    --accent: #ffcc00;
    --dark: #1a1a2e;
    --light: #f8f9fa;
    --error: #dc3545;
    --success: #28a745;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #0c0c14 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
}

/* Remove blue outline on focus for all elements */
*:focus {
    outline: none !important;
}

/* Custom focus states */
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.25rem rgba(233, 69, 96, 0.25) !important;
    border-color: var(--primary) !important;
}

/* Animated background elements */
.bg-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-element {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(233, 69, 96, 0.1) 0%, rgba(233, 69, 96, 0) 70%);
    animation: float 15s infinite linear;
}

.bg-element:nth-child(1) {
    width: 300px;
    height: 300px;
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.bg-element:nth-child(2) {
    width: 200px;
    height: 200px;
    bottom: 15%;
    right: 10%;
    animation-delay: -5s;
    background: radial-gradient(circle, rgba(255, 204, 0, 0.08) 0%, rgba(255, 204, 0, 0) 70%);
}

.bg-element:nth-child(3) {
    width: 150px;
    height: 150px;
    top: 50%;
    left: 80%;
    animation-delay: -10s;
    background: radial-gradient(circle, rgba(15, 52, 96, 0.1) 0%, rgba(15, 52, 96, 0) 70%);
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.7;
    }
    33% {
        transform: translateY(-30px) rotate(120deg);
        opacity: 0.4;
    }
    66% {
        transform: translateY(20px) rotate(240deg);
        opacity: 0.6;
    }
    100% {
        transform: translateY(0) rotate(360deg);
        opacity: 0.7;
    }
}

/* Login container */
.login-container {
    max-width: 1100px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* Logo/Header area */
.login-header {
    text-align: center;
    margin-bottom: 30px;
    width: 100%;
    animation: slideDown 0.8s ease-out;
}

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

.logo {
    font-size: 3.5rem;
    color: var(--accent);
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255, 204, 0, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        text-shadow: 0 0 20px rgba(255, 204, 0, 0.7);
    }
    50% {
        text-shadow: 0 0 30px rgba(255, 204, 0, 0.9), 0 0 40px rgba(255, 204, 0, 0.5);
    }
    100% {
        text-shadow: 0 0 20px rgba(255, 204, 0, 0.7);
    }
}

.login-header h1 {
    font-weight: 800;
    color: white;
    font-size: 2.8rem;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.login-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

/* Main card */
.login-card {
    display: flex;
    width: 100%;
    background: rgba(15, 23, 42, 0.85);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeIn 1s ease-out 0.3s both;
}

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

/* Left side - Visual */
.login-visual {
    flex: 1;
    background: linear-gradient(135deg, rgba(233, 69, 96, 0.15) 0%, rgba(15, 52, 96, 0.25) 100%);
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.visual-content {
    text-align: center;
    color: white;
    z-index: 2;
    position: relative;
}

.visual-icon {
    font-size: 5rem;
    color: var(--accent);
    margin-bottom: 25px;
    animation: floatIcon 4s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(5deg);
    }
}

.visual-content h3 {
    font-weight: 700;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.visual-content p {
    opacity: 0.9;
    font-size: 1rem;
    line-height: 1.6;
    max-width: 300px;
}

.features-list {
    margin-top: 30px;
    text-align: left;
    width: 100%;
    max-width: 280px;
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.85);
}

.feature-item i {
    color: var(--accent);
    margin-right: 12px;
    font-size: 1.2rem;
}

/* Right side - Form */
.login-form {
    flex: 1;
    padding: 50px 40px;
    background: rgba(255, 255, 255, 0.98);
}

.form-header {
    margin-bottom: 30px;
}

.form-header h2 {
    color: var(--dark);
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 8px;
}

.form-header p {
    color: #6c757d;
    font-size: 0.95rem;
}

/* Form elements - FIXED VERSION */
.form-label {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}

.form-label i {
    margin-right: 8px;
    color: var(--primary);
}

.input-group {
    margin-bottom: 5px;
    position: relative;
    /* Ensure consistent border behavior */
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

/* FIXED: Apply border to entire input-group when focused or invalid */
.input-group:focus-within {
    border: 2px solid var(--primary);
    border-radius: 0.375rem;
}

.input-group.invalid {
    border: 2px solid var(--error);
    border-radius: 0.375rem;
}

.input-group.valid {
    border: 2px solid var(--success);
    border-radius: 0.375rem;
}

/* Remove individual borders from child elements */
.input-group-text,
.form-control,
.password-toggle {
    border: none !important;
}

/* First input-group-text (left icon) */
.input-group > .input-group-text:first-child {
    border-top-left-radius: 0.375rem !important;
    border-bottom-left-radius: 0.375rem !important;
    border-right: 1px solid #e1e5e9 !important;
}

/* Last element (password toggle) */
.input-group > .password-toggle:last-child {
    border-top-right-radius: 0.375rem !important;
    border-bottom-right-radius: 0.375rem !important;
    border-left: 1px solid #e1e5e9 !important;
}

/* Middle elements (form controls) */
.form-control {
    padding: 16px 20px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fff;
    border-radius: 0 !important;
}

/* Remove default focus styles */
.form-control:focus {
    box-shadow: none !important;
    background: #fff;
}

/* Input group text styling */
.input-group-text {
    background: #f8f9fa;
    padding: 0 20px;
    color: #6c757d;
    transition: all 0.3s ease;
}

/* Password toggle styling */
.password-toggle {
    background: #f8f9fa;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.3s ease;
    padding: 0 20px;
}

.password-toggle:hover {
    background: #e9ecef;
    color: var(--primary);
}

/* When input group is focused, style the icons */
.input-group:focus-within .input-group-text,
.input-group:focus-within .password-toggle {
    background: #fff;
    color: var(--primary);
}

.input-group:focus-within > .input-group-text:first-child {
    border-right-color: var(--primary) !important;
}

.input-group:focus-within > .password-toggle:last-child {
    border-left-color: var(--primary) !important;
}

/* Invalid state styles */
.input-group.invalid > .input-group-text:first-child {
    border-right-color: var(--error) !important;
}

.input-group.invalid > .password-toggle:last-child {
    border-left-color: var(--error) !important;
}

.input-group.invalid .input-group-text,
.input-group.invalid .password-toggle {
    background: #fff;
    color: var(--error);
}

/* Valid state styles */
.input-group.valid > .input-group-text:first-child {
    border-right-color: var(--success) !important;
}

.input-group.valid > .password-toggle:last-child {
    border-left-color: var(--success) !important;
}

.input-group.valid .input-group-text,
.input-group.valid .password-toggle {
    background: #fff;
    color: var(--success);
}

.btn-login {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 12px;
    padding: 18px;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    margin-top: 10px;
    width: 100%;
    color: white;
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(233, 69, 96, 0.4);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(233, 69, 96, 0.25);
}

.forgot-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

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

.register-link {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

.register-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

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

.register-link:hover::after {
    width: 100%;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(220, 53, 69, 0.05) 100%);
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.alert-danger ul {
    margin-bottom: 0;
    padding-left: 20px;
}

.alert-danger li {
    color: #dc3545;
    font-size: 0.9rem;
}

.social-login {
    margin-top: 30px;
    text-align: center;
}

.social-login p {
    color: #6c757d;
    margin-bottom: 15px;
    font-size: 0.9rem;
    position: relative;
}

.social-login p::before,
.social-login p::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: #e1e5e9;
}

.social-login p::before {
    left: 0;
}

.social-login p::after {
    right: 0;
}

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    color: #6c757d;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.social-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.social-btn.google:hover {
    background: #db4437;
    color: white;
    border-color: #db4437;
}

.social-btn.facebook:hover {
    background: #4267B2;
    color: white;
    border-color: #4267B2;
}

.social-btn.twitter:hover {
    background: #1DA1F2;
    color: white;
    border-color: #1DA1F2;
}

/* Loading animation for button */
.btn-login.loading {
    position: relative;
    pointer-events: none;
}

.btn-login.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Progress indicator */
.progress-indicator {
    display: flex;
    justify-content: center;
    margin-top: 25px;
}

.progress-step {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e1e5e9;
    margin: 0 5px;
    transition: all 0.3s ease;
}

.progress-step.active {
    background: var(--primary);
    transform: scale(1.3);
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .login-card {
        flex-direction: column;
    }
    
    .login-visual {
        padding: 30px;
    }
    
    .login-form {
        padding: 40px 30px;
    }
}

@media (max-width: 576px) {
    .login-header h1 {
        font-size: 2.2rem;
    }
    
    .logo {
        font-size: 2.8rem;
    }
    
    .login-visual, .login-form {
        padding: 30px 25px;
    }
    
    .visual-icon {
        font-size: 4rem;
    }
}

/* Success animation */
@keyframes success {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.success-animation {
    animation: success 0.5s ease;
}

/* Error message styling */
.error-message {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 4px;
    display: block;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.error-message.show {
    opacity: 1;
    transform: translateY(0);
}