/**
 * Styles du portail de suivi client IR-M
 * Design moderne, épuré et responsive
 */

/* ============================================================================
   VARIABLES & RESET
   ============================================================================ */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

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

/* ============================================================================
   BASE
   ============================================================================ */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem 1rem;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

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

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ============================================================================
   CARDS
   ============================================================================ */

.auth-card,
.suivi-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.auth-card {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.auth-card h2,
.suivi-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* ============================================================================
   FORMULAIRES
   ============================================================================ */

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ============================================================================
   BOUTONS
   ============================================================================ */

.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    width: 100%;
}

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

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

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

/* ============================================================================
   ALERTES
   ============================================================================ */

.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--error-color);
}

/* ============================================================================
   SECTION INFOS
   ============================================================================ */

.info-section {
    margin-bottom: 2rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.info-value {
    font-weight: 500;
    color: var(--text-primary);
}

/* ============================================================================
   PHOTOS
   ============================================================================ */

.photos-section {
    margin-bottom: 2rem;
}

.photos-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.photo-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: var(--shadow-sm);
}

.photo-thumb:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* ============================================================================
   LIGHTBOX
   ============================================================================ */

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.2s;
}

.lightbox-close:hover {
    opacity: 0.7;
}

#lightbox-img {
    max-width: 90%;
    max-height: 80%;
    object-fit: contain;
    border-radius: var(--radius-md);
}

#lightbox-caption {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

/* ============================================================================
   PROBLÈME DÉCLARÉ
   ============================================================================ */

.problem-section {
    margin-bottom: 2rem;
}

.problem-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.problem-text {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
    line-height: 1.6;
}

/* ============================================================================
   STATUT
   ============================================================================ */

.status-section {
    margin-top: 2rem;
    padding-top: 2rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.status-en_attente {
    background: #fef3c7;
    color: #92400e;
}

.status-en_cours {
    background: #dbeafe;
    color: #1e40af;
}

.status-termine {
    background: #d1fae5;
    color: #065f46;
}

.status-icon {
    font-size: 1.5rem;
}

.message-client {
    background: var(--bg-light);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.message-client h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.message-client p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.last-update {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* ============================================================================
   ACTIONS
   ============================================================================ */

.actions {
    margin-top: 2rem;
    text-align: center;
}

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

.footer {
    text-align: center;
    color: white;
    font-size: 0.875rem;
    margin-top: 2rem;
}

.help-text {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 1.5rem;
}

/* ============================================================================
   SEPARATEUR
   ============================================================================ */

hr {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 2rem 0;
}

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

@media (max-width: 640px) {
    body {
        padding: 1rem 0.5rem;
    }
    
    .auth-card,
    .suivi-card {
        padding: 1.5rem;
        border-radius: var(--radius-md);
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .auth-card h2,
    .suivi-card h2 {
        font-size: 1.5rem;
    }
    
    .photo-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .info-row {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .lightbox {
        padding: 1rem;
    }
    
    .lightbox-close {
        top: 1rem;
        right: 1rem;
        font-size: 2rem;
    }
}

@media (max-width: 400px) {
    .photo-gallery {
        grid-template-columns: 1fr;
    }
}
