/* =============================================
   PORTAL — portal.css
   Design cohérent avec le site principal B2
   ============================================= */

:root {
    --p-orange:    #fd7200;
    --p-orange-lt: #fff3e6;
    --p-gradient:  linear-gradient(135deg, #fcb045 0%, #fd1d1d 50%, #833ab4 100%);
    --p-text:      #1a1a2e;
    --p-muted:     #6b7280;
    --p-border:    #e5e7eb;
    --p-bg:        #f8f9fb;
    --p-radius:    16px;
    --p-radius-sm: 10px;
    --p-shadow:    0 2px 12px rgba(0,0,0,0.05);
    --p-shadow-md: 0 4px 24px rgba(0,0,0,0.07);
}

/* =============================================
   LAYOUT
   ============================================= */

body { background: var(--p-bg); }

/* --- Header --- */
.portal-header {
    background: white;
    border-bottom: 1px solid var(--p-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.portal-header-inner {
    margin-left: 8%;
    margin-right: 8%;
    padding-top: 15px;
    padding-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.portal-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.portal-logo img { height: 60px; }

.portal-logo-badge {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--p-orange);
    background: var(--p-orange-lt);
    padding: 3px 9px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.portal-user-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.portal-user-email {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: var(--p-muted);
}

.portal-logout {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: var(--p-muted);
    text-decoration: none;
    padding: 6px 14px;
    border: 1px solid var(--p-border);
    border-radius: 8px;
    transition: color 0.15s, border-color 0.15s;
}

.portal-logout:hover { color: var(--p-text); border-color: #9ca3af; }

/* --- Main --- */
.portal-main {
    margin-left: 8%;
    margin-right: 8%;
    padding: 2.5rem 0.5rem 5rem;
}

.portal-main--hero {
    padding-top: 0;
}

.portal-main--with-banner {
    margin-left: 0;
    margin-right: 0;
    padding: 0;
}

/* Chaque section enfant directe gère son alignement à 8% */
.portal-main--with-banner > .portal-flash,
.portal-main--with-banner > .dm-step,
.portal-main--with-banner > .dm-docs-page {
    padding-left: 8%;
    padding-right: 8%;
    box-sizing: border-box;
}

/* --- Footer --- */
.portal-footer {
    background: #131313;
    color: rgba(255,255,255,0.45);
    text-align: center;
    padding: 1.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
}

/* --- Flash messages --- */
.portal-flash {
    border-radius: var(--p-radius-sm);
    padding: 0.9rem 1.25rem;
    margin-bottom: 1.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.portal-flash-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.portal-flash-error   { background: #fff8f0; border: 1px solid #fed7aa; color: #c2410c; }

/* =============================================
   TYPOGRAPHIE / PAGE TITLES
   ============================================= */

.portal-page-title {
    font-family: 'PT Serif', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--p-text);
    margin-bottom: 0.4rem;
}

.portal-page-sub {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--p-muted);
    margin-bottom: 2rem;
}

.portal-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: var(--p-muted);
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: color 0.15s;
}

.portal-back:hover { color: var(--p-text); }

.portal-section { margin-bottom: 2.5rem; }

.portal-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.portal-section-title {
    font-family: 'PT Serif', serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--p-text);
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid #f3f4f6;
}

/* =============================================
   CARDS GÉNÉRIQUES
   ============================================= */

.portal-card {
    background: white;
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius);
    padding: 1.5rem;
    box-shadow: var(--p-shadow);
}

/* =============================================
   DASHBOARD — COMMANDES
   ============================================= */

.portal-orders-list { display: flex; flex-direction: column; gap: 1rem; }

/* Bloc icône gauche (inspiré de .booking-date du site principal) */
.portal-order-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    background: var(--p-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
}

.portal-order-card {
    background: white;
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}

.portal-order-card:hover {
    box-shadow: 0 6px 24px rgba(253,114,0,0.1);
    border-color: #fcd9b1;
    transform: translateY(-2px);
}

.portal-order-info h3 {
    font-family: 'PT Serif', serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--p-text);
    margin: 0 0 0.3rem;
}

.portal-order-meta {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: var(--p-muted);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
}

.portal-order-progress { text-align: right; min-width: 140px; flex-shrink: 0; }

.portal-order-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}

.portal-order-resume {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--p-orange);
    white-space: nowrap;
}

.portal-progress-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    color: var(--p-muted);
    margin-bottom: 0.35rem;
}

.portal-progress-bar { height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; }

.portal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fcb045, #fd1d1d);
    border-radius: 3px;
    transition: width 0.4s;
}

.portal-progress-fill.complete { background: #10b981; }

.portal-doc-count {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--p-text);
    margin-top: 0.3rem;
}

.portal-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: var(--p-radius);
    border: 1px solid var(--p-border);
}

.portal-empty h3 {
    font-family: 'PT Serif', serif;
    font-size: 1.2rem;
    color: var(--p-text);
    margin-bottom: 0.5rem;
}

