/* assets/css/auth.css - Authentication pages styling */

/* CSS Variables for consistent theming */
:root {
    /* Primary Colors */
    --primary-color: #4a6cf7;
    --primary-hover: #3b5ce6;
    --primary-light: rgba(74, 108, 247, 0.1);
    --primary-gradient: linear-gradient(135deg, #4a6cf7 0%, #6a11cb 100%);
    
    /* Secondary Colors */
    --secondary-color: #6c757d;
    --secondary-light: #f8f9fa;
    
    /* Status Colors */
    --success-color: #28a745;
    --success-light: rgba(40, 167, 69, 0.1);
    --error-color: #dc3545;
    --error-light: rgba(220, 53, 69, 0.1);
    --warning-color: #ffc107;
    --warning-light: rgba(255, 193, 7, 0.1);
    --info-color: #17a2b8;
    --info-light: rgba(23, 162, 184, 0.1);
    
    /* Neutral Colors */
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --gray-100: #f1f3f4;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --dark: #1a1d29;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    
    /* Border Radius */
    --border-radius-sm: 0.375rem;
    --border-radius: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    --border-radius-2xl: 1.5rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --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: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
    
    /* Z-index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--light-gray);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Auth Container - Made Wider */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

/* Animated Background */
.auth-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 1;
}

.bg-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 6s ease-in-out infinite;
}

.bg-shape.shape-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    left: -150px;
    animation-delay: 0s;
}

.bg-shape.shape-2 {
    width: 200px;
    height: 200px;
    top: 50%;
    right: -100px;
    animation-delay: 2s;
}

.bg-shape.shape-3 {
    width: 150px;
    height: 150px;
    bottom: -75px;
    left: 20%;
    animation-delay: 4s;
}

.bg-shape.shape-4 {
    width: 100px;
    height: 100px;

    top: 20%;
    left: 10%;
    animation-delay: 1s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(120deg); }
    66% { transform: translateY(10px) rotate(240deg); }
}

/* Auth Content - Made Wider */
.auth-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 500px; /* Increased from 420px */
}

/* Auth Card - Made Wider */
.auth-card {
    background: var(--white);
    border-radius: var(--border-radius-2xl);
    box-shadow: var(--shadow-xl);
    padding: var(--spacing-3xl) var(--spacing-2xl); /* Increased horizontal padding */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
}

/* Logo Styles */
.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-xl);
    gap: var(--spacing-md);
}

.logo-svg {
    flex-shrink: 0;
    filter: drop-shadow(0 4px 8px rgba(74, 108, 247, 0.3));
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo-name {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

.logo-tagline {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    font-weight: 500;
    margin-top: 2px;
}

/* Auth Header */
.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.auth-header h1 {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--spacing-sm);
}

.auth-header p {
    color: var(--gray-600);
    font-size: var(--font-size-base);
}

/* Form Styles */
.auth-form {
    margin-bottom: var(--spacing-xl);
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-sm);
}

/* Input Group */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group input {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-md) var(--spacing-md) 3rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    transition: var(--transition-normal);
    background: var(--white);
    color: var(--gray-800);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.input-group input::placeholder {
    color: var(--gray-500);
}

.input-icon {
    position: absolute;
    left: var(--spacing-md);
    color: var(--gray-500);
    z-index: 2;
    transition: var(--transition-normal);
}

.input-group.focused .input-icon {
    color: var(--primary-color);
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: var(--spacing-md);
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: var(--spacing-xs);
    border-radius: var(--border-radius-sm);
    transition: var(--transition-fast);
    z-index: 2;
}

.password-toggle:hover {
    color: var(--primary-color);
    background: var(--primary-light);
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--gray-700);
    gap: var(--spacing-sm);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    position: relative;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Links */
.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: var(--transition-fast);
}

.forgot-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
    gap: var(--spacing-sm);
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-full {
    width: 100%;
    padding: var(--spacing-lg);
}

