/* Modern Authentication Styles with Animated Background */

/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Modern Body Styling */
.modern-auth-body {
    font-family: 'Fira Sans Condensed', 'Audiowide', sans-serif !important;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background: linear-gradient(-45deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #4facfe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* Animated Background Gradient */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Floating Particles Background */
.modern-auth-body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 40% 60%, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.06) 3px, transparent 3px),
        radial-gradient(circle at 60% 80%, rgba(255, 255, 255, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 30% 90%, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        radial-gradient(circle at 90% 70%, rgba(255, 255, 255, 0.08) 2px, transparent 2px);
    background-size: 200px 200px, 150px 150px, 180px 180px, 220px 220px, 160px 160px, 190px 190px;
    animation: floatingParticles 20s linear infinite;
}

@keyframes floatingParticles {
    0% {
        transform: translate(0px, 0px);
    }
    33% {
        transform: translate(30px, -30px);
    }
    66% {
        transform: translate(-20px, 20px);
    }
    100% {
        transform: translate(0px, 0px);
    }
}

/* Geometric Shapes Animation */
.modern-auth-body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    background-image:
        linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.03) 50%, transparent 60%),
        linear-gradient(-45deg, transparent 40%, rgba(255, 255, 255, 0.03) 50%, transparent 60%);
    background-size: 100px 100px, 100px 100px;
    animation: geometricMove 25s ease-in-out infinite alternate;
}

@keyframes geometricMove {
    0% {
        background-position: 0% 0%, 100% 100%;
    }
    100% {
        background-position: 100% 100%, 0% 0%;
    }
}

/* Auth Container with improved layering */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 10;
}

/* Auth Card */
.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 450px;
    padding: 40px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    animation: slideUp 0.6s ease;
}

.auth-card.register-card {
    max-width: 600px;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4A90E2, #8F58BC, #E94B3C);
    border-radius: 20px 20px 0 0;
}

/* Auth Header */
.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.brand-title {
    font-family: 'Audiowide', 'Fira Sans Condensed', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #4A90E2, #8F58BC);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-title {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.auth-subtitle {
    color: #7f8c8d;
    font-size: 16px;
    margin: 0;
}

/* Form Styles */
.auth-form {
    margin-top: 30px;
}

.form-group-modern {
    margin-bottom: 25px;
    position: relative;
}

.input-wrapper, .select-wrapper {
    position: relative;
    margin-bottom: 5px;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
    font-size: 16px;
    z-index: 2;
    transition: all 0.3s ease;
}

.form-control-modern {
    width: 100%;
    padding: 16px 50px 16px 45px;
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    font-size: 16px;
    background: #fff;
    transition: all 0.3s ease;
    outline: none;
    font-family: 'Fira Sans Condensed', sans-serif;
}

.form-control-modern:focus {
    border-color: #4A90E2;
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.1);
}

.form-control-modern:focus + .floating-label,
.input-wrapper.focused .floating-label,
.select-wrapper.focused .floating-label {
    top: -10px;
    font-size: 12px;
    color: #4A90E2;
    background: #fff;
    padding: 0 8px;
}

.form-control-modern:focus ~ .input-icon,
.input-wrapper.focused .input-icon,
.select-wrapper.focused .input-icon {
    color: #4A90E2;
}

.form-control-modern.is-invalid {
    border-color: #e74c3c;
}

.floating-label {
    position: absolute;
    left: 45px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
    font-size: 16px;
    transition: all 0.3s ease;
    pointer-events: none;
    font-weight: 400;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.password-toggle:hover {
    color: #4A90E2;
}

/* Select Styling */
select.form-control-modern {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px 12px;
    padding-right: 40px;
}

/* Invalid Feedback */
.invalid-feedback-modern {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.help-text {
    color: #95a5a6;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 25px 0;
    flex-wrap: wrap;
    gap: 15px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-checkbox {
    width: 18px;
    height: 18px;
    appearance: none;
    border: 2px solid #e0e6ed;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.custom-checkbox:checked {
    background: #4A90E2;
    border-color: #4A90E2;
}

.custom-checkbox:checked::before {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-label {
    font-size: 14px;
    color: #2c3e50;
    cursor: pointer;
    margin: 0;
}

.forgot-password {
    color: #4A90E2;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.forgot-password:hover {
    color: #357abd;
    text-decoration: none;
}

/* Button Styles */
.btn-modern {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Fira Sans Condensed', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary-modern {
    background: linear-gradient(135deg, #4A90E2, #357abd);
    color: white;
    box-shadow: 0 8px 16px rgba(74, 144, 226, 0.3);
}

.btn-primary-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(74, 144, 226, 0.4);
    background: linear-gradient(135deg, #357abd, #2980b9);
}

.btn-primary-modern:active {
    transform: translateY(0);
}

/* Auth Footer */
.auth-footer {
    margin-top: 30px;
    text-align: center;
}

.switch-auth {
    color: #7f8c8d;
    font-size: 14px;
    margin: 0;
}

.switch-link {
    color: #4A90E2;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.switch-link:hover {
    color: #357abd;
    text-decoration: none;
}

/* Alert Styles */
.alert-modern {
    border: none;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.alert-info.alert-modern {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(41, 128, 185, 0.1));
    color: #2980b9;
    border-left: 4px solid #3498db;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-container {
        padding: 10px;
    }
    
    .auth-card {
        padding: 30px 20px;
        border-radius: 16px;
    }
    
    .auth-card.register-card {
        max-width: 100%;
    }
    
    .brand-title {
        font-size: 24px;
    }
    
    .auth-title {
        font-size: 20px;
    }
    
    .form-options {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .form-row .form-group-modern {
        margin-bottom: 20px;
    }
}

@media (max-width: 576px) {
    .form-control-modern {
        font-size: 14px;
        padding: 14px 40px 14px 40px;
    }
    
    .floating-label {
        left: 40px;
        font-size: 14px;
    }
    
    .input-icon {
        left: 12px;
        font-size: 14px;
    }
    
    .password-toggle {
        right: 12px;
        font-size: 14px;
    }
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Loading state */
.btn-modern:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.btn-modern.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Focus trap for accessibility */
.auth-card:focus-within {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Form row for registration */
.form-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -10px;
    margin-left: -10px;
}

.form-row .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding-right: 10px;
    padding-left: 10px;
}

@media (max-width: 768px) {
    .form-row .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .auth-card {
        background: rgba(45, 55, 72, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .brand-title, .auth-title {
        color: #e2e8f0;
    }
    
    .auth-subtitle {
        color: #a0aec0;
    }
    
    .form-control-modern {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
        color: #e2e8f0;
    }
    
    .form-control-modern:focus + .floating-label,
    .input-wrapper.focused .floating-label,
    .select-wrapper.focused .floating-label {
        background: rgba(45, 55, 72, 0.95);
    }
    
    .checkbox-label, .switch-auth {
        color: #e2e8f0;
    }
    
    .help-text {
        color: #a0aec0;
    }
}