/* ===== VARIABLES & RESET ===== */
:root {
    --primary: #000;
    --primary-hover: #333;
    --secondary: #6366f1;
    --secondary-hover: #4f46e5;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --background: #ffffff;
    --surface: #fafafa;
    --surface-hover: #f5f5f5;
    --border: #e5e7eb;
    --border-focus: #6366f1;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
    min-height: 100vh;
}

/* ===== HEADER ===== */
.header {
    background: var(--background);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    width: 60px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.header-title {
    display: flex;
    flex-direction: column;
}

.header-title h1 {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.header-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.login-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

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

/* ===== CONTAINER ===== */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* ===== ALERTS ===== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideDown 0.3s ease-out;
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== FORM SECTIONS ===== */
.form-section {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
    animation: fadeInUp 0.5s ease-out backwards;
}

.form-section:hover {
    box-shadow: var(--shadow-md);
    border-color: #d1d5db;
}

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

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.section-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--surface);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* ===== FORM ELEMENTS ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
}

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

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.required {
    color: var(--danger);
    font-weight: 400;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--background);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

input::placeholder {
    color: var(--text-muted);
    font-size: 0.875rem;
}

input[readonly] {
    background: var(--surface);
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* ===== CHECKBOXES & RADIOS ===== */
.checkbox-group,
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-item,
.radio-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
}

.checkbox-item:hover,
.radio-item:hover {
    background: var(--surface-hover);
    border-color: #d1d5db;
}

.checkbox-item:has(input:checked),
.radio-item:has(input:checked) {
    background: #f0f9ff;
    border-color: var(--secondary);
}

input[type="checkbox"],
input[type="radio"] {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: var(--secondary);
    cursor: pointer;
}

.checkbox-item label,
.radio-item label {
    flex: 1;
    cursor: pointer;
    font-size: 0.9375rem;
    margin: 0;
}

/* ===== SIGNATURE PAD ===== */
.signature-container {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    background: var(--background);
}

.signature-canvas {
    height: 300px;
    width: 100%;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    background: white;
    cursor: crosshair;
    touch-action: none;
}

.signature-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
}

.btn-clear {
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-clear:hover {
    background: var(--surface-hover);
    border-color: #d1d5db;
}

.signature-hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ===== INFO BOX ===== */
.info-box {
    background: var(--surface);
    border-left: 4px solid var(--secondary);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.info-box h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.info-box ul {
    list-style: none;
    padding: 0;
}

.info-box li {
    padding: 0.375rem 0;
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.info-box li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--secondary);
}

.form-note {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-style: italic;
}

/* ===== TARIFS ===== */
.tarifs-intro {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.tarifs-intro strong {
    color: var(--text-primary);
}

.tarifs-wrapper {
    margin-top: 1rem;
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(14, 165, 233, 0.08));
    border: 1px solid rgba(99, 102, 241, 0.18);
    box-shadow: var(--shadow-md);
    overflow-x: auto;
}

.tarifs-table {
    width: 100%;
    min-width: 560px;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--text-primary);
}

.tarifs-table thead th {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--secondary);
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 2px solid rgba(99, 102, 241, 0.2);
}

.tarifs-table thead th:first-child {
    border-top-left-radius: var(--radius-lg);
}

.tarifs-table thead th:last-child {
    border-top-right-radius: var(--radius-lg);
}

.tarifs-table th,
.tarifs-table td {
    padding: 1rem 1.25rem;
    text-align: center;
}

.tarifs-table tbody th {
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.9);
}

.tarifs-table tbody th,
.tarifs-table tbody td {
    border-bottom: 1px solid rgba(99, 102, 241, 0.08);
}

.tarifs-table tbody tr {
    background: rgba(255, 255, 255, 0.94);
    transition: var(--transition);
}

.tarifs-table tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.9);
}

.tarifs-table tbody tr:hover {
    background: rgba(236, 233, 254, 0.9);
}

.tarifs-table tbody tr:first-child th:first-child {
    border-top-left-radius: var(--radius-lg);
}

.tarifs-table tbody tr:first-child td:last-child {
    border-top-right-radius: var(--radius-lg);
}

.tarifs-table tbody tr:last-child th:first-child {
    border-bottom-left-radius: var(--radius-lg);
}

.tarifs-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--radius-lg);
}

.tarifs-table tbody tr:last-child th,
.tarifs-table tbody tr:last-child td {
    border-bottom: none;
}

.tarif-unique {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--secondary);
    background: rgba(99, 102, 241, 0.12);
}

.tarif-unique span {
    display: inline-block;
    margin-left: 0.75rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: var(--secondary);
    color: white;
    border-radius: 999px;
}

.tarifs-notes {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px dashed rgba(99, 102, 241, 0.25);
    display: grid;
    gap: 0.75rem;
}

.tarifs-notes li {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== SUBMIT BUTTON ===== */
.submit-container {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.submit-btn {
    padding: 1rem 3rem;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.01em;
}

.submit-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.submit-btn:active {
    transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header-container {
        padding: 1rem;
        gap: 1rem;
    }

    .header-brand {
        width: 100%;
        justify-content: center;
    }

    .container {
        padding: 2rem 1rem;
    }

    .form-section {
        padding: 1.5rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .checkbox-group,
    .radio-group {
        gap: 0.5rem;
    }

    .submit-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .section-title {
        font-size: 1rem;
    }

    .form-section {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="date"],
    select {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }
}

/* ===== ANIMATION DELAYS ===== */
.form-section:nth-child(1) { animation-delay: 0.1s; }
.form-section:nth-child(2) { animation-delay: 0.2s; }
.form-section:nth-child(3) { animation-delay: 0.3s; }
.form-section:nth-child(4) { animation-delay: 0.4s; }
.form-section:nth-child(5) { animation-delay: 0.5s; }
.form-section:nth-child(6) { animation-delay: 0.6s; }
.form-section:nth-child(7) { animation-delay: 0.7s; }
.form-section:nth-child(8) { animation-delay: 0.8s; }
.form-section:nth-child(9) { animation-delay: 0.9s; }
.form-section:nth-child(10) { animation-delay: 1.0s; }

/* ===== PHOTO UPLOAD ===== */
.photo-upload-container {
    position: relative;
    margin-top: 0.5rem;
}

.photo-drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background-color: var(--surface);
}

.photo-drop-zone:hover,
.photo-drop-zone.dragover {
    border-color: var(--secondary);
    background-color: #f7f7fe;
}

.photo-drop-zone-text p {
    margin: 0 0 0.5rem;
    color: var(--text-secondary);
}

.photo-drop-zone-text small {
    color: var(--text-muted);
}

#photo-preview-container {
    margin-top: 1rem;
    text-align: center;
    display: none;
}

#photo-preview {
    max-width: 150px;
    max-height: 150px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    object-fit: cover;
}

#remove-photo {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--danger);
    cursor: pointer;
    background: none;
    border: none;
}

/* Styles pour le justificatif */
#justificatif-section {
    display: none; /* Caché par défaut */
}
