:root {
    --brand: #00803E;
    --brand-hover: #0a5e4e;
    --brand-light: #e6f3f0;
    --accent: #FFF200;
    --accent-light: #fef3e2;
    --success: #27ae60;
    --danger: #ED1C24;
    --warning: #FFF200;
    --container-max: 1200px;
    --container-padding: 1.5rem;

    /* Light theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --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);
    --gradient-bg: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #cbd5e1 100%);
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border: #334155;
    --border-light: #475569;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.3);
    --gradient-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    --glass-bg: rgba(15, 23, 42, 0.9);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gradient-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: all 0.3s ease;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(14, 124, 102, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(243, 156, 18, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(39, 174, 96, 0.05) 0%, transparent 50%);
    z-index: -1;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }

    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* Plus de largeur sur grands écrans (réduit l'espace autour) */
@media (min-width: 1280px) {
    :root {
        --container-max: 1360px;
    }
}

@media (min-width: 1536px) {
    :root {
        --container-max: 1520px;
    }
}

@media (min-width: 1920px) {
    :root {
        --container-max: 1680px;
    }
}

/* Header */
.header {
    backdrop-filter: blur(20px) saturate(180%);
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
}

.logo {
    

    width: 100px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.logo::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    top: 8px;
    left: 8px;
}

.brand-text h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.brand-text p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

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



.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.theme-toggle:hover {
    background: var(--brand);
    color: white;
    transform: scale(1.05);
}

.help-btn {
    background: var(--brand);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

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

/* Hero Section */
.hero {
    text-align: center;
    padding: 0.25rem 0;
    position: relative;
}

.hero h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 900;
    margin-bottom: 0.25rem;
    background: var(--brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.hero p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Main Content */
.main-content {
    padding: 0rem 0 1rem;
}


.form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: clamp(1.5rem, 2.5vw, 2.5rem);
    align-items: start;
}

@media (max-width: 1024px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Card Styles */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background:var(--success);
}

.card-header {
    padding: 1rem 1rem 1rem;
    border-bottom: 1px solid var(--border-light);
}

.card-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-align: center;
}


.card-body {
    padding: 0.5rem 1rem 1rem;
}

/* Alert */
.alert {
    background: linear-gradient(135deg, var(--brand-light), rgba(14, 124, 102, 0.08));
    border: 1px solid rgba(14, 124, 102, 0.2);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--brand), var(--accent));
}

.alert-content {
    display: flex;
    align-items: start;
    gap: 1rem;
}

.alert-icon {
    color: var(--brand);
    font-size: 1.5rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.alert-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.alert-text strong {
    color: var(--brand);
    font-weight: 700;
}

/* Form Styles */
.form {
    display: grid;
    gap: 1rem;
}

.form-group {
    display: grid;
    gap: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.required {
    color: var(--danger);
    font-size: 0.75rem;
}

.form-input,
.form-select,
.form-textarea {
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
    width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(14, 124, 102, 0.1);
    transform: translateY(-1px);
    background: var(--bg-primary);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: var(--brand);
    background: var(--bg-primary);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* File Upload */
.file-upload {
    position: relative;
    background: var(--bg-secondary);
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 2rem 1rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.file-upload:hover {
    border-color: var(--brand);
    background: var(--brand-light);
}

.file-upload input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-upload-icon {
    font-size: 2rem;
    color: var(--brand);
    margin-bottom: 0.5rem;
}

/* File List */
.file-list {
    margin-top: 1rem;
    display: none;
}

.file-list.show {
    display: block;
}

.file-list-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}

.file-list-header h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    animation: fadeIn 0.3s ease;
    transition: all 0.2s ease;
}

.file-item:hover {
    background: #f1f3f4;
    border-color: var(--brand);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.file-icon {
    font-size: 1.25rem;
    color: #27ae60;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-details h4 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
    word-break: break-all;
    line-height: 1.3;
}

.file-details p {
    font-size: 0.75rem;
    color: #6c757d;
    margin: 0;
    font-weight: 500;
}

.file-remove {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: bold;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.file-remove:hover {
    background: #c82333;
    transform: scale(1.1);
}

.file-total {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #e8f5e8;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #27ae60;
    font-weight: 600;
    text-align: center;
    border: 1px solid #d4edda;
}

.file-total.warning {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.file-total.error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

/* Assurer la même hauteur pour tous les champs dynamiques */
#assureFields .form-input,
#assureFields .form-select,
#assureContactFields .form-input,
#assureContactFields .form-select,
#prestataireFields .form-input,
#prestataireFields .form-select,
#prestataireContactFields .form-input,
#prestataireContactFields .form-select {
    padding: 0.75rem 1rem;
    min-height: 48px;
    box-sizing: border-box;
}

/* Assurer la même hauteur pour les labels */
#assureFields .form-label,
#assureContactFields .form-label,
#prestataireFields .form-label,
#prestataireContactFields .form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    min-height: 20px;
}

/* Assurer la même structure pour les groupes de formulaires */
#assureFields .form-group,
#assureContactFields .form-group,
#prestataireFields .form-group,
#prestataireContactFields .form-group {
    display: grid;
    gap: 0.5rem;
}

/* Assurer la même largeur pour toutes les lignes */
#assureFields,
#assureContactFields,
#prestataireFields,
#prestataireContactFields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
}

/* Assurer que les colonnes ont la même largeur */
#assureFields .form-group,
#assureContactFields .form-group,
#prestataireFields .form-group,
#prestataireContactFields .form-group {
    width: 100%;
    min-width: 0;
}

