/**
 * Authentication Styling
 * Library Management System
 * 
 * Modern, responsive styling for authentication pages
 */

/* Root variables */
:root {
    --primary-color: #0d6efd;
    --primary-dark: #0b5ed7;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-radius: 0.5rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --transition: all 0.15s ease-in-out;
}

/* Body and layout */
.auth-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Auth card */
.auth-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    padding: 2rem;
    margin: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

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

.auth-title {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
}

.auth-subtitle {
    color: var(--secondary-color);
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* Auth form */
.auth-form {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-control {
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Password input group */
.password-input-group {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: var(--secondary-color);
    padding: 0.25rem;
    z-index: 10;
}

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

.password-toggle:focus {
    box-shadow: none;
    color: var(--primary-color);
}

/* Password strength indicator */
.password-strength {
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

.strength-weak {
    color: var(--danger-color);
}

.strength-medium {
    color: var(--warning-color);
}

.strength-strong {
    color: var(--success-color);
}

.strength-bar {
    height: 3px;
    background: #e9ecef;
    border-radius: 2px;
    margin-top: 0.25rem;
    overflow: hidden;
}

.strength-bar-fill {
    height: 100%;
    transition: var(--transition);
    border-radius: 2px;
}

.strength-bar-fill.weak {
    background: var(--danger-color);
    width: 33%;
}

.strength-bar-fill.medium {
    background: var(--warning-color);
    width: 66%;
}

.strength-bar-fill.strong {
    background: var(--success-color);
    width: 100%;
}

/* Password match indicator */
.password-match {
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

.match-success {
    color: var(--success-color);
}

.match-error {
    color: var(--danger-color);
}

/* Auth button */
.auth-btn {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

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

.btn-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Auth links */
.auth-links {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

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

.auth-divider {
    margin: 1rem 0;
    position: relative;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

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

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

/* Alerts */
.alert {
    border: none;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.alert-dismissible .btn-close {
    padding: 0.75rem 1rem;
}

/* Form validation */
.is-invalid {
    border-color: var(--danger-color);
}

.is-valid {
    border-color: var(--success-color);
}

.invalid-feedback {
    display: block;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.valid-feedback {
    display: block;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading .btn-text {
    display: none;
}

.loading .btn-spinner {
    display: flex !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .auth-card {
        padding: 1.5rem;
        margin: 0.5rem;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .form-control {
        padding: 0.625rem 0.875rem;
    }

    .auth-btn {
        padding: 0.625rem 1.25rem;
    }
}

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

    .auth-title {
        font-size: 1.25rem;
    }

    .auth-subtitle {
        font-size: 0.85rem;
    }
}

/* Animation for form elements */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card {
    animation: fadeInUp 0.5s ease-out;
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
    .auth-card {
        border: 2px solid var(--dark-color);
    }

    .form-control {
        border-width: 2px;
    }

    .auth-btn {
        border: 2px solid var(--primary-color);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .auth-body {
        background: white;
    }

    .auth-card {
        box-shadow: none;
        border: 1px solid #000;
    }

    .auth-btn,
    .password-toggle {
        display: none;
    }
}