/* =========================================
   Authentication Pages Styles
   Color Scheme from docs/prd.md
   ========================================= */

:root {
    --bs-primary: #2563EB;
    --bs-secondary: #64748B;
    --bs-success: #16A34A;
    --bs-warning: #F59E0B;
    --bs-danger: #DC2626;
    --bs-light: #F8FAFC;
    --bs-dark: #0F172A;

    --primary: #2563EB;
    --primary-hover: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-lighter: #60a5fa;
    --primary-lightest: #dbeafe;

    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --border-color: #e2e8f0;
    --background: #F8FAFC;
    --surface: #FFFFFF;
}

/* =========================================
   Auth Page Layout
   ========================================= */
.auth-page {
    min-height: 100vh;
    display: flex;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 50%, #1e40af 100%);
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: float 20s infinite ease-in-out;
}

.auth-page::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 50%);
    animation: float 15s infinite ease-in-out reverse;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(30px, 30px) rotate(5deg);
    }
}

/* =========================================
   Auth Container
   ========================================= */
.auth-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Left Side - Branding */
.auth-branding {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    color: white;
    text-align: center;
}

.auth-branding .logo-container {
    margin-bottom: 2rem;
}

.auth-branding .logo-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-branding .logo-icon i {
    font-size: 2.5rem;
    color: white;
}

.auth-branding h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}

.auth-branding .tagline {
    font-size: 1.125rem;
    opacity: 0.9;
    max-width: 400px;
    line-height: 1.6;
}

.auth-branding .features {
    margin-top: 3rem;
    text-align: left;
}

.auth-branding .feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

.auth-branding .feature-item i {
    width: 24px;
    height: 24px;
    margin-right: 1rem;
    font-size: 1rem;
}

.auth-branding .feature-item span {
    font-size: 0.95rem;
    opacity: 0.95;
}

/* Right Side - Form */
.auth-form-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--surface);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
}

.auth-card .card-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 0;
    border: 0;
    background: transparent;
}

.auth-card .card-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.auth-card .card-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

/* =========================================
   Form Styles
   ========================================= */
.auth-form .form-group {
    margin-bottom: 1.25rem;
}

.auth-form .form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.auth-form .input-group {
    position: relative;
}

.auth-form .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    z-index: 10;
}

.auth-form .form-control {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    font-size: 0.95rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--background);
    color: var(--text-primary);
    transition: all 0.2s ease-in-out;
}

.auth-form .form-control:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px var(--primary-lightest);
    outline: none;
}

.auth-form .form-control::placeholder {
    color: var(--text-muted);
}

.auth-form .form-control.is-invalid {
    border-color: var(--bs-danger);
}

.auth-form .invalid-feedback {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--bs-danger);
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.password-toggle:hover {
    color: var(--text-secondary);
}

/* Remember Me & Forgot Password */
.auth-form .form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.auth-form .form-check {
    display: flex;
    align-items: center;
}

.auth-form .form-check-input {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    margin-right: 0.5rem;
    cursor: pointer;
}

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

.auth-form .form-check-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.auth-form .forgot-link {
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

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

/* Submit Button */
.auth-form .btn-submit {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-form .btn-submit:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #1e40af 100%);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
    transform: translateY(-2px);
}

.auth-form .btn-submit:active {
    transform: translateY(0);
}

.auth-form .btn-submit i {
    font-size: 1.1rem;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    padding: 0 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Footer Links */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-footer p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

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

.auth-footer a:hover {
    text-decoration: underline;
}

/* Alert Styles */
.auth-alert {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-alert.success {
    background-color: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.auth-alert.error {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

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

/* =========================================
   Responsive Design
   ========================================= */
@media (max-width: 992px) {
    .auth-branding {
        display: none;
    }

    .auth-form-container {
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
        padding: 1.5rem;
    }

    .auth-card {
        background: var(--surface);
        border-radius: 16px;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
        padding: 2rem;
    }
}

@media (max-width: 576px) {
    .auth-card {
        padding: 1.5rem;
    }

    .auth-card .card-header h2 {
        font-size: 1.5rem;
    }

    .auth-form .form-options {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

/* =========================================
   Loading State
   ========================================= */
.btn-submit.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-submit.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 0.5rem;
}

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

/* =========================================
   Back to Home Link
   ========================================= */
.back-to-home {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(5px);
    transition: all 0.2s;
    z-index: 10;
}

.back-to-home:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* =========================================
   Social Login Buttons
   ========================================= */
.social-login {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-btn {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--surface);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-btn:hover {
    border-color: var(--primary-light);
    background: var(--primary-lightest);
}

.social-btn i {
    font-size: 1.25rem;
}

.social-btn.google i {
    color: #ea4335;
}

.social-btn.microsoft i {
    color: #00a4ef;
}

/* =========================================
   Floating Labels Animation
   ========================================= */
.floating-label {
    position: relative;
}

.floating-label label {
    position: absolute;
    left: 2.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
    pointer-events: none;
    transition: all 0.2s ease-in-out;
    background: transparent;
    padding: 0 0.25rem;
}

.floating-label input:focus + label,
.floating-label input:not(:placeholder-shown) + label {
    top: 0;
    font-size: 0.75rem;
    color: var(--primary);
    background: var(--surface);
}

/* =========================================
   Input Focus Animation
   ========================================= */
.input-highlight {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: all 0.3s ease-in-out;
    transform: translateX(-50%);
}

.form-control:focus ~ .input-highlight {
    width: 100%;
}
