/**
 * Authentication Pages Stylesheet
 * 
 * Comprehensive styles for login, forgot password, and reset password pages
 * Includes responsive design, animations, and accessibility features
 * 
 * @package CustomerManagementSystem
 * @version 1.0.0
 */

/* ==================== CSS RESET & BASE ==================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --primary-light: #EEF2FF;
    --secondary-color: #6B7280;
    --success-color: #10B981;
    --success-light: #D1FAE5;
    --error-color: #EF4444;
    --error-light: #FEE2E2;
    --warning-color: #F59E0B;
    --warning-light: #FEF3C7;
    --info-color: #3B82F6;
    --info-light: #DBEAFE;
    
    /* Neutral Colors */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    
    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Shadows */
    --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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 200ms ease-in-out;
    --transition-slow: 300ms ease-in-out;
}

/* ==================== BODY & LAYOUT ==================== */

body.auth-page {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.5;
    color: var(--gray-900);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.auth-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.auth-main {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

/* ==================== BACKGROUND DECORATION ==================== */

.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.auth-background-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 20s infinite ease-in-out;
}

.auth-background-shape.shape-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    left: -150px;
    animation-delay: 0s;
}

.auth-background-shape.shape-2 {
    width: 400px;
    height: 400px;
    bottom: -200px;
    right: -200px;
    animation-delay: 2s;
}

.auth-background-shape.shape-3 {
    width: 200px;
    height: 200px;
    top: 50%;
    right: 10%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(10deg);
    }
}

/* ==================== AUTH CONTAINER ==================== */

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

.auth-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--spacing-2xl);
    position: relative;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== AUTH HEADER ==================== */

.auth-back {
    margin-bottom: var(--spacing-lg);
}

.auth-back a {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--gray-600);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.auth-back a:hover {
    color: var(--primary-color);
}

.icon-back {
    width: 16px;
    height: 16px;
}

.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.auth-logo {
    display: inline-flex;
    margin-bottom: var(--spacing-md);
}

.auth-icon-large {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: var(--primary-light);
    border-radius: var(--radius-xl);
    margin-bottom: var(--spacing-md);
}

.auth-icon-large svg {
    width: 40px;
    height: 40px;
    color: var(--primary-color);
}

.auth-icon-large.success {
    background: var(--success-light);
}

.auth-icon-large.success svg {
    color: var(--success-color);
}

.auth-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--spacing-sm);
}

.auth-subtitle {
    font-size: 1rem;
    color: var(--gray-600);
    line-height: 1.5;
}

/* ==================== ALERTS ==================== */

.alert {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    font-size: 0.875rem;
    transition: opacity var(--transition-slow);
}

.alert-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.alert-success {
    background: var(--success-light);
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert-error {
    background: var(--error-light);
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400E;
    border: 1px solid #FDE68A;
}

.alert-info {
    background: var(--info-light);
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

/* ==================== FORMS ==================== */

.auth-form {
    margin-bottom: var(--spacing-xl);
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--spacing-sm);
}

.required {
    color: var(--error-color);
    margin-left: 2px;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: var(--spacing-md);
    display: flex;
    align-items: center;
    color: var(--gray-400);
    pointer-events: none;
    z-index: 1;
}

.input-icon svg {
    width: 20px;
    height: 20px;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--gray-900);
    background: var(--gray-50);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
}

.form-input:focus {
    outline: none;
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-input:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
    opacity: 0.6;
}

.password-toggle {
    position: absolute;
    right: var(--spacing-md);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    padding: var(--spacing-xs);
    display: flex;
    align-items: center;
    transition: color var(--transition-fast);
}

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

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

.eye-icon {
    width: 20px;
    height: 20px;
}

.form-help {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: var(--spacing-xs);
}

.form-help.success {
    color: var(--success-color);
}

.form-help.error {
    color: var(--error-color);
}

/* ==================== FORM ROW ==================== */

.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.checkbox-input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label {
    font-size: 0.875rem;
    color: var(--gray-700);
    cursor: pointer;
    user-select: none;
}

/* ==================== BUTTONS ==================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    color: white;
    background: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

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

.btn-secondary {
    color: var(--gray-700);
    background: white;
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-block {
    width: 100%;
}

.btn-loader {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.spinner {
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
}

.spinner-circle {
    stroke-dasharray: 60;
    stroke-dashoffset: 0;
    animation: dash 1.5s ease-in-out infinite;
}

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

@keyframes dash {
    0% {
        stroke-dashoffset: 60;
    }
    50% {
        stroke-dashoffset: 15;
    }
    100% {
        stroke-dashoffset: 60;
    }
}

/* ==================== LINKS ==================== */

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

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

.link-secondary {
    color: var(--gray-600);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.link-secondary:hover {
    color: var(--gray-900);
}

/* ==================== INFO BOX ==================== */

.auth-info-box {
    background: var(--info-light);
    border: 1px solid #BFDBFE;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    font-size: 0.875rem;
    color: #1E40AF;
}

.auth-info-box p {
    margin-bottom: var(--spacing-sm);
}

.auth-info-box ul {
    margin-left: var(--spacing-lg);
    list-style-type: disc;
}

.auth-info-box li {
    margin-bottom: var(--spacing-xs);
}

/* ==================== FOOTER ==================== */

.auth-footer {
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--gray-200);
}

.auth-footer-text {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.security-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-xl);
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    color: var(--gray-600);
    backdrop-filter: blur(10px);
}

.security-icon {
    width: 16px;
    height: 16px;
    color: var(--success-color);
}

/* ==================== PAGE FOOTER ==================== */

.auth-page-footer {
    margin-top: var(--spacing-2xl);
    padding: var(--spacing-xl) 0;
    text-align: center;
}

.auth-page-footer-content {
    color: white;
    font-size: 0.875rem;
}

.auth-page-footer-content p {
    margin-bottom: var(--spacing-sm);
    opacity: 0.9;
}

.auth-page-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.auth-page-footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity var(--transition-fast);
}

.auth-page-footer-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

.separator {
    opacity: 0.5;
}

/* ==================== RESPONSIVE DESIGN ==================== */

@media (max-width: 640px) {
    body.auth-page {
        padding: var(--spacing-sm);
    }

    .auth-card {
        padding: var(--spacing-lg);
    }

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

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

    .form-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-page-footer-links {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .separator {
        display: none;
    }
}

@media (max-width: 480px) {
    .auth-container {
        max-width: 100%;
    }

    .auth-card {
        padding: var(--spacing-md);
    }

    .form-input {
        font-size: 0.875rem;
    }

    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
}

/* ==================== ACCESSIBILITY ==================== */

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

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ==================== FOCUS STYLES ==================== */

button:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ==================== PRINT STYLES ==================== */

@media print {
    .auth-background,
    .security-notice,
    .auth-page-footer {
        display: none;
    }

    body.auth-page {
        background: white;
    }

    .auth-card {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
}
