/**
 * Fichier: css/auth-commandes.css
 * Styles pour les pages de connexion et inscription
 */

/* ===== VARIABLES ===== */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --border-color: #e2e8f0;
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== BASE ===== */
body.auth-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 50%, #3b82f6 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

/* ===== LAYOUT ===== */
.auth-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-wrapper {
    width: 100%;
    max-width: 480px;
}

.auth-wrapper.wide {
    max-width: 600px;
}

/* ===== LOGO ===== */
.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo a {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: white;
}

.auth-logo-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.auth-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
}

/* ===== CARD ===== */
.auth-card {
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.auth-card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 2rem;
    text-align: center;
    color: white;
}

.auth-card-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.auth-card-header p {
    font-size: 0.9375rem;
    opacity: 0.9;
    margin: 0;
}

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

/* ===== USER TYPE SELECTOR ===== */
.user-type-selector {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.user-type-option {
    flex: 1;
    position: relative;
}

.user-type-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.user-type-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.user-type-option label:hover {
    border-color: var(--primary-color);
}

.user-type-option input:checked + label {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.user-type-option label i {
    font-size: 1.5rem;
    color: var(--secondary-color);
    transition: color var(--transition-fast);
}

.user-type-option input:checked + label i {
    color: var(--primary-color);
}

.user-type-option label span {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dark-color);
}

.user-type-option label small {
    font-size: 0.75rem;
    color: var(--secondary-color);
}

/* ===== FORM ===== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

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

.form-group label .required {
    color: var(--danger-color);
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
    font-size: 1rem;
}

.input-wrapper input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-wrapper .toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 0;
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--secondary-color);
    margin-top: 0.375rem;
}

/* ===== CHECKBOX ===== */
.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.form-checkbox input {
    width: 18px;
    height: 18px;
    margin-top: 0.125rem;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.form-checkbox label {
    font-size: 0.875rem;
    color: var(--secondary-color);
    cursor: pointer;
}

.form-checkbox label a {
    color: var(--primary-color);
    text-decoration: none;
}

.form-checkbox label a:hover {
    text-decoration: underline;
}

/* ===== ALERTS ===== */
.auth-alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.auth-alert i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.auth-alert.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.auth-alert.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.auth-alert ul {
    margin: 0;
    padding-left: 1.25rem;
}

.auth-alert li {
    margin-bottom: 0.25rem;
}

.auth-alert li:last-child {
    margin-bottom: 0;
}

/* ===== BUTTONS ===== */
.btn-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-auth.primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-auth.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-auth.secondary {
    background: white;
    color: var(--dark-color);
    border: 1px solid var(--border-color);
}

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

/* ===== DIVIDER ===== */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    font-size: 0.8125rem;
    color: var(--secondary-color);
}

/* ===== FOOTER LINKS ===== */
.auth-card-footer {
    padding: 1.5rem 2rem;
    background: var(--light-color);
    border-top: 1px solid var(--border-color);
}

.auth-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--secondary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

/* ===== BACK LINK ===== */
.auth-back {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-back a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color var(--transition-fast);
}

.auth-back a:hover {
    color: white;
}

/* ===== MODAL ===== */
.auth-modal .modal-content {
    border-radius: var(--radius-xl);
    border: none;
}

.auth-modal .modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 1.25rem 1.5rem;
}

.auth-modal .modal-header .btn-close {
    filter: brightness(0) invert(1);
}

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

.auth-modal .modal-body h5 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.auth-modal .modal-body p {
    font-size: 0.9375rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.auth-modal .modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 575.98px) {
    .auth-container {
        padding: 1rem;
    }
    
    .auth-card-body {
        padding: 1.5rem;
    }
    
    .auth-card-footer {
        padding: 1rem 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .user-type-selector {
        flex-direction: column;
    }
    
    .auth-links {
        flex-direction: column;
        gap: 0.75rem;
    }
}