/* Button Loading State */
.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Social Login */
.social-login {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.btn-social {
    background: var(--white);
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
    font-weight: 500;
}

.btn-social:hover {
    border-color: var(--gray-400);
    background: var(--gray-100);
    transform: translateY(-1px);
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: var(--spacing-xl);
}

.auth-footer p {
    color: var(--gray-600);
    font-size: var(--font-size-sm);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
}

.auth-footer a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Auth Divider */
.auth-divider {
    position: relative;
    text-align: center;
    margin: var(--spacing-xl) 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gray-300);
}

.auth-divider span {
    background: var(--white);
    color: var(--gray-500);
    padding: 0 var(--spacing-md);
    font-size: var(--font-size-sm);
    position: relative;
}

/* Alerts */
.alert {
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-lg);
    gap: var(--spacing-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.alert-error {
    background: var(--error-light);
    color: var(--error-color);
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.alert-success {
    background: var(--success-light);
    color: var(--success-color);
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.alert-warning {
    background: var(--warning-light);
    color: #856404;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.alert-info {
    background: var(--info-light);
    color: var(--info-color);
    border: 1px solid rgba(23, 162, 184, 0.2);
}

/* Password Strength Indicator */
.password-strength {
    margin-top: var(--spacing-sm);
}

.strength-bar {
    height: 4px;
    background: var(--gray-300);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: var(--spacing-xs);
}

.strength-fill {
    height: 100%;
    transition: var(--transition-normal);
    border-radius: 2px;
}

.strength-text {
    font-size: var(--font-size-xs);
    font-weight: 600;
}

/* Password Match Indicator */
.password-match {
    margin-top: var(--spacing-sm);
}

.match-text {
    font-size: var(--font-size-xs);
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-container {
        padding: var(--spacing-md);
    }
    
    .auth-card {
        padding: var(--spacing-2xl) var(--spacing-lg); /* Adjusted for mobile */
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .social-login {
        grid-template-columns: 1fr;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }
    
    .logo {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .logo-text {
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .auth-content {
        max-width: 100%;
    }
    
    .auth-card {
        padding: var(--spacing-xl) var(--spacing-md);
    }
    
    .auth-header h1 {
        font-size: var(--font-size-2xl);
    }
    
    .logo-name {
        font-size: var(--font-size-xl);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .input-group input {
        border-width: 3px;
    }
    
    .btn {
        border: 2px solid transparent;
    }
    
    .btn-primary {
        border-color: 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;
    }
    
    .bg-shape {
        animation: none;
    }
}

/* Print styles */
@media print {
    .auth-background,
    .bg-shape {
        display: none;
    }
    
    .auth-container {
        background: white;
    }
    
    .auth-card {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
}
/* Password strength indicator */
.password-strength {
    margin-top: 8px;
}

.strength-bar {
    width: 100%;
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-text {
    font-size: 12px;
    font-weight: 500;
}

/* Password match indicator */
.password-match {
    margin-top: 8px;
}

.match-text {
    font-size: 12px;
    font-weight: 500;
}

/* Form text helper */
.form-text {
    font-size: 14px;
    color: #6c757d;
    margin-top: 8px;
    line-height: 1.4;
}

.form-text a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.form-text a:hover {
    text-decoration: underline;
}

/* Code input styling */
input[type="text"]#code {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 4px;
    font-family: 'Courier New', monospace;
}

/* Enhanced input focus states */
.input-group.focused {
    transform: translateY(-1px);
}

.input-group.focused input {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1);
}

/* Loading states */
.btn-loader {
    display: none;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced alert styles */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
    animation: slideIn 0.3s ease-out;
}

.alert svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-error {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive improvements */
@media (max-width: 480px) {
    .auth-card {
        padding: 24px 20px;
        margin: 20px;
    }
    
    .logo {
        margin-bottom: 24px;
    }
    
    .auth-header h1 {
        font-size: 24px;
    }
    
    .auth-header p {
        font-size: 14px;
    }
    
    input[type="text"]#code {
        font-size: 16px;
        letter-spacing: 2px;
    }
}

/* Enhanced checkbox styling */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 1px;
}

.checkbox-label:hover .checkmark {
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Form options layout */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
}

@media (max-width: 480px) {
    .form-options {
        flex-direction: column;
        gap: 12px;
    }
}