/* Assurer que les champs prennent toute la largeur */
#assureFields .form-input,
#assureFields .form-select,
#assureContactFields .form-input,
#assureContactFields .form-select,
#prestataireFields .form-input,
#prestataireFields .form-select,
#prestataireContactFields .form-input,
#prestataireContactFields .form-select {
    width: 100%;
    box-sizing: border-box;
}

/* File List Compact */
.file-item-compact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 0.4rem;
    animation: fadeIn 0.3s ease;
    transition: all 0.2s ease;
}

.file-item-compact:hover {
    background: #f1f3f4;
    border-color: var(--brand);
}

.file-icon-compact {
    font-size: 1.1rem;
    color: #27ae60;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-details-compact {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 0.1rem 0;
    word-break: break-all;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 0.7rem;
    color: #6c757d;
    margin: 0;
    font-weight: 500;
}

.file-remove-compact {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: bold;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.file-remove-compact:hover {
    background: #dc3545;
    transform: scale(1.1);
}

.file-total-compact {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #e8f5e8;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #27ae60;
    font-weight: 600;
    text-align: center;
    border: 1px solid #d4edda;
}

.file-total-compact.warning {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.file-total-compact.error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

/* Toggle Switch */
.toggle-group {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.toggle-group::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand), var(--accent));
}

.toggle-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.toggle-switch>div:first-child {
    flex: 1;
}

.toggle-switch .form-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.toggle-switch .form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.switch {
    position: relative;
    width: 60px;
    height: 32px;
    background: var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.switch.active {
    background: linear-gradient(135deg, var(--brand), var(--brand-hover));
    box-shadow: 0 0 0 3px rgba(14, 124, 102, 0.2);
}

.switch-handle {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 26px;
    height: 26px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.switch.active .switch-handle {
    transform: translateX(28px);
}

#modeText {
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Identity Fields */
.identity-fields {
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    border-radius: 20px;
    padding: 2rem;
    margin-top: 1rem;
    border: 1px solid var(--border);
    transform: translateY(-10px);
    opacity: 0;
    transition: all 0.4s ease;
    max-height: 0;
    overflow: hidden;
    position: relative;
}

.identity-fields::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--brand));
}

.identity-fields.show {
    transform: translateY(0);
    opacity: 1;
    max-height: 800px;
}

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

.identity-fields .form-row {
    gap: 1.5rem;
}

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

.identity-fields .form-input,
.identity-fields .form-select {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.identity-fields .form-input:focus,
.identity-fields .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(14, 124, 102, 0.1);
    background: var(--bg-primary);
}

/* Buttons */
.btn-group {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.btn {
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-hover));
    color: white;
    box-shadow: var(--shadow-md);
}

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

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

.btn-secondary:hover {
    background: var(--bg-tertiary);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Sidebar */
.sidebar-card {
    position: sticky;
    top: 100px;
}

/* Guide pratique un peu plus grand sur desktop */
@media (min-width: 1024px) {
    .sidebar-card .card-header h3 {
        font-size: 1.65rem;
    }

    .sidebar-card .card-header p {
        font-size: 0.95rem;
    }

    .sidebar-card .info-icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
        border-radius: 14px;
    }

    .sidebar-card .info-content h4 {
        font-size: 0.95rem;
    }

    .sidebar-card .info-content p {
        font-size: 0.85rem;
        line-height: 1.55;
    }

    .sidebar-card .faq-question {
        font-size: 0.95rem;
    }

    .sidebar-card .faq-answer {
        font-size: 0.95rem;
        line-height: 1.6;
    }
}

.info-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
}

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

.info-icon {
    width: 40px;
    height: 40px;
    background: var(--brand-light);
    color: var(--brand);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
}

