/* Modern Authentication Pages Styling */

:root {
    --auth-primary: #667eea;
    --auth-secondary: #764ba2;
    --auth-success: #10b981;
    --auth-danger: #ef4444;
    --auth-warning: #f59e0b;
    --auth-info: #3b82f6;
}

/* Reset body and html for auth pages */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Main Auth Container */
.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem 1rem;
    position: relative;
    overflow-y: auto;
}

.auth-container::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

.auth-container::after {
    content: '';
    position: fixed;
    bottom: -50%;
    left: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(20px, 20px);
    }
}

/* Auth Card */
.auth-card {
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: visible;
    max-width: 450px;
    width: 100%;
    position: relative;
    z-index: 1;
    animation: slideUp 0.5s ease;
    margin: auto 0;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Auth Header */
.auth-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2.5rem 2rem 2rem;
    text-align: center;
    position: relative;
}

.auth-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 20px;
    background: white;
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.auth-header .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

/* Auth Body */
.auth-body {
    padding: 2rem;
}

/* Form Styling */
.auth-form .form-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.auth-form .form-check-label {
    color: #374151;
}

.auth-form .form-control {
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f9fafb !important;
    color: #1f2937 !important;
    border-color: #e5e7eb !important;
}

.auth-form .form-control:focus {
    background-color: #ffffff !important;
    color: #1f2937 !important;
    border-color: var(--auth-primary) !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25) !important;
}

.auth-form .form-control::placeholder {
    color: #9ca3af !important;
}

.auth-form .form-check-input:not(:checked) {
    background-color: #ffffff !important;
    border-color: #d1d5db !important;
}

/* Switch track — unchecked state should be grey, not white */
.auth-form .form-switch .form-check-input:not(:checked) {
    background-color: #d1d5db !important;
    border-color: transparent !important;
}

.auth-form .form-check-input:checked {
    background-color: var(--auth-primary) !important;
    border-color: var(--auth-primary) !important;
}

/* Input Icons */
.input-group-icon {
    position: relative;
}

.input-group-icon .form-control {
    padding-right: 3rem;
}

.input-group-icon .icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
}

.ltr ~ .password-toggle {
    left: auto;
    right: 1rem;
}

.password-toggle:hover {
    color: var(--auth-primary);
}

/* Checkbox Styling */
.form-check {
    padding-right: 1.75rem;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #d1d5db;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.form-check-input:checked {
    background-color: var(--auth-primary) !important;
    border-color: var(--auth-primary) !important;
}

.form-check-label {
    cursor: pointer;
    user-select: none;
    margin-right: 0.5rem;
}

/* Buttons */
.auth-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.auth-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.auth-btn:hover::before {
    width: 300px;
    height: 300px;
}

.auth-btn-primary {
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-secondary) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.auth-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* Links */
.auth-links {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.auth-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.auth-link:hover {
    color: var(--auth-primary);
    transform: translateX(5px);
}

.auth-link i {
    font-size: 1.1rem;
}

/* Alert Messages */
.auth-alert {
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-right: 4px solid var(--auth-success);
}

.auth-alert-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-right: 4px solid var(--auth-danger);
}

.auth-alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border-right: 4px solid var(--auth-info);
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: #9ca3af;
    font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

.auth-divider span {
    padding: 0 1rem;
}

/* Back to Home Link */
.back-to-home {
    text-align: center;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.back-to-home a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
}

.back-to-home a:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 576px) {
    html,
    body {
        height: 100%;
    }

    .auth-container {
        padding: 1rem;
        min-height: 100vh;
        justify-content: flex-start;
    }

    .auth-card {
        border-radius: 1rem;
        margin: 0;
    }

    .auth-header {
        padding: 2rem 1.5rem 1.5rem;
    }

    .auth-header h1 {
        font-size: 1.5rem;
    }

    .auth-header .icon {
        font-size: 2.5rem;
    }

    .auth-body {
        padding: 1.5rem;
    }
    
    .back-to-home {
        margin-top: 1rem;
        margin-bottom: 1rem;
    }
}

/* Loading State */
.auth-loading {
    pointer-events: none;
    opacity: 0.7;
}

.auth-loading .auth-btn {
    position: relative;
}

.auth-loading .auth-btn::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    top: 50%;
    right: 50%;
    margin-top: -0.5rem;
    margin-right: -0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Feature Icons */
.feature-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
}

.feature-icon-primary {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    color: var(--auth-primary);
}

.feature-icon-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.2) 100%);
    color: var(--auth-success);
}

.feature-icon-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.2) 100%);
    color: var(--auth-danger);
}
