/* =====================================================
   VISION CONSEILS - Design System & Styles globaux
   ===================================================== */

:root {
    --primary: #1B2A5E;
    --primary-light: #2A3D7A;
    --primary-dark: #0F1A40;
    --accent: #E8453C;
    --accent-light: #EE6359;
    --accent-dark: #C9362E;

    --bg: #F4F6FB;
    --bg-card: #FFFFFF;
    --bg-subtle: #FAFBFE;

    --text: #1B2A5E;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --text-inverse: #FFFFFF;

    --border: #E5E7EB;
    --border-strong: #D1D5DB;

    --success: #16A34A;
    --success-bg: #DCFCE7;
    --warning: #F59E0B;
    --warning-bg: #FEF3C7;
    --danger: #DC2626;
    --danger-bg: #FEE2E2;
    --info: #3B82F6;
    --info-bg: #DBEAFE;

    --shadow-sm: 0 1px 2px 0 rgba(27, 42, 94, 0.04);
    --shadow: 0 4px 6px -1px rgba(27, 42, 94, 0.08), 0 2px 4px -1px rgba(27, 42, 94, 0.04);
    --shadow-lg: 0 10px 25px -3px rgba(27, 42, 94, 0.12), 0 4px 6px -2px rgba(27, 42, 94, 0.05);
    --shadow-xl: 0 20px 50px -10px rgba(27, 42, 94, 0.20);

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html, body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--primary);
    font-weight: 700;
    line-height: 1.2;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}
a:hover { color: var(--accent-dark); }

/* ===== BOUTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: var(--primary);
    color: var(--text-inverse);
}
.btn-primary:hover { background: var(--primary-light); box-shadow: var(--shadow); color: white; }

.btn-accent {
    background: var(--accent);
    color: var(--text-inverse);
}
.btn-accent:hover { background: var(--accent-dark); box-shadow: var(--shadow); color: white; }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--border-strong);
}
.btn-outline:hover { background: var(--primary); color: white; border-color: var(--primary); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-subtle); color: var(--primary); }

.btn-danger {
    background: var(--danger);
    color: var(--text-inverse);
}
.btn-danger:hover { background: #B91C1C; color: white; }

.btn-sm { padding: 7px 14px; font-size: 0.85rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ===== FORMULAIRES ===== */
.form-group { margin-bottom: 18px; }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-label {
    display: block;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 7px;
    font-size: 0.9rem;
}
.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    background: var(--bg-card);
    color: var(--text);
    transition: var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(27, 42, 94, 0.08);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { min-height: 100px; resize: vertical; }
.form-error { color: var(--danger); font-size: 0.85rem; margin-top: 5px; }
.form-hint { color: var(--text-secondary); font-size: 0.85rem; margin-top: 5px; }

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-display);
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-primary { background: rgba(27,42,94,0.10); color: var(--primary); }
.badge-accent  { background: rgba(232,69,60,0.12); color: var(--accent); }

/* ===== TABLES ===== */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
}
.table th, .table td {
    padding: 13px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.table th {
    background: var(--bg-subtle);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-subtle); }

/* ===== ALERTES ===== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
    border-left: 4px solid;
}
.alert-success { background: var(--success-bg); color: #166534; border-color: var(--success); }
.alert-error   { background: var(--danger-bg);  color: #991B1B; border-color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: #92400E; border-color: var(--warning); }
.alert-info    { background: var(--info-bg);    color: #1E40AF; border-color: var(--info); }

/* ===== UTILITAIRES ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-sm { font-size: 0.85rem; }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.font-bold { font-weight: 700; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.pointer { cursor: pointer; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.35s ease-out both; }

@keyframes slideIn {
    from { transform: translateX(-30px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: var(--bg-card);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    padding: 14px 20px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    min-width: 280px;
    max-width: 400px;
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 26, 64, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}
.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    max-width: 540px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}
.modal-header {
    padding: 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-body { padding: 22px; }
.modal-footer {
    padding: 18px 22px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: var(--bg-subtle);
}
.modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .form-row { grid-template-columns: 1fr; }
    .card { padding: 18px; }
    h1 { font-size: 1.5rem; }
}
