/* Authentication Pages - Modern Design */

/* Main container for auth pages */
.auth-page {
    background: #ffffff;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    padding: 0 !important;
    margin: 0;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Background with animated shapes */
.auth-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 0;
}

.auth-background::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0.02;
    transform: rotate(-15deg);
}

/* Floating shapes animation */
.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.08;
    animation: float 25s infinite ease-in-out;
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    top: -20%;
    left: -10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    bottom: -20%;
    right: -10%;
    animation-delay: 8s;
}

.shape-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    top: 40%;
    left: 60%;
    animation-delay: 16s;
}

@keyframes float {
    0%, 100% { 
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    25% { 
        transform: translate(30px, -40px) scale(1.1) rotate(90deg);
    }
    50% { 
        transform: translate(-20px, 30px) scale(0.9) rotate(180deg);
    }
    75% { 
        transform: translate(40px, 20px) scale(1.05) rotate(270deg);
    }
}

/* Auth content container */
.auth-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    padding: 2rem;
}

/* Auth card with glass morphism */
.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.7) inset;
    border: 1px solid rgba(255, 255, 255, 0.8);
    overflow: hidden;
    position: relative;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.auth-card-inner {
    padding: 3rem;
}

/* Auth header */
.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    transform: rotate(-5deg);
    transition: transform 0.3s ease;
}

.auth-icon:hover {
    transform: rotate(0deg) scale(1.05);
}

.auth-icon i {
    font-size: 2rem;
    color: white;
}

.auth-title {
    font-size: 2rem;
    font-weight: 800;
    color: #1a202c;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    color: #718096;
    font-size: 1.125rem;
    margin: 0;
}

/* Modern form controls */
.form-group {
    margin-bottom: 1.5rem;
}

/* Visually hidden labels for accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.form-control-modern {
    height: 60px;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background-color: #ffffff;
    background-clip: padding-box;
    transition: all 0.3s ease;
}

.form-control-modern:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background-color: #ffffff;
    background-clip: padding-box;
    outline: none;
}

/* Placeholder styling */
.form-control-modern::placeholder {
    color: #a0aec0;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.form-control-modern:focus::placeholder {
    opacity: 0;
}

.form-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #cbd5e0;
    font-size: 1.25rem;
    pointer-events: none;
    transition: color 0.3s ease;
    z-index: 2;
}

.form-floating:focus-within .form-icon {
    color: #667eea;
}

/* Checkbox styling */
.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #cbd5e0;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.form-check-label {
    color: #4a5568;
    margin-left: 0.5rem;
}

/* Links */
.forgot-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: #5a67d8;
    text-decoration: underline;
}

/* Submit button */
.btn-auth {
    height: 56px;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}

.btn-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.35);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-gradient::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 ease;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.45);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46a2 100%);
}

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

.btn-gradient:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.35);
}

/* Auth footer */
.auth-footer {
    margin-top: 2.5rem;
}

.divider {
    position: relative;
    text-align: center;
    margin: 2rem 0 1.5rem;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
}

.divider span {
    position: relative;
    background: white;
    padding: 0 1rem;
    color: #718096;
    font-size: 0.875rem;
}

.signup-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.signup-link:hover {
    color: #5a67d8;
    text-decoration: underline;
}

/* Modern alerts */
.alert-modern {
    border: none;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.alert-modern i {
    font-size: 1.25rem;
}

.alert-danger {
    background: #fee;
    color: #dc2626;
}

.alert-success {
    background: #f0fdf4;
    color: #16a34a;
}

.alert-modern .btn-close {
    margin-left: auto;
    opacity: 0.6;
}

/* Loading state */
.btn-auth.loading {
    color: transparent;
}

.btn-auth.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.8s linear infinite;
}

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

/* Responsive design */
@media (max-width: 576px) {
    .auth-card-inner {
        padding: 2rem 1.5rem;
    }
    
    .auth-title {
        font-size: 1.75rem;
    }
    
    .auth-icon {
        width: 70px;
        height: 70px;
    }
    
    .auth-icon i {
        font-size: 1.75rem;
    }
    
    .form-control-modern {
        height: 54px;
        padding-left: 1rem;
    }
    
    .form-floating > label {
        left: 1rem;
    }
    
    .form-floating > .form-control:focus ~ label,
    .form-floating > .form-control:not(:placeholder-shown) ~ label {
        left: 1rem;
    }
    
    .btn-auth {
        height: 52px;
        font-size: 1rem;
    }
}

/* Focus visible for accessibility */
.form-control-modern:focus-visible,
.btn-auth:focus-visible,
.form-check-input:focus-visible {
    outline: 3px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

/* Animation on page load */
.auth-card {
    animation: slideUp 0.6s ease-out;
}

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

/* Navbar adjustments for auth pages */
.auth-page .navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}