.info-content h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.info-content p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* FAQ */
.faq-item {
    border-bottom: 1px solid var(--border-light);
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 1rem 0;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-answer {
    padding: 0 0 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-answer.show {
    max-height: 200px;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(400px);
    transition: all 0.3s ease;
    z-index: 1000;
    max-width: 400px;
    font-weight: 500;
    font-size: 0.9rem;
    color: white;
    border: none;
    display: none;
    /* Cacher par défaut */
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: #27ae60;
}

.toast.error {
    background: #e74c3c;
}



/* Field Error Styles */
.field-error {
    color: var(--danger);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading State */
.btn-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        --container-padding: 1rem;
    }

    .hero {
        padding: 2rem 0;
    }

    .card-body {
        padding: 1.5rem;
    }

    .btn-group {
        flex-direction: column;
    }

    .header-content {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .toast {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
        transform: translateY(-100px);
    }

    .toast.show {
        transform: translateY(0);
    }
}

/* Option Anonyme en haut */
.anonymous-option {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.anonymous-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand), var(--accent));
}

.anonymous-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.anonymous-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    background: var(--brand-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.anonymous-text {
    flex: 1;
}

.anonymous-text .form-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.anonymous-text .form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.anonymous-option .switch {
    position: relative;
    width: 60px;
    height: 32px;
    background: var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.anonymous-option .switch.active {
    background: linear-gradient(135deg, var(--brand), var(--brand-hover));
    box-shadow: 0 0 0 3px rgba(14, 124, 102, 0.2);
}

.anonymous-option .switch-handle {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 26px;
    height: 26px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.anonymous-option .switch.active .switch-handle {
    transform: translateX(28px);
}

#modeText {
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    font-size: 0.9rem;
}

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0 1.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}

.section-bar {
    width: 4px;
    height: 40px;
    border-radius: 2px;
    flex-shrink: 0;
}

.partner-bar {
    background: linear-gradient(180deg, #27ae60, #2ecc71);
}

.complaint-bar {
    background: linear-gradient(180deg, #f39c12, #e67e22);
}

.section-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Anonymous Toggle Improvements */
.toggle-group {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    margin-top: 1rem;
}

.toggle-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    position: relative;
}

.toggle-switch::before {
    content: '👤';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    opacity: 0.7;
}

.toggle-switch.active::before {
    content: '🔒';
}

.toggle-switch>div:first-child {
    flex: 1;
    margin-left: 2rem;
}

/* Identity Fields Hidden State */
.identity-fields {
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    border-radius: 20px;
    padding: 2rem;
    margin-top: 1rem;
    border: 1px solid var(--border);
    transform: translateY(-10px);
    opacity: 0;
    transition: all 0.4s ease;
    max-height: 0;
    overflow: hidden;
    position: relative;
    display: none;
    /* Masqué par défaut */
}

.identity-fields.show {
    transform: translateY(0);
    opacity: 1;
    max-height: 800px;
    display: block;
}


/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    body::before {
        animation: none;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Anonymous Toggle */
.anonymous-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.anonymous-toggle:hover {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(14, 124, 102, 0.1);
}

.anonymous-text {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Toggle Switch iOS Style */
.checkbox-wrapper-7 .tgl {
    display: none;
}

.checkbox-wrapper-7 .tgl,
.checkbox-wrapper-7 .tgl:after,
.checkbox-wrapper-7 .tgl:before,
.checkbox-wrapper-7 .tgl *,
.checkbox-wrapper-7 .tgl *:after,
.checkbox-wrapper-7 .tgl *:before,
.checkbox-wrapper-7 .tgl+.tgl-btn {
    box-sizing: border-box;
}

.checkbox-wrapper-7 .tgl::-moz-selection,
.checkbox-wrapper-7 .tgl:after::-moz-selection,
.checkbox-wrapper-7 .tgl:before::-moz-selection,
.checkbox-wrapper-7 .tgl *::-moz-selection,
.checkbox-wrapper-7 .tgl *:after::-moz-selection,
.checkbox-wrapper-7 .tgl *:before::-moz-selection,
.checkbox-wrapper-7 .tgl+.tgl-btn::-moz-selection,
.checkbox-wrapper-7 .tgl::selection,
.checkbox-wrapper-7 .tgl:after::selection,
.checkbox-wrapper-7 .tgl:before::selection,
.checkbox-wrapper-7 .tgl *::selection,
.checkbox-wrapper-7 .tgl *:after::selection,
.checkbox-wrapper-7 .tgl *:before::selection,
.checkbox-wrapper-7 .tgl+.tgl-btn::selection {
    background: none;
}

.checkbox-wrapper-7 .tgl+.tgl-btn {
    outline: 0;
    display: block;
    width: 4em;
    height: 2em;
    position: relative;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.checkbox-wrapper-7 .tgl+.tgl-btn:after,
.checkbox-wrapper-7 .tgl+.tgl-btn:before {
    position: relative;
    display: block;
    content: "";
    width: 50%;
    height: 100%;
}

.checkbox-wrapper-7 .tgl+.tgl-btn:after {
    left: 0;
}

.checkbox-wrapper-7 .tgl+.tgl-btn:before {
    display: none;
}

.checkbox-wrapper-7 .tgl:checked+.tgl-btn:after {
    left: 50%;
}

.checkbox-wrapper-7 .tgl-ios+.tgl-btn {
    background: #fbfbfb;
    border-radius: 2em;
    padding: 2px;
    transition: all 0.4s ease;
    border: 1px solid #e8eae9;
}

.checkbox-wrapper-7 .tgl-ios+.tgl-btn:after {
    border-radius: 2em;
    background: #fbfbfb;
    transition: left 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), padding 0.3s ease, margin 0.3s ease;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 4px 0 rgba(0, 0, 0, 0.08);
}

.checkbox-wrapper-7 .tgl-ios+.tgl-btn:hover:after {
    will-change: padding;
}

.checkbox-wrapper-7 .tgl-ios+.tgl-btn:active {
    box-shadow: inset 0 0 0 2em #e8eae9;
}

.checkbox-wrapper-7 .tgl-ios+.tgl-btn:active:after {
    padding-right: 0.8em;
}

.checkbox-wrapper-7 .tgl-ios:checked+.tgl-btn {
    background: #86d993;
}

.checkbox-wrapper-7 .tgl-ios:checked+.tgl-btn:active {
    box-shadow: none;
}

.checkbox-wrapper-7 .tgl-ios:checked+.tgl-btn:active:after {
    margin-left: -0.8em;
}

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0 0.75rem 0;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-light);
}

.section-indicator {
    width: 4px;
    height: 40px;
    border-radius: 2px;
    flex-shrink: 0;
}

.section-indicator.green {
    background: linear-gradient(180deg, #27ae60, #2ecc71);
}

.section-indicator.yellow {
    background:#ED1C24 ;
}

.section-header h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Partner Info Section */
.partner-info-section {
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    border-radius: 20px;
    padding: 1.5rem;
    margin: 0.5rem 0;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.partner-info-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #27ae60, #2ecc71);
}

.partner-info-section.hidden {
    display: none;
}

/* Complaint Details Section */
.complaint-details-section {
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    border-radius: 20px;
    padding: 1.5rem;
    margin: 0.5rem 0;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.complaint-details-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--danger);
}

/* Échelle de satisfaction numérique 1-10 */
.satisfaction-question {
    color: var(--text-secondary, #64748b);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.satisfaction-scale-numeric {
    margin: 1.5rem 0;
}

.scale-row {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.satisfaction-scale-numeric {
    margin: 1.5rem 0;
}

.satisfaction-scale-numeric .scale-row:first-child {
    margin-bottom: 0.5rem;
}

.satisfaction-scale-numeric .scale-row:last-child {
    margin-bottom: 0;
}

.scale-btn {
    width: 50px;
    height: 50px;
    border: 2px solid var(--border, #e5e7eb);
    background: var(--bg-primary, #fff);
    color: var(--text-primary, #1f2937);
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scale-btn:hover {
    border-color: var(--brand, #0E7C66);
    background: var(--brand-light, #e6f3f0);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.scale-btn.selected {
    background: var(--text-primary, #1f2937);
    color: var(--bg-primary, #fff);
    border-color: var(--text-primary, #1f2937);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary, #64748b);
}

.label-left {
    margin-left: 0.5rem;
}

.label-right {
    margin-right: 0.5rem;
}

/* Feedback de satisfaction */
.satisfaction-feedback {
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
}

.feedback-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.feedback-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    margin: 0;
}

.feedback-message {
    font-size: 0.9rem;
    color: var(--text-secondary, #64748b);
    margin: 0;
}

/* Raisons pour notes faibles */
.low-rating-reasons {
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    animation: slideDown 0.3s ease;
}

.low-rating-reasons h5 {
    color: var(--text-primary, #1f2937);
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
}

.reasons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.reason-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reason-option:hover {
    border-color: var(--brand, #0E7C66);
    background: var(--brand-light, #e6f3f0);
}

.reason-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--brand, #0E7C66);
}

.reason-text {
    font-size: 0.9rem;
    color: var(--text-primary, #1f2937);
    font-weight: 500;
}

.other-reason {
    margin-top: 1rem;
}

.other-reason textarea {
    min-height: 80px;
    resize: vertical;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive pour l'échelle */
@media (max-width: 768px) {
    .scale-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    .scale-row {
        gap: 0.3rem;
    }

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

@media (max-width: 640px) {
    .scale-btn {
        width: 35px;
        height: 35px;
        font-size: 0.8rem;
    }

    .scale-row {
        gap: 0.2rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .scale-labels {
        font-size: 0.7rem;
    }
}