/* Authentication Pages Styles */
:root {
    --auth-primary: #047857;
    --auth-secondary: #10B981;
    --auth-accent: #10B981;
    --auth-success: #10B981;
    --auth-warning: #f59e0b;
    --auth-danger: #ef4444;
    --auth-light: #f0fdf4;
    --auth-dark: #064e3b;
    --auth-gradient: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Reset margins for auth pages */
body {
    margin: 0 !important;
    padding: 0 !important;
}

.auth-background .container {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
}

.auth-background .row {
    margin: 0 !important;
}

/* Background and Layout */
.auth-background {
    background: var(--auth-gradient);
    height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    margin: 0;
    overflow: hidden;
}

.auth-container {
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
}

/* Auth Card */
.auth-card {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(16, 185, 129, 0.1);
    overflow: hidden;
    backdrop-filter: blur(10px);
    max-width: 100%;
}

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

.auth-card-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    transform: rotate(45deg);
}

.auth-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
}

.auth-logo-icon {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.auth-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin: 0;
}

.auth-subtitle {
    font-size: 0.875rem;
    opacity: 0.9;
    margin: 0;
    font-weight: 400;
    position: relative;
    z-index: 2;
}

.auth-card-body {
    padding: 1.5rem;
}

/* Form Elements */
.auth-form-group {
    margin-bottom: 0.5rem;
}

.auth-form-label {
    font-weight: 600;
    color: var(--auth-dark);
    margin-bottom: 0.125rem;
    font-size: 0.7rem;
    display: block;
}

.auth-form-control {
    width: 100%;
    padding: 0.4rem 0.625rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.4rem;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    background: #f9fafb;
}

.auth-form-control:focus {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    background: white;
}

.auth-form-control.is-invalid {
    border-color: var(--auth-danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Password Input with Toggle */
.auth-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-password-input {
    padding-right: 2.5rem !important;
}

.auth-password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.875rem;
    transition: color 0.2s ease;
    z-index: 10;
}

.auth-password-toggle:hover {
    color: var(--auth-primary);
}

.auth-password-toggle:focus {
    outline: none;
    color: var(--auth-primary);
}

.auth-form-check {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.auth-form-check-input {
    margin-right: 0.375rem;
    accent-color: var(--auth-accent);
}

.auth-form-check-label {
    font-size: 0.75rem;
    color: #6b7280;
    cursor: pointer;
}

/* Buttons */
.auth-btn {
    width: 100%;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-btn-primary {
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-secondary) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.auth-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

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

.auth-btn-loading {
    pointer-events: none;
    opacity: 0.8;
}

.auth-btn-secondary {
    background: transparent;
    color: var(--auth-primary);
    border: 2px solid var(--auth-primary);
    width: auto;
    padding: 0.5rem 1rem;
    margin: 0 auto;
    display: inline-flex;
}

.auth-btn-secondary:hover {
    background: var(--auth-primary);
    color: white;
}

.auth-btn-link {
    background: none;
    border: none;
    color: var(--auth-primary);
    font-weight: 500;
    text-decoration: none;
    padding: 0.25rem;
    font-size: 0.8rem;
    width: auto;
    display: inline-flex;
    align-items: center;
}

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

/* Loading Spinner */
.auth-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 0.5rem;
}

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

/* Alert Messages */
.auth-alert {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    border: 1px solid;
}

.auth-alert-success {
    background: #f0fdf4;
    border-color: var(--auth-success);
    color: #15803d;
}

.auth-alert-danger {
    background: #fef2f2;
    border-color: var(--auth-danger);
    color: #dc2626;
}

/* Invalid Feedback */
.auth-invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--auth-danger);
    font-weight: 500;
}

/* Footer Links */
.auth-footer {
    text-align: center;
    padding: 0.5rem 1.25rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.auth-divider {
    text-align: center;
    margin: 1rem 0;
    position: relative;
    color: #9ca3af;
    font-size: 0.875rem;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e7eb;
    z-index: 1;
}

.auth-divider span {
    background: white;
    padding: 0 1rem;
    position: relative;
    z-index: 2;
}

/* Responsive Design */
@media (max-width: 576px) {
    .auth-container {
        margin: 0 0.5rem;
        max-width: none;
    }
    
    .auth-card-header {
        padding: 0.625rem 1rem 0.375rem 1rem;
    }
    
    .auth-card-body {
        padding: 0.625rem 1rem;
    }
    
    .auth-footer {
        padding: 0.5rem 1rem;
    }
    
    .auth-logo-text {
        font-size: 0.875rem;
    }
    
    .auth-subtitle {
        font-size: 0.65rem;
    }
    
    .auth-form-group {
        margin-bottom: 0.375rem;
    }
    
    .auth-form-label {
        font-size: 0.65rem;
        margin-bottom: 0.125rem;
    }
    
    .auth-form-control {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .auth-logo-icon {
        width: 28px;
        height: 28px;
        font-size: 0.875rem;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .auth-background {
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    }
    
    .auth-card {
        background: #1e293b;
        border-color: rgba(16, 185, 129, 0.2);
    }
    
    .auth-form-control {
        background: #0f172a;
        border-color: #374151;
        color: white;
    }
    
    .auth-form-control:focus {
        background: #1e293b;
    }
    
    .auth-form-label {
        color: #e5e7eb;
    }
    
    .auth-footer {
        background: #0f172a;
        border-color: #374151;
    }
}