.portal-empty p {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--p-muted);
    margin: 0;
}

/* =============================================
   BADGES DE STATUT
   ============================================= */

.portal-badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.portal-badge-pending   { background: #fef3c7; color: #92400e; }
.portal-badge-paid      { background: #d1fae5; color: #065f46; }
.portal-badge-validated { background: #d1fae5; color: #065f46; }
.portal-badge-rejected  { background: #fee2e2; color: #991b1b; }
.portal-badge-completed { background: #dbeafe; color: #1e40af; }
.portal-badge-missing   { background: #f3f4f6; color: #6b7280; }
.portal-badge-orange    { background: var(--p-orange-lt); color: var(--p-orange); }

/* =============================================
   ORDER SHOW — QUESTIONNAIRE BANNER
   ============================================= */

.portal-form-banner {
    border-radius: var(--p-radius);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.portal-form-banner-validated { background: #f0fdf4; border: 1px solid #bbf7d0; }
.portal-form-banner-saved     { background: #fffbeb; border: 1px solid #fde68a; }
.portal-form-banner-empty     { background: #fff8f0; border: 1px solid #fcd9b1; }

.portal-form-banner-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.portal-form-banner-validated .portal-form-banner-title { color: #065f46; }
.portal-form-banner-saved .portal-form-banner-title     { color: #92400e; }
.portal-form-banner-empty .portal-form-banner-title     { color: #c2410c; }

.portal-form-banner-sub {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: var(--p-muted);
    margin: 0;
}

/* Récap réponses */
.portal-recap {
    margin-top: 1.25rem;
    background: white;
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius);
    overflow: hidden;
}

.portal-recap-head {
    background: #f9fafb;
    padding: 0.75rem 1.25rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.88rem;
    color: #374151;
    border-bottom: 1px solid var(--p-border);
}

.portal-recap table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Inter', sans-serif;
    font-size: 0.87rem;
}

.portal-recap td { padding: 0.6rem 1.25rem; border-bottom: 1px solid #f3f4f6; }
.portal-recap td:first-child { color: var(--p-muted); font-weight: 500; width: 40%; }
.portal-recap td:last-child  { color: var(--p-text); }

/* =============================================
   DOCUMENTS
   ============================================= */

.portal-doc-row {
    background: white;
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
}

.portal-doc-row-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.portal-doc-info { flex: 1; }

.portal-doc-label {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--p-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.15rem;
}

.portal-doc-desc  { font-family: 'Inter', sans-serif; font-size: 0.82rem; color: var(--p-muted); margin: 0; }
.portal-doc-formats { font-family: 'Inter', sans-serif; font-size: 0.78rem; color: #9ca3af; margin-top: 0.1rem; }

.portal-doc-actions { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }

.portal-doc-rejected-note {
    background: #fee2e2;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    margin-top: 0.6rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: #991b1b;
}

.portal-upload-form {
    display: none;
    margin-top: 0.75rem;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    padding: 1rem;
}

.portal-upload-form.active { display: block; }

.portal-upload-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.portal-upload-row input[type=file] { flex: 1; font-size: 0.85rem; font-family: 'Inter', sans-serif; }

.portal-admin-doc-row {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--p-radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* PDF rows */
.portal-pdf-row {
    background: white;
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.portal-pdf-locked-note {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--p-radius-sm);
    padding: 0.9rem 1.25rem;
    margin-top: 0.75rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.87rem;
    color: #92400e;
}

/* =============================================
   BADGES OBLIGATOIRE / FACULTATIF
   ============================================= */

.portal-req-badge {
    background: var(--p-orange-lt);
    color: var(--p-orange);
    border-radius: 4px;
    padding: 0.1rem 0.45rem;
    font-size: 0.72rem;
    font-weight: 600;
}

.portal-opt-badge {
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 4px;
    padding: 0.1rem 0.45rem;
    font-size: 0.72rem;
}

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

.portal-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

.portal-btn:hover { transform: translateY(-1px); }

.portal-btn-primary {
    background: var(--p-gradient);
    color: white;
}

.portal-btn-primary:hover { color: white; box-shadow: 0 4px 16px rgba(253,29,29,0.3); }

.portal-btn-orange { background: var(--p-orange); color: white; }
.portal-btn-orange:hover { color: white; opacity: 0.9; }

.portal-btn-outline {
    background: white;
    color: var(--p-text);
    border: 1px solid var(--p-border);
}

.portal-btn-outline:hover { background: #f9fafb; border-color: #9ca3af; color: var(--p-text); }

.portal-btn-success { background: #10b981; color: white; }
.portal-btn-success:hover { color: white; opacity: 0.9; }

.portal-btn-ghost {
    background: none;
    color: var(--p-muted);
    padding: 0;
    font-weight: 500;
}

.portal-btn-ghost:hover { color: var(--p-text); transform: none; }

.portal-btn-disabled { opacity: 0.4; cursor: not-allowed; }
.portal-btn-disabled:hover { transform: none; box-shadow: none; }

/* =============================================
   FORMULAIRE MULTI-ÉTAPES
   ============================================= */

.portal-form-wrap { max-width: 760px; }

.portal-step-indicator { display: flex; align-items: center; margin-bottom: 2rem; }

.portal-step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}

.portal-step-dot.active  { background: linear-gradient(135deg, #fcb045, #fd1d1d); color: white; }
.portal-step-dot.done    { background: #d1fae5; color: #065f46; }
.portal-step-dot.pending { background: #f3f4f6; color: #9ca3af; }

.portal-step-line { flex: 1; height: 2px; margin: 0 0.35rem; background: #e5e7eb; transition: background 0.2s; }
.portal-step-line.done { background: #6ee7b7; }

.portal-step-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    color: var(--p-muted);
    text-align: center;
    margin-top: 0.25rem;
    white-space: nowrap;
}

.portal-step-panel { display: none; }
.portal-step-panel.active { display: block; }

.portal-form-card {
    background: white;
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--p-shadow);
}

.portal-form-card h2 {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--p-text);
    margin: 0 0 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

.portal-field-block { margin-bottom: 1.25rem; }

.portal-field-block label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.35rem;
}

.portal-field-block .portal-help {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 0.2rem;
}

.portal-field-block input[type=text],
.portal-field-block input[type=number],
.portal-field-block input[type=date],
.portal-field-block textarea,
.portal-field-block select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    background: #f9fafb;
    box-sizing: border-box;
    color: var(--p-text);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.portal-field-block input:focus,
.portal-field-block textarea:focus,
.portal-field-block select:focus {
    border-color: var(--p-orange);
    background: white;
    box-shadow: 0 0 0 3px rgba(253,114,0,0.1);
}

.portal-radio-group,
.portal-checkbox-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.portal-radio-group label,
.portal-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 400;
    cursor: pointer;
    padding: 0.4rem 0.75rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    font-size: 0.88rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.15s, background 0.15s;
}

.portal-radio-group label:hover,
.portal-checkbox-group label:hover { border-color: var(--p-orange); background: #fff8f0; }

.portal-radio-group input,
.portal-checkbox-group input { margin: 0; accent-color: var(--p-orange); }

.portal-repeatable-list { display: flex; flex-direction: column; gap: 0.4rem; }

.portal-btn-add-repeat {
    background: none;
    border: 1px dashed #d1d5db;
    border-radius: 6px;
    padding: 0.4rem 0.85rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: var(--p-orange);
    cursor: pointer;
    width: 100%;
    margin-top: 0.35rem;
    transition: background 0.15s;
}

.portal-btn-add-repeat:hover { background: #fff8f0; }

.portal-remove-repeat { background: none; border: none; color: #dc2626; cursor: pointer; padding: 0 0.3rem; font-size: 1rem; }

.portal-step-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.portal-alert {
    padding: 0.85rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
}

.portal-alert-error { background: #fef2f2; border: 1px solid #fca5a5; color: #dc2626; }

/* =============================================
   LOGIN
   ============================================= */

.portal-login-wrap { max-width: 440px; margin: 3rem auto; }

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

.portal-login-header h1 {
    font-family: 'PT Serif', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--p-text);
    margin-bottom: 0.4rem;
}

.portal-login-header p {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--p-muted);
    margin: 0;
}

.portal-login-card {
    background: white;
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius);
    padding: 2rem;
    box-shadow: var(--p-shadow-md);
}

.portal-login-card .portal-form-group { margin-bottom: 1rem; }

.portal-login-card label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.4rem;
}

.portal-login-card input {
    width: 100%;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    outline: none;
    box-sizing: border-box;
    background: #f9fafb;
    color: var(--p-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.portal-login-card input:focus {
    border-color: var(--p-orange);
    background: white;
    box-shadow: 0 0 0 3px rgba(253,114,0,0.1);
}

.portal-login-submit {
    width: 100%;
    padding: 0.75rem;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: var(--p-gradient);
    color: white;
    margin-top: 0.5rem;
    transition: opacity 0.2s, box-shadow 0.2s;
}

.portal-login-submit:hover { opacity: 0.92; box-shadow: 0 4px 18px rgba(253,29,29,0.3); }

.portal-btn-google {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: white;
    color: #374151;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.65rem 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.portal-btn-google:hover { background: #f9fafb; border-color: #9ca3af; color: #374151; }

.portal-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    font-family: 'Inter', sans-serif;
    color: #9ca3af;
    font-size: 0.85rem;
}

.portal-divider::before,
.portal-divider::after { content: ''; flex: 1; border-top: 1px solid #e5e7eb; }

.portal-login-info {
    margin-top: 1.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    color: #9ca3af;
    text-align: center;
}

/* =============================================
   DASHBOARD — HERO BANNER
   ============================================= */

.portal-hero {
    background: var(--p-gradient);
    padding-top: 3rem;
    padding-bottom: 5.5rem;
}

.portal-hero-inner {
    margin-left: 8%;
    margin-right: 8%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.portal-hero-greeting {
    font-family: 'PT Serif', serif;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin: 0 0 0.4rem;
}

.portal-hero-sub {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: rgba(255,255,255,0.82);
    margin: 0;
}

.portal-btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    color: var(--p-text);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.65rem 1.3rem;
    border-radius: 10px;
    text-decoration: none;
    white-space: nowrap;
    transition: box-shadow 0.2s, transform 0.2s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.portal-btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    color: var(--p-text);
}

/* =============================================
   DASHBOARD — STAT CARDS
   ============================================= */

.portal-stat-cards {
    margin-top: -3rem;
    margin-bottom: 2.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    position: relative;
    z-index: 2;
}

.portal-stat-card {
    background: white;
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--p-shadow-md);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.portal-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.portal-stat-icon-orders   { background: #fff3e6; color: var(--p-orange); }
.portal-stat-icon-docs     { background: #d1fae5; color: #065f46; }
.portal-stat-icon-pending  { background: #fef3c7; color: #92400e; }

.portal-stat-content { flex: 1; min-width: 0; }

.portal-stat-value {
    font-family: 'PT Serif', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--p-text);
    line-height: 1;
    display: block;
}

.portal-stat-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    color: var(--p-muted);
    display: block;
    margin-top: 0.2rem;
}

/* =============================================
   DASHBOARD — GRID (main + sidebar)
   ============================================= */

.portal-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
    align-items: start;
}

.portal-sidebar-card {
    background: white;
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius);
    padding: 1.25rem;
    box-shadow: var(--p-shadow);
    margin-bottom: 1rem;
}

.portal-sidebar-card h3 {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--p-text);
    margin: 0 0 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid #f3f4f6;
}

.portal-quick-actions { display: flex; flex-direction: column; gap: 0.15rem; }

.portal-quick-actions a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.5rem;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: var(--p-text);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.portal-quick-actions a:hover { background: #fff8f0; color: var(--p-orange); }

.portal-qa-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--p-muted);
    transition: background 0.15s, color 0.15s;
}

.portal-quick-actions a:hover .portal-qa-icon { background: var(--p-orange-lt); color: var(--p-orange); }

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

@media (max-width: 768px) {
    .portal-header-inner { margin-left: 3%; margin-right: 3%; }
    .portal-logo img     { height: 50px; }
    .portal-user-email   { display: none; }
    .portal-main         { margin-left: 3%; margin-right: 3%; padding: 1.5rem 0.5rem 4rem; }
    .portal-order-card   { flex-direction: column; align-items: flex-start; }
    .portal-order-progress { text-align: left; min-width: unset; }
    .portal-form-card    { padding: 1.25rem; }
    .portal-login-wrap   { margin: 1.5rem auto; }
    .portal-form-banner  { flex-direction: column; align-items: flex-start; }
    .portal-doc-row-main { flex-direction: column; align-items: flex-start; }

    .portal-order-card   { gap: 0.75rem; }
    .portal-order-icon   { width: 44px; height: 44px; }
    .portal-order-actions { align-items: flex-start; }
    .portal-hero         { padding-top: 2rem; padding-bottom: 4.5rem; }
    .portal-hero-inner   { margin-left: 3%; margin-right: 3%; flex-direction: column; align-items: flex-start; gap: 1rem; }
    .portal-hero-greeting { font-size: 1.5rem; }
    .portal-stat-cards   { grid-template-columns: 1fr 1fr; }
    .portal-dashboard-grid { grid-template-columns: 1fr; }
}

/* ── Champs composés (entreprise, associé, dirigeant, activités) ─────────── */
.portal-input,
.portal-select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    background: #f9fafb;
    box-sizing: border-box;
    color: var(--p-text);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    display: block;
}
.portal-input:focus,
.portal-select:focus {
    border-color: var(--p-orange);
    background: white;
    box-shadow: 0 0 0 3px rgba(253,114,0,0.1);
}
textarea.portal-input { resize: vertical; }

.portal-sub-label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 0.3rem;
}

.portal-compound-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

.portal-autocomplete-dropdown {
    position: absolute;
    z-index: 200;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
    width: 100%;
    max-height: 280px;
    overflow-y: auto;
    top: 100%;
    left: 0;
    margin-top: 2px;
}
.portal-autocomplete-item {
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
}
.portal-autocomplete-item:last-child { border-bottom: none; }
.portal-autocomplete-item:hover { background: #f5f3ff; }

/* =============================================
   DÉMARCHE — Barre de progression
   ============================================= */

.dm-progress {
    margin-bottom: 2.5rem;
}

.dm-progress-bar {
    display: flex;
    align-items: center;
    overflow-x: auto;
    padding-bottom: 4px;
}

.dm-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    min-width: 60px;
}

.dm-progress-dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    background: #f3f4f6;
    color: #9ca3af;
    border: 2px solid #e5e7eb;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.dm-progress-step.is-active .dm-progress-dot {
    background: linear-gradient(135deg, #fcb045, #fd1d1d);
    color: white;
    border-color: transparent;
}

.dm-progress-step.is-complete .dm-progress-dot {
    background: #d1fae5;
    color: #065f46;
    border-color: #6ee7b7;
}

.dm-progress-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    color: #9ca3af;
    text-align: center;
    white-space: nowrap;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dm-progress-step.is-active .dm-progress-label  { color: #fd1d1d; font-weight: 600; }
.dm-progress-step.is-complete .dm-progress-label { color: #065f46; }

.dm-progress-line {
    flex: 1;
    height: 2px;
    background: #e5e7eb;
    min-width: 20px;
    margin-bottom: 24px;
    transition: background 0.2s;
}

.dm-progress-line.is-complete { background: #6ee7b7; }

/* =============================================
   DÉMARCHE — Step wrapper
   ============================================= */

.dm-step { max-width: 720px; }

/* Pas de contrainte de largeur quand le formulaire est en 2 colonnes */
.dm-step:has(.dm-form-layout) { max-width: none; }

.dm-step-header { margin-bottom: 2rem; }

.dm-step-title {
    font-family: 'PT Serif', serif;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--p-text);
    margin: 0 0 0.5rem;
}

.dm-step-desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--p-muted);
    margin: 0;
}

/* =============================================
   DÉMARCHE — Formulaire
   ============================================= */

.dm-fields { display: flex; flex-direction: column; gap: 1.25rem; }

.dm-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

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

.dm-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

.dm-required { color: var(--p-orange); margin-left: 2px; }

.dm-input {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    background: #f9fafb;
    box-sizing: border-box;
    color: var(--p-text);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.dm-input:focus {
    border-color: var(--p-orange);
    background: white;
    box-shadow: 0 0 0 3px rgba(253,114,0,0.1);
}

.dm-help {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #9ca3af;
    margin: 0;
}

.dm-radio-group,
.dm-checkbox-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.dm-radio-label,
.dm-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    color: var(--p-text);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.dm-radio-label:hover,
.dm-checkbox-label:hover { border-color: var(--p-orange); background: #fff8f0; }

.dm-radio-label input,
.dm-checkbox-label input { accent-color: var(--p-orange); margin: 0; }

/* Actions row */
.dm-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f3f4f6;
}

/* Autosave status */
.dm-autosave-status {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #9ca3af;
    flex: 1;
}
.dm-autosave-saving { color: var(--p-orange); }
.dm-autosave-ok     { color: #10b981; }
.dm-autosave-error  { color: #ef4444; }

/* Buttons */
.dm-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--p-gradient);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0.7rem 1.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s, opacity 0.15s;
    text-decoration: none;
}

.dm-btn-primary:hover  { box-shadow: 0 4px 16px rgba(253,29,29,0.3); transform: translateY(-1px); color: white; }
.dm-btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.dm-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: white;
    color: var(--p-muted);
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.7rem 1.25rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    text-decoration: none;
}
.dm-btn-secondary:hover { border-color: #9ca3af; color: var(--p-text); }

.dm-btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #fef2f2;
    color: #dc2626;
    border: 1.5px solid #fca5a5;
    border-radius: 10px;
    padding: 0.6rem 1.25rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.dm-btn-danger:hover { background: #fee2e2; }

/* =============================================
   DÉMARCHE — Formules tarifaires
   ============================================= */

.dm-formulas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.dm-formula {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: var(--p-radius);
    padding: 1.5rem;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    position: relative;
}

.dm-formula:hover {
    border-color: #fcd9b1;
    box-shadow: 0 4px 20px rgba(253,114,0,0.12);
    transform: translateY(-2px);
}

.dm-formula.is-selected {
    border-color: var(--p-orange);
    box-shadow: 0 4px 24px rgba(253,114,0,0.2);
}

.dm-formula-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.dm-formula-name {
    font-family: 'PT Serif', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--p-text);
}

.dm-price-amount {
    font-family: 'Inter', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--p-text);
}

.dm-price-ttc {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: var(--p-muted);
    margin-left: 2px;
}

.dm-price-free {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #10b981;
}

.dm-formula-desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: var(--p-muted);
    margin: 0 0 1rem;
}

.dm-formula-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.dm-formula-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: var(--p-text);
}

.dm-formula-features li svg { color: #10b981; flex-shrink: 0; margin-top: 2px; }

.dm-formula-fees {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem;
    margin: 0.5rem 0 1rem;
}

.dm-formula-fees-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--p-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.dm-formula-fee {
    display: flex;
    justify-content: space-between;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    color: var(--p-text);
    padding: 0.2rem 0;
}

.dm-formula-fee-note {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #9ca3af;
    margin: 0.4rem 0 0;
}

.dm-formula-select-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--p-muted);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
    transition: color 0.15s;
}

.dm-formula-radio {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    display: inline-block;
    flex-shrink: 0;
    transition: border-color 0.15s, background 0.15s;
}

.dm-formula.is-selected .dm-formula-select-btn { color: var(--p-orange); }
.dm-formula.is-selected .dm-formula-radio {
    border-color: var(--p-orange);
    background: var(--p-orange);
    box-shadow: inset 0 0 0 3px white;
}

/* =============================================
   DÉMARCHE — Upsells
   ============================================= */

.dm-upsells { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem; }

.dm-upsell {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: var(--p-radius-sm);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dm-upsell.is-selected {
    border-color: var(--p-orange);
    box-shadow: 0 2px 12px rgba(253,114,0,0.15);
}

.dm-upsell-check { display: none; }

.dm-upsell-body {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
}

.dm-upsell-check-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: transparent;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.dm-upsell.is-selected .dm-upsell-check-icon {
    border-color: #10b981;
    background: #10b981;
    color: white;
}

.dm-upsell-info { flex: 1; }

.dm-upsell-label {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--p-text);
}

.dm-upsell-desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    color: var(--p-muted);
    margin-top: 0.15rem;
}

.dm-upsell-price {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--p-text);
    white-space: nowrap;
}

/* =============================================
   DÉMARCHE — Paiement / Récapitulatif
   ============================================= */

.dm-recap {
    background: white;
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.dm-recap-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--p-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #f3f4f6;
}

.dm-recap-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--p-text);
    border-bottom: 1px solid #f9fafb;
}

.dm-recap-row--fee { color: var(--p-muted); font-size: 0.85rem; }

.dm-recap-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.85rem;
    margin-top: 0.5rem;
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--p-text);
}

.dm-stripe-zone {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.dm-btn-pay {
    font-size: 1rem;
    padding: 0.85rem 2rem;
}

.dm-stripe-note {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #9ca3af;
    margin: 0;
}

.dm-info-box {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--p-radius-sm);
    padding: 1rem 1.25rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: #1e40af;
    margin-bottom: 1.5rem;
}

.dm-info-box svg { flex-shrink: 0; margin-top: 1px; }

/* =============================================
   DÉMARCHE — Confirmation
   ============================================= */

.dm-confirmation { text-align: center; padding: 2rem 1rem; }

.dm-confirmation-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #d1fae5;
    color: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.dm-confirmation-icon svg { width: 40px; height: 40px; }

.dm-confirmation-title {
    font-family: 'PT Serif', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--p-text);
    margin: 0 0 0.75rem;
}

.dm-confirmation-sub {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--p-muted);
    max-width: 480px;
    margin: 0 auto 2rem;
}

.dm-confirmation-recap {
    background: white;
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius);
    padding: 1.25rem;
    max-width: 400px;
    margin: 0 auto 2rem;
    text-align: left;
}

.dm-badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
}

.dm-badge-success { background: #d1fae5; color: #065f46; }
.dm-badge-warning { background: #fef3c7; color: #92400e; }

.dm-confirmation-actions { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }

/* =============================================
   DÉMARCHE — Documents (upload zone)
   ============================================= */

.dm-docs-zone { margin-bottom: 1.5rem; }

.dm-docs-drop {
    border: 2px dashed #d1d5db;
    border-radius: var(--p-radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.dm-docs-drop.is-over,
.dm-docs-drop:hover { border-color: var(--p-orange); background: #fff8f0; }

.dm-docs-drop p {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--p-muted);
    margin: 0.75rem 0 0;
}

.dm-docs-browse { color: var(--p-orange); cursor: pointer; text-decoration: underline; font-weight: 600; }

.dm-docs-hint { font-size: 0.8rem !important; color: #9ca3af !important; }

.dm-docs-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }

.dm-docs-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border: 1px solid var(--p-border);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
}

.dm-docs-item--uploading { border-color: #fcd9b1; }
.dm-docs-item--ok        { border-color: #6ee7b7; }
.dm-docs-item--error     { border-color: #fca5a5; }

.dm-docs-name { flex: 1; color: var(--p-text); }
.dm-docs-status { color: var(--p-muted); margin-left: 1rem; }

.dm-docs-item--ok    .dm-docs-status { color: #10b981; }
.dm-docs-item--error .dm-docs-status { color: #ef4444; }

/* =============================================
   DÉMARCHE — Suivi / Timeline
   ============================================= */

.dm-card {
    background: white;
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--p-shadow);
}

.dm-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dm-timeline { display: flex; flex-direction: column; gap: 0; padding-left: 1.5rem; }

.dm-timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1.5rem;
    position: relative;
}

.dm-timeline-item:last-child { padding-bottom: 0; }

.dm-timeline-item::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 14px;
    bottom: 0;
    width: 2px;
    background: #e5e7eb;
}

.dm-timeline-item:last-child::before { display: none; }

.dm-timeline-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    background: white;
    flex-shrink: 0;
    margin-left: -1.9rem;
    position: relative;
    z-index: 1;
    transition: border-color 0.2s, background 0.2s;
}

.dm-timeline-item--done .dm-timeline-dot {
    border-color: #10b981;
    background: #10b981;
}

.dm-timeline-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--p-text);
}

.dm-timeline-item--pending .dm-timeline-label { color: var(--p-muted); }

.dm-timeline-date {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: var(--p-muted);
    margin-top: 0.15rem;
}

/* =============================================
   DÉMARCHE — Auth tabs (étape inscription)
   ============================================= */

.dm-auth-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.dm-auth-tab {
    padding: 0.55rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--p-muted);
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}

.dm-auth-tab.is-active,
.dm-auth-tab:hover { color: var(--p-orange); border-bottom-color: var(--p-orange); }

.dm-auth-panel { display: none; }
.dm-auth-panel.is-active { display: block; }

/* =============================================
   DÉMARCHE — État vide
   ============================================= */

.dm-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: white;
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--p-muted);
    margin-bottom: 1.5rem;
}

/* =============================================
   RESPONSIVE — Démarche
   ============================================= */

@media (max-width: 640px) {
    .dm-step { max-width: 100%; }
    .dm-step-title { font-size: 1.35rem; }
    .dm-formulas  { grid-template-columns: 1fr; }
    .dm-field-row { grid-template-columns: 1fr; }
    .dm-actions   { flex-direction: column-reverse; align-items: stretch; }
    .dm-btn-primary,
    .dm-btn-secondary { justify-content: center; }
    .dm-progress-label { max-width: 56px; }
    .dm-screens-indicator { gap: .35rem; }
    .dm-screen-dot-label  { display: none; }
}

/* ── Indicateur de sous-étapes (écrans) ─────────────────────────────────── */
.dm-screens-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin-bottom: 1.75rem;
    flex-wrap: nowrap;
    overflow-x: auto;
}
.dm-screen-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
}
.dm-screen-dot-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    font-size: .8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, color .2s;
    flex-shrink: 0;
}
.dm-screen-dot.is-active .dm-screen-dot-num {
    background: var(--p-orange, #fd7200);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(253,114,0,.2);
}
.dm-screen-dot.is-complete .dm-screen-dot-num {
    background: #10b981;
    color: #fff;
}
.dm-screen-dot-label {
    font-size: .7rem;
    color: #9ca3af;
    white-space: nowrap;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dm-screen-dot.is-active .dm-screen-dot-label  { color: var(--p-orange, #fd7200); font-weight: 600; }
.dm-screen-dot.is-complete .dm-screen-dot-label { color: #10b981; }
.dm-screen-dot-line {
    flex: 1;
    min-width: 20px;
    max-width: 60px;
    height: 2px;
    background: #e5e7eb;
    border-radius: 1px;
    margin-bottom: 1rem;
}
.dm-input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239,68,68,.15) !important;
}

/* =============================================
   DEMARCHE — Bandeau macro-étapes (full-width, sous le header)
   ============================================= */

.dm-banner {
    background: white;
    border-bottom: 1px solid var(--p-border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: sticky;
    top: var(--portal-header-h, 52px);
    z-index: 90;
}

.dm-banner-inner {
    margin-left: 8%;
    margin-right: 8%;
}

/* Ligne des 3 macro-étapes */
.dm-banner-steps {
    display: flex;
    align-items: stretch;
}

/* Séparateur chevron */
.dm-banner-sep {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    color: #d1d5db;
    padding: 0 0.25rem;
}

/* Chaque macro-étape */
.dm-banner-step {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1.1rem 1.25rem;
    text-decoration: none;
    cursor: default;
    transition: background 0.15s;
    min-width: 0;
    font-family: 'Inter', sans-serif;
}

.dm-banner-step--link {
    cursor: pointer;
}
.dm-banner-step--link:hover {
    background: #f9fafb;
}

/* Numéro / icône */
.dm-banner-step-num {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    border: 2px solid #e5e7eb;
    background: white;
    color: #9ca3af;
    transition: all 0.2s;
}

.dm-banner-step--active .dm-banner-step-num {
    background: var(--p-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 3px 12px rgba(253,114,0,0.3);
}
.dm-banner-step--complete .dm-banner-step-num {
    background: #ecfdf5;
    border-color: #10b981;
    color: #10b981;
}
.dm-banner-step--locked .dm-banner-step-num {
    background: #f9fafb;
    border-color: #e5e7eb;
    color: #d1d5db;
}

/* Texte */
.dm-banner-step-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}
.dm-banner-step-text strong {
    font-size: 0.9rem;
    font-weight: 600;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.dm-banner-step-text span {
    font-size: 0.72rem;
    color: #c4c9d4;
    display: block;
}

.dm-banner-step--active .dm-banner-step-text strong  { color: var(--p-text); }
.dm-banner-step--active .dm-banner-step-text span    { color: var(--p-muted); }
.dm-banner-step--complete .dm-banner-step-text strong { color: #374151; }
.dm-banner-step--complete .dm-banner-step-text span   { color: #10b981; }

/* Navigation secondaire — écrans formulaire (full-width) */
.dm-banner-sub {
    border-top: 1px solid var(--p-border);
    background: #fafafa;
}

.dm-banner-sub-inner {
    margin-left: 8%;
    margin-right: 8%;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    padding: 0.55rem 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
}

.dm-sub-step {
    color: #9ca3af;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    cursor: default;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.dm-sub-step.is-active {
    background: var(--p-orange-lt);
    color: var(--p-orange);
    font-weight: 600;
}
.dm-sub-step.is-complete {
    color: #6b7280;
}
.dm-sub-step.is-clickable {
    cursor: pointer;
}
.dm-sub-step.is-clickable:hover {
    background: #f0f0f0;
    color: var(--p-text);
}
.dm-sub-step.is-complete.is-clickable:hover {
    background: #ecfdf5;
    color: #059669;
}

.dm-sub-sep {
    color: #d1d5db;
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}

/* =============================================
   DEMARCHE — Écran d'intro
   ============================================= */

.dm-intro-screen {
    background: linear-gradient(160deg, #fff8f0 0%, #fff3e6 100%);
    min-height: calc(100vh - var(--portal-header-h, 52px));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8%;
    box-sizing: border-box;
}

.dm-intro-inner {
    max-width: 640px;
    text-align: center;
}

.dm-intro-eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--p-orange);
    margin: 0 0 1rem;
}

.dm-intro-title {
    font-family: 'PT Serif', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--p-text);
    line-height: 1.2;
    margin: 0 0 1.25rem;
}

.dm-intro-desc {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--p-muted);
    line-height: 1.7;
    margin: 0 0 2.5rem;
}

.dm-intro-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #fcb045 0%, #fd1d1d 50%, #833ab4 100%);
    color: white;
    border: none;
    border-radius: 100px;
    padding: 0.85rem 2rem;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 4px 20px rgba(253,114,0,0.3);
}

.dm-intro-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* =============================================
   DEMARCHE — Formulaire 2 colonnes
   ============================================= */

.dm-form-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    align-items: start;
}

/* dm-step sans padding vertical quand formulaire 2 colonnes */
.dm-step:has(.dm-form-layout) {
    padding-top: 0;
    padding-bottom: 0;
}

/* Colonne gauche — titre + description, vraiment statique */
.dm-form-intro {
    position: sticky;
    top: 0;           /* colle au sommet du viewport */
    height: 100vh;    /* occupe toujours exactement la hauteur écran */
    background: linear-gradient(160deg, #fff8f0 0%, #fff3e6 100%);
    border-right: 1px solid #fcd9b1;
    box-sizing: border-box;
    /* Pousse le contenu sous le header + bandeau */
    padding-top: 2rem;
    padding-right: 2.5rem;
    padding-bottom: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: visible;
    /* Passe sous le header (z-index 100) et le bandeau (z-index 90) */
    z-index: 1;
}

/* Bleed du fond crème jusqu'au bord gauche du viewport */
.dm-form-intro::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 100%;
    width: 100vw;
    background: #fff8f0;
    z-index: -1;
}

/* Colonne droite — formulaire, scroll normal */
.dm-form-body {
    padding: 2rem 0 2rem 2.5rem;
}

.dm-form-intro .dm-step-title {
    font-family: 'PT Serif', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--p-text);
    line-height: 1.25;
    margin: 0 0 1rem;
}

.dm-form-intro .dm-step-desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--p-muted);
    line-height: 1.65;
    margin: 0;
}

/* =============================================
   DEMARCHE — Responsive bandeau
   ============================================= */

@media (max-width: 900px) {
    .dm-form-layout {
        grid-template-columns: 1fr;
    }
    .dm-form-intro {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #fcd9b1;
        padding: 1.5rem 0;
        overflow: hidden;
    }
    .dm-form-intro::before {
        display: none;
    }
    .dm-form-intro .dm-step-title {
        font-size: 1.3rem;
    }
    .dm-form-body {
        padding: 1.5rem 0 1.5rem 0;
    }
}

@media (max-width: 768px) {
    .dm-banner-inner {
        margin-left: 4%;
        margin-right: 4%;
    }
    .dm-banner-steps {
        gap: 0;
    }
    .dm-banner-sep {
        display: none;
    }
    .dm-banner-step {
        padding: 0.75rem 0.5rem;
        gap: 0.5rem;
    }
    .dm-banner-step-num {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    .dm-banner-step-text strong { font-size: 0.78rem; }
    .dm-banner-step-text span   { display: none; }
    .dm-banner-step--locked     { opacity: 0.4; }
    .dm-banner-sub-inner {
        margin-left: 4%;
        margin-right: 4%;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 0.5rem 0;
    }
    .dm-sub-sep { display: none; }
}
