:root {
    --primary-color: #4f46e5;
    --secondary-color: #7c3aed;
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    padding: 20px;
    position: relative;
    /* Allow natural page scrolling */
}

/* Animated Background Elements - Fixed position */
.bg-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 15s infinite linear;
}

.shape:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape:nth-child(2) {
    width: 120px;
    height: 120px;
    top: 70%;
    left: 80%;
    animation-delay: 2s;
}

.shape:nth-child(3) {
    width: 60px;
    height: 60px;
    top: 80%;
    left: 15%;
    animation-delay: 4s;
}

.shape:nth-child(4) {
    width: 100px;
    height: 100px;
    top: 30%;
    left: 85%;
    animation-delay: 6s;
}

.shape:nth-child(5) {
    width: 50px;
    height: 50px;
    top: 50%;
    left: 5%;
    animation-delay: 8s;
}

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

.auth-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 450px;
    margin: 40px auto;
    animation: slideUp 0.8s ease-out;
}

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

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    overflow: visible;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 40px;
}

.auth-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

.auth-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.auth-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 4s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.login-breadcrumb {
    position: absolute;
    top: 15px;
    left: 20px;
}

.login-breadcrumb .breadcrumb {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 0;
}

.login-breadcrumb .breadcrumb-item a {
    color: white;
    text-decoration: none;
}

.login-breadcrumb .breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.8);
}

.login-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.6);
}

.login-type-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }
}

.auth-body {
    padding: 40px 30px;
}

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

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
    display: block;
    transition: color 0.3s ease;
}

.form-control {
    border-radius: 12px;
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    font-size: 1rem;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.15);
    transform: translateY(-2px);
}

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

.input-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    transition: color 0.3s ease;
}

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

.btn-auth {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: 12px;
    padding: 15px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(79, 70, 229, 0.3);
}

.btn-auth::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: left 0.5s;
}

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

.btn-auth:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.btn-auth:active {
    transform: translateY(-1px);
}

.social-login-buttons {
    display: flex;
    gap: 12px;
    margin: 25px 0;
}

.btn-social {
    flex: 1;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: white;
    color: #374151;
    position: relative;
    overflow: hidden;
}

.btn-social::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, currentColor 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-social:hover::before {
    opacity: 0.1;
}

.btn-google {
    border-color: #dadce0;
}

.btn-google:hover {
    border-color: #4285f4;
    color: #4285f4;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(66, 133, 244, 0.2);
}

.btn-facebook {
    border-color: #1877f2;
    color: #1877f2;
}

.btn-facebook:hover {
    background: #1877f2;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(24, 119, 242, 0.3);
}

.divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
}

.divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e9ecef, transparent);
}

.divider-text {
    background: white;
    padding: 0 15px;
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
}

.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.form-check-input {
    margin-right: 10px;
    transform: scale(1.2);
}

.form-check-label {
    font-weight: 500;
    color: var(--dark-color);
}

.alert {
    border-radius: 12px;
    padding: 15px 20px;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.alert a {
    text-decoration: underline;
    font-weight: 600;
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-footer a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.pulse {
    animation: pulse 2s infinite;
}

/* Responsive Design */
@media (max-width: 576px) {
    body {
        padding: 10px;
    }
    
    .auth-container {
        margin: 20px auto;
    }
    
    .auth-card {
        margin-bottom: 20px;
    }
    
    .auth-header {
        padding: 30px 20px;
    }
    
    .auth-body {
        padding: 30px 20px;
    }
    
    .social-login-buttons {
        flex-direction: column;
    }
    
    .login-breadcrumb {
        position: relative;
        top: 0;
        left: 0;
        margin-bottom: 15px;
    }
}

/* Loading animation for form submission */
.btn-auth.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-auth.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ripple effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Focus state for form groups */
.form-group.focused .form-label {
    color: var(--primary-color);
}

/* SEO: Improve accessibility for screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for better accessibility */
.btn-auth:focus,
.btn-social:focus,
.form-control:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Improved Input Wrapper Design */
.input-wrapper {
    position: relative;
    width: 100%;
}

.input-icon-left {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 1.1rem;
    transition: color 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.input-wrapper .form-control {
    padding-left: 50px;
    padding-right: 50px;
}

.input-wrapper.focused .input-icon-left {
    color: var(--primary-color);
}

/* Password Toggle Button */
.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 8px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    z-index: 2;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
}

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

.password-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

/* Remove old input-icon styles */
.input-icon {
    display: none;
}

/* Enhanced form control for better spacing with icons */
.form-control {
    height: 52px;
    font-size: 1rem;
    font-weight: 500;
}

.form-control::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.form-control:focus::placeholder {
    color: #d1d5db;
}

/* Improved form check */
.form-check {
    padding-left: 0;
    margin-bottom: 25px;
}

.form-check-input {
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.25);
}

.form-check-label {
    cursor: pointer;
    user-select: none;
}
