/* Custom CSS Styles for Authentication App */

/* 
 * Root Variables
 * Define reusable color values and animations for consistent styling
 */
:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
}

/* 
 * Body Styling
 * Ensures the page takes full viewport height and has smooth font rendering
 */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 
 * Smooth Transitions
 * Adds smooth transitions to all interactive elements
 */
* {
    transition: all 0.2s ease-in-out;
}

/* 
 * Input Focus States
 * Enhances accessibility and user experience with clear focus indicators
 */
input:focus,
select:focus,
button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* 
 * Alert Animation
 * Slide-in animation for alert messages from the right side
 */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 
 * Alert Fade Out Animation
 * Smooth fade out when alert is dismissed
 */
@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* 
 * Alert Container Styling
 * Positions and styles the notification messages
 */
.alert {
    animation: slideInRight 0.3s ease-out;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 300px;
}

/* 
 * Success Alert Styling
 * Green background for successful operations
 */
.alert-success {
    background-color: #d1fae5;
    border-left: 4px solid var(--success-color);
    color: #065f46;
}

/* 
 * Error Alert Styling
 * Red background for error messages
 */
.alert-error {
    background-color: #fee2e2;
    border-left: 4px solid var(--error-color);
    color: #991b1b;
}

/* 
 * Warning Alert Styling
 * Yellow/orange background for warnings
 */
.alert-warning {
    background-color: #fef3c7;
    border-left: 4px solid var(--warning-color);
    color: #92400e;
}

/* 
 * Alert Icon Styling
 * Makes icons in alerts more prominent
 */
.alert i {
    font-size: 1.25rem;
}

/* 
 * Fade Out Class
 * Applied when alert is being dismissed
 */
.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

/* 
 * Card Hover Effect
 * Subtle lift effect on hover for interactive cards
 */
.bg-white:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* 
 * Button Hover Effects
 * Adds scale effect to buttons on hover
 */
button:hover {
    transform: scale(1.02);
}

button:active {
    transform: scale(0.98);
}

/* 
 * Loading Spinner Animation
 * Continuous rotation for loading indicator
 */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* 
 * User Info Card Styling
 * Styles for displaying user information in dashboard
 */
.user-info-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.user-info-item i {
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-right: 1rem;
    width: 24px;
    text-align: center;
}

.user-info-label {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.user-info-value {
    color: #1f2937;
    font-size: 1rem;
}

/* 
 * Password Strength Indicator
 * Visual feedback for password strength (can be extended)
 */
.password-strength {
    height: 4px;
    border-radius: 2px;
    margin-top: 0.5rem;
    transition: all 0.3s ease;
}

.password-strength.weak {
    width: 33%;
    background-color: var(--error-color);
}

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

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

/* 
 * Responsive Design
 * Adjustments for mobile devices
 */
@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }
    
    .alert {
        min-width: auto;
        width: calc(100vw - 2rem);
    }
    
    h1 {
        font-size: 2rem;
    }
}

/* 
 * Accessibility: Reduced Motion
 * Respects user's preference for reduced motion
 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
