/*
 * Tunnel de création de site, repris de ShyrkaParamFront (Design System
 * Shyrka : Button / Medium, Input / Field, cartes, Switch). Breakpoints du
 * thème React : sm = 600 px, lg = 1300 px.
 */

.sc-root {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    isolation: isolate;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #000000;
    text-align: left;
}

.sc-root *,
.sc-dialog * {
    box-sizing: border-box;
}

.sc-root h1, .sc-root h2, .sc-root h3, .sc-root p,
.sc-dialog h1, .sc-dialog h2, .sc-dialog p {
    margin: 0;
}

.sc-root label {
    margin: 0;
}

/* ─── Fond ──────────────────────────────────────────────────────────────── */

/* Pas de z-index ici : il isolerait le fond et désactiverait les modes de fusion. */
.sc-bg {
    position: absolute;
    inset: 0;
    background: #ffffff;
    isolation: isolate;
    pointer-events: none;
}

.sc-bg img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    mix-blend-mode: luminosity;
}

.sc-bg-screen {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.4);
    mix-blend-mode: screen;
}

.sc-bg-soft {
    position: absolute;
    inset: 0;
    background: #EBF6FF;
    mix-blend-mode: soft-light;
}

.sc-decor {
    display: none;
    pointer-events: none;
}

.sc-watermark {
    position: absolute;
    left: 15.8vw;
    top: 80%;
    font-size: 27.8vw;
    font-weight: 700;
    line-height: 34px;
    letter-spacing: -0.4px;
    color: #000000;
    opacity: 0.05;
    white-space: nowrap;
}

.sc-decor-cloud {
    position: absolute;
    left: 62.1vw;
    top: 7.2%;
    width: 37.3vw;
    aspect-ratio: 537 / 359;
    object-fit: cover;
    mix-blend-mode: screen;
}

.sc-decor-building {
    position: absolute;
    left: -0.2vw;
    bottom: 0;
    width: 30.5vw;
    height: 33.5%;
    object-fit: cover;
    object-position: center bottom;
}

/* ─── En-tête ───────────────────────────────────────────────────────────── */

.sc-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 20px 0 20px;
}

.sc-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.sc-brand-logo {
    width: 112px;
    aspect-ratio: 148 / 53;
    overflow: hidden;
    flex-shrink: 0;
}

.sc-brand-logo img {
    display: block;
    width: 109.46%;
    height: 100%;
    object-fit: fill;
}

.sc-brand-sep {
    width: 1px;
    height: 29px;
    background: #000000;
}

.sc-brand-name {
    font-size: 22px;
    font-weight: 600;
    line-height: 34px;
    letter-spacing: -0.4px;
    color: #000000;
}

.sc-header-stepper {
    display: none;
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    height: 53px;
    align-items: center;
}

.sc-header-spacer {
    flex: 1;
}

.sc-main {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ─── Stepper ───────────────────────────────────────────────────────────── */

.sc-stepper {
    display: flex;
    align-items: center;
}

.sc-stepper ol {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Étapes terminées et en cours regroupées dans une même capsule noire. */
.sc-stepper ol.sc-stepper-reached {
    background: #000000;
    border-radius: 999px;
    padding-right: 4px;
}

.sc-step {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 12px;
    white-space: nowrap;
}

.sc-step-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 18px;
    color: #000000;
}

.sc-step.is-done .sc-step-dot {
    background: #CFF7D3;
    color: #14AE5C;
}

.sc-step-label {
    font-size: 13px;
    font-weight: 500;
    line-height: 18px;
    color: #000000;
}

.sc-step.is-reached .sc-step-label {
    color: #ffffff;
}

/* ─── Typographie ───────────────────────────────────────────────────────── */

.sc-heading {
    font-size: 22px;
    font-weight: 600;
    line-height: 34px;
    letter-spacing: -0.4px;
    color: #000000;
}

.sc-center {
    text-align: center;
}

.sc-card-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    color: #000000;
}

.sc-label {
    font-size: 16px;
    line-height: 1.4;
    color: #000000;
}

.sc-caption {
    font-size: 13px;
    line-height: 20px;
    color: #757575;
}

.sc-caption-dark {
    font-size: 13px;
    line-height: 20px;
    color: #4F4F4F;
}

.sc-error-text {
    margin-top: 8px;
    font-size: 13px;
    line-height: 20px;
    color: #FF5630;
}

.sc-text-error {
    color: #FF5630 !important;
}

/* ─── Boutons ───────────────────────────────────────────────────────────── */

.sc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
    box-shadow: none;
    min-width: 0;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1), border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.sc-btn:disabled {
    cursor: default;
    pointer-events: none;
    opacity: 0.38;
}

.sc-btn-primary {
    color: #F5F5F5;
    background: #000000;
    border-color: #000000;
}

.sc-btn-primary:hover {
    background: #1E1E1E;
}

.sc-btn-outlined {
    color: #1E1E1E;
    background: #ffffff;
    border-color: #767676;
}

.sc-btn-outlined:hover {
    background: #F5F5F5;
    border-color: #1E1E1E;
}

.sc-btn-subtle {
    color: #303030;
    background: transparent;
}

.sc-btn-subtle:hover {
    background: rgba(0, 0, 0, 0.06);
}

.sc-btn-previous {
    color: #000000;
    background: #F2F2F2;
    border-color: #000000;
}

.sc-btn-previous:hover {
    background: #E6E6E6;
}

.sc-btn-text {
    padding: 4px 5px;
    font-size: 0.8125rem;
    font-weight: 700;
    color: inherit;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
}

.sc-btn-text:hover {
    background: rgba(0, 0, 0, 0.06);
}

.sc-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
}

/* ─── Champs ────────────────────────────────────────────────────────────── */

.sc-field {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.sc-input {
    width: 100%;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.4375em;
    color: #1C252E;
    background: #ffffff;
    border: 1px solid #D9D9D9;
    border-radius: 8px;
    outline: none;
    transition: border-color 150ms ease;
}

.sc-input::placeholder {
    color: #919EAB;
    opacity: 1;
}

.sc-input:hover {
    border-color: #767676;
}

.sc-input:focus {
    border-color: #000000;
}

.sc-input.is-error,
.sc-input.is-error:hover,
.sc-input.is-error:focus {
    border-color: #FF5630;
}

.sc-helper {
    margin-top: -4px;
    font-size: 12px;
    line-height: 1.5;
    color: #FF5630;
}

.sc-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    width: 100%;
}

.sc-row-filler {
    flex: 1;
    display: none;
}

/* ─── Mise en page des étapes ───────────────────────────────────────────── */

.sc-form {
    width: calc(100% - 40px);
    max-width: 880px;
    margin: 0 auto;
    padding-top: 24px;
    padding-bottom: 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sc-form.is-tight {
    gap: 16px;
}

.sc-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid #000000;
    border-radius: 14px;
}

.sc-section.is-60 {
    background: rgba(255, 255, 255, 0.6);
}

.sc-section.is-70 {
    background: rgba(255, 255, 255, 0.7);
}

.sc-section.gap-12 {
    gap: 12px;
}

.sc-section.is-locked {
    background: #F5F5F5;
    border-color: #D9D9D9;
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.sc-grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.sc-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.sc-grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

/* Carte à choisir (offre, worker, groupe) */
.sc-choice {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    text-align: left;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border-radius: 14px;
    border: 1px solid #E7ECF2;
    background: rgba(255, 255, 255, 0.6);
    color: #000000;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.sc-choice:hover {
    border-color: #000000;
}

/* 1 px de padding en moins quand la bordure passe à 2 px : la carte ne bouge pas. */
.sc-choice.is-selected {
    padding: 19px;
    border: 2px solid #000000;
    background: #000000;
    color: #ffffff;
}

.sc-choice-head {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.sc-choice-title {
    flex: 1;
    min-width: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    color: inherit;
}

.sc-choice-desc {
    font-size: 13px;
    line-height: 20px;
    color: #343348;
}

.sc-choice.is-selected .sc-choice-desc {
    color: #ffffff;
}

.sc-choice-icon {
    display: block;
    flex-shrink: 0;
}

/* ─── Alertes (MUI Alert « standard ») ──────────────────────────────────── */

.sc-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.57;
    font-weight: 400;
}

.sc-alert-icon {
    display: flex;
    padding: 7px 0;
    flex-shrink: 0;
}

.sc-alert-icon svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.sc-alert-message {
    flex: 1;
    min-width: 0;
    padding: 8px 0;
}

.sc-alert-action {
    display: flex;
    align-items: flex-start;
    padding: 4px 0 0 16px;
    margin-left: auto;
    margin-right: -8px;
}

.sc-alert-info { background: #F2F2F2; color: #1E1E1E; }
.sc-alert-info .sc-alert-icon { color: #4F4F4F; }
.sc-alert-success { background: #E9F9EF; color: #0E4F26; }
.sc-alert-success .sc-alert-icon { color: #22C55E; }
.sc-alert-warning { background: #FFF7E6; color: #664400; }
.sc-alert-warning .sc-alert-icon { color: #FFAB00; }
.sc-alert-error { background: #FFEEEA; color: #662213; }
.sc-alert-error .sc-alert-icon { color: #FF5630; }

/* ─── Chargement ────────────────────────────────────────────────────────── */

.sc-loading {
    display: flex;
    justify-content: center;
    padding: 24px 0;
}

.sc-loading.is-small {
    padding: 16px 0;
}

.sc-spinner {
    width: 32px;
    height: 32px;
    border: 3.6px solid transparent;
    border-top-color: #000000;
    border-right-color: #000000;
    border-radius: 50%;
    animation: sc-spin 1.1s linear infinite;
}

.sc-loading.is-small .sc-spinner {
    width: 28px;
    height: 28px;
}

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

/* ─── Switch du Design System (40 × 24) ─────────────────────────────────── */

.sc-switch {
    position: relative;
    width: 40px;
    height: 24px;
    flex-shrink: 0;
    display: inline-block;
}

.sc-switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: inherit;
    z-index: 1;
}

.sc-switch-track {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #1E1E1E;
    transition: background 150ms ease, border-color 150ms ease;
}

.sc-switch-thumb {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #757575;
    transition: transform 150ms cubic-bezier(0.4, 0, 0.2, 1), background 150ms ease;
}

.sc-switch.is-on .sc-switch-track {
    background: #000000;
    border-color: #000000;
}

.sc-switch.is-on .sc-switch-thumb {
    transform: translateX(16px);
    background: #ffffff;
}

.sc-switch.is-disabled .sc-switch-track {
    background: #D9D9D9;
    border-color: #D9D9D9;
}

.sc-switch.is-disabled .sc-switch-thumb {
    background: #B3B3B3;
}

/* ─── Case à cocher ─────────────────────────────────────────────────────── */

.sc-checkbox {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    color: #757575;
}

.sc-checkbox input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.sc-checkbox svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.sc-checkbox.is-large svg {
    width: 22px;
    height: 22px;
}

.sc-checkbox.is-checked {
    color: #000000;
}

/* ─── Pastilles et filtres ──────────────────────────────────────────────── */

.sc-pill {
    padding: 6px 12px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.5;
    cursor: pointer;
    border: 1px solid #757575;
    background: #ffffff;
    color: #1E1E1E;
}

.sc-pill.is-active {
    background: #000000;
    color: #ffffff;
}

.sc-pill:disabled {
    cursor: default;
    border-color: #D9D9D9;
    color: #B3B3B3;
    background: #ffffff;
}

.sc-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sc-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
}

.sc-sev-bloquant { color: #EC221F; background: #FDD3D0; }
.sc-sev-avertissement { color: #9A6700; background: #FFF1C2; }
.sc-sev-info { color: #4F4F4F; background: #F2F2F2; }

/* ─── Écrans larges ─────────────────────────────────────────────────────── */

@media (min-width: 600px) {
    .sc-brand-logo { width: 148px; }
    .sc-brand-name { font-size: 26px; }
    .sc-heading { font-size: 26px; }
    .sc-section { padding: 24px; }
    .sc-row { flex-direction: row; align-items: flex-start; }
    .sc-row.is-stretch { align-items: stretch; }
    .sc-row-filler { display: block; }
    .sc-grid-2 { grid-template-columns: repeat(2, 1fr); }
    .sc-grid-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1300px) {
    .sc-decor { display: block; }
    .sc-header { padding: 33px 4.44vw 0 2.85vw; }
    .sc-header-stepper { display: flex; }
    .sc-form { padding-top: 67px; }
}

/* ─── Fenêtre de progression (« Givre pop up ») ─────────────────────────── */

.sc-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    animation: sc-fade-in 225ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes sc-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Deux fonds noirs à 20 % superposés, bordure blanche de 1 px, flou
   d'arrière-plan et ombre portée X5 Y6, flou 4.3, noir à 25 %. */
.sc-dialog {
    width: 520px;
    max-width: calc(100% - 32px);
    max-height: calc(100% - 64px);
    overflow-y: auto;
    margin: 16px;
    border-radius: 16px;
    border: 1px solid #FFFFFF;
    background: rgba(0, 0, 0, 0.2);
    background-image: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2));
    backdrop-filter: blur(33px);
    -webkit-backdrop-filter: blur(33px);
    box-shadow: 5px 6px 4.3px 0 rgba(0, 0, 0, 0.25);
    color: #ffffff;
}

.sc-dialog-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 26px 28px 18px;
}

.sc-dialog-badge {
    width: 44px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 8px;
    border: 1px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 18px;
}

.sc-dialog-titles {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sc-dialog-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
}

.sc-dialog-file {
    font-size: 13px;
    line-height: 20px;
    opacity: 0.72;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-dialog-percent {
    font-size: 20px;
    font-weight: 600;
    line-height: 28px;
    letter-spacing: -0.2px;
}

.sc-dialog-progress {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 28px 4px;
}

.sc-dialog-bar {
    height: 6px;
    border-radius: 999px;
    background: #000000;
    overflow: hidden;
}

.sc-dialog-bar > div {
    height: 100%;
    border-radius: 999px;
    background: #ffffff;
    transition: width 0.3s ease;
}

.sc-dialog-status {
    font-size: 13px;
    line-height: 20px;
    opacity: 0.72;
}

.sc-dialog-phases {
    list-style: none;
    margin: 0;
    padding: 8px 28px 0;
}

.sc-dialog-phases li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.sc-phase-dot {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid #ffffff;
}

.sc-phase-dot.is-running {
    border-width: 2.5px;
}

.sc-phase-dot.is-done {
    border: none;
    background: #CFF7D3;
    color: #009951;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sc-phase-label {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    line-height: 20px;
    opacity: 0.64;
}

.sc-phase-label.is-done {
    opacity: 0.72;
}

.sc-phase-label.is-running {
    font-size: 14px;
    font-weight: 500;
    line-height: 22px;
    opacity: 1;
}

.sc-phase-running {
    font-size: 12px;
    line-height: 18px;
    opacity: 0.72;
}

.sc-dialog-foot {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 28px 24px;
}

.sc-dialog-foot-text {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    line-height: 18px;
    opacity: 0.68;
}

.sc-dialog-abort {
    flex-shrink: 0;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #ffffff;
    background: transparent;
    color: #ffffff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}

.sc-dialog-abort:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* ─── Tableaux de la liste de points ────────────────────────────────────── */

.sc-tables {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sc-table-container {
    max-height: 420px;
    overflow: auto;
    border: 1px solid #E7ECF2;
    border-radius: 8px;
    background: #ffffff;
}

.sc-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.sc-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5rem;
    color: #757575;
    background: #F5F5F5;
    text-align: left;
    border-bottom: 1px dashed rgba(145, 158, 171, 0.2);
    white-space: nowrap;
}

.sc-table td {
    padding: 6px 16px;
    font-size: 13px;
    line-height: 1.43;
    color: #1E1E1E;
    border-bottom: 1px dashed rgba(145, 158, 171, 0.2);
}

.sc-table tbody tr:hover {
    background: rgba(145, 158, 171, 0.08);
}

.sc-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px 16px;
    font-size: 14px;
    line-height: 1.57;
    color: #1C252E;
}

.sc-pagination select {
    font-family: inherit;
    font-size: 14px;
    border: none;
    background: transparent;
    padding: 4px 4px;
    cursor: pointer;
}

.sc-pagination-range {
    margin-left: 16px;
}

.sc-page-btn {
    display: inline-flex;
    padding: 8px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #637381;
    cursor: pointer;
}

.sc-page-btn:hover {
    background: rgba(99, 115, 129, 0.08);
}

.sc-page-btn:disabled {
    color: rgba(145, 158, 171, 0.8);
    cursor: default;
    background: transparent;
}
