/* ============================================================
   Contact Builder Widget — Aratice
   ============================================================ */

.acb {
    --acb-blue: #163C79;
    --acb-blue-dark: #0F2A5A;
    --acb-green: #8FBE3E;
    --acb-green-soft: #F4F8EC;
    --acb-bg: #F4F6F9;
    --acb-bg-input: #F4F6F9;
    --acb-card: #FFFFFF;
    --acb-text: #2C3E5C;
    --acb-text-muted: #5A6573;
    --acb-text-soft: #8A95A3;
    --acb-border: #E4E7EC;
    --acb-shadow: 0 12px 40px rgba(22, 60, 121, 0.08);
    --acb-radius: 16px;
    --acb-radius-sm: 10px;

    color: var(--acb-text);
    font-family: inherit;
    line-height: 1.5;
}

.acb *,
.acb *::before,
.acb *::after {
    box-sizing: border-box;
}

.acb__view {
    display: none;
}

.acb__view.is-active {
    display: block;
}

/* ============================================================
   HUB
   ============================================================ */
.acb__hub-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.acb__eyebrow {
    color: var(--acb-green);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 8px;
}

.acb__hub-title {
    color: var(--acb-blue);
    font-size: 32px;
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
}

.acb__hub-hint {
    color: var(--acb-text-soft);
    font-size: 13px;
    margin: 0;
    max-width: 360px;
    text-align: right;
    line-height: 1.5;
}

.acb__cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.acb__card {
    display: grid;
    grid-template-columns: 64px 1fr 40px;
    align-items: flex-start;
    gap: 20px;
    background: var(--acb-card);
    border: 1px solid var(--acb-border);
    border-radius: var(--acb-radius);
    padding: 24px;
    text-align: left;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, transform .2s;
    font: inherit;
    color: inherit;
}

.acb__card:hover,
.acb__card:focus-visible {
    border-color: var(--acb-blue);
    box-shadow: var(--acb-shadow);
    outline: none;
    transform: translateY(-2px);
}

.acb__card-icon {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    background: #EEF2F8;
    color: var(--acb-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.acb__card-icon svg,
.acb__card-icon i {
    width: 28px;
    height: 28px;
    font-size: 26px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.acb__card-icon i::before {
    line-height: 1;
    display: block;
}

.acb__card-body {
    min-width: 0;
}

.acb__card-title {
    font-size: 19px;
    font-weight: 800;
    color: var(--acb-blue);
    margin: 0 0 4px;
    line-height: 1.25;
}

.acb__card-sub {
    color: #7EAD53;
    font-size: 13px;
    margin: 0 0 12px;
}

.acb__card-desc {
    color: var(--acb-text-muted);
    font-size: 14px;
    line-height: 1.55;
    margin: 0 0 16px;
}

.acb__card-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.acb__card-arrow {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #F4F6F9;
    color: var(--acb-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: start;
    transition: background .2s, color .2s;
    flex-shrink: 0;
}

.acb__card:hover .acb__card-arrow {
    background: var(--acb-blue);
    color: #fff;
}

/* ============================================================
   BADGES
   ============================================================ */
.acb__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.acb__badge--delay {
    background: #EEF2F8;
    color: var(--acb-blue);
}

.acb__badge--delay .acb__badge-icon {
    color: var(--acb-blue);
    flex-shrink: 0;
}

.acb__badge--steps {
    background: var(--acb-green-soft);
    color: #6F9B2E;
}

.acb__badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--acb-green);
    flex-shrink: 0;
}

/* ============================================================
   5e BLOC
   ============================================================ */
.acb__extra {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--acb-card);
    border: 1px solid var(--acb-border);
    border-radius: var(--acb-radius);
    padding: 20px 24px;
}

.acb__extra-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #F4F6F9;
    color: var(--acb-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.acb__extra-text {
    flex: 1;
    min-width: 0;
}

.acb__extra-title {
    color: var(--acb-blue);
    font-size: 16px;
    font-weight: 800;
    margin: 0 0 2px;
}

.acb__extra-sub {
    color: var(--acb-text-soft);
    font-size: 13px;
    margin: 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.acb__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--acb-radius-sm);
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, color .2s, border-color .2s, transform .1s;
    font-family: inherit;
    line-height: 1.2;
}

.acb__btn--primary {
    background: var(--acb-blue);
    color: #FFFFFF;
}

.acb__btn--primary:hover:not(:disabled),
.acb__btn--primary:focus-visible:not(:disabled) {
    background: var(--acb-blue-dark);
    color: #FFFFFF;
    outline: none;
}

.acb__btn--ghost {
    background: transparent;
    color: var(--acb-text-muted);
    border-color: var(--acb-border);
}

.acb__btn--ghost:hover:not(:disabled) {
    border-color: var(--acb-blue);
    color: var(--acb-blue);
}

.acb__btn:disabled,
.acb__btn[disabled] {
    opacity: .5;
    cursor: not-allowed;
}

/* ============================================================
   FORM VIEW — Top bar
   ============================================================ */
.acb__back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--acb-text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    transition: color .2s;
}

.acb__back:hover {
    color: var(--acb-blue);
}

.acb__selected {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--acb-card);
    border: 1px solid var(--acb-border);
    border-left: 4px solid var(--acb-green);
    border-radius: var(--acb-radius);
    padding: 18px 22px;
    margin-bottom: 16px;
}

.acb__selected-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #EEF2F8;
    color: var(--acb-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.acb__selected-icon svg,
.acb__selected-icon i {
    width: 18px;
    height: 18px;
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.acb__selected-icon i::before {
    line-height: 1;
    display: block;
}

.acb__selected-body {
    flex: 1;
    min-width: 0;
}

.acb__selected-label {
    display: block;
    color: var(--acb-text-soft);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.acb__selected-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    font-size: 15px;
    color: var(--acb-blue);
}

.acb__selected-title-row strong {
    font-weight: 800;
}

.acb__selected-sep {
    color: var(--acb-text-soft);
}

/* Bandeau rassurance progressif */
.acb__reassurance {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--acb-green-soft);
    border: 1px solid #E0EBC9;
    border-radius: 999px;
    padding: 8px 20px 8px 8px;
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--acb-blue);
    font-weight: 600;
}

.acb__steps-dots {
    display: flex;
    gap: 4px;
}

.acb__step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 2px solid #D5E4B0;
    color: var(--acb-text-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.acb__step-dot.is-active {
    background: var(--acb-green);
    border-color: var(--acb-green);
    color: #FFFFFF;
}

.acb__step-dot.is-done {
    background: var(--acb-green);
    border-color: var(--acb-green);
    color: #FFFFFF;
}

/* ============================================================
   FORM GRID (sidebar + panel)
   ============================================================ */
.acb__form-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    align-items: start;
}

/* Sidebar */
.acb__sidebar {
    background: transparent;
    padding: 8px 0;
}

.acb__sidebar-eyebrow {
    display: block;
    color: var(--acb-text-soft);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.acb__sidebar-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 28px;
}

.acb__sidebar-step {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--acb-text-soft);
    transition: color .2s;
}

.acb__sidebar-step.is-active {
    color: var(--acb-blue);
}

.acb__sidebar-step.is-done {
    color: var(--acb-green);
}

.acb__sidebar-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 2px solid currentColor;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.acb__sidebar-step.is-active .acb__sidebar-num {
    background: var(--acb-green);
    border-color: var(--acb-green);
    color: #FFFFFF;
}

.acb__sidebar-step.is-done .acb__sidebar-num {
    background: var(--acb-green);
    border-color: var(--acb-green);
    color: #FFFFFF;
}

.acb__sidebar-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.acb__sidebar-text strong {
    font-weight: 700;
    font-size: 14px;
}

.acb__sidebar-text em {
    font-style: normal;
    font-size: 12px;
    color: var(--acb-text-soft);
    margin-top: 2px;
}

.acb__sidebar-step.is-active .acb__sidebar-text em,
.acb__sidebar-step.is-done .acb__sidebar-text em {
    color: var(--acb-text-soft);
}

.acb__sidebar-reassurance {
    display: grid;
    grid-template-columns: 16px 1fr;
    column-gap: 8px;
    row-gap: 4px;
    padding-top: 18px;
    border-top: 1px solid var(--acb-border);
    font-size: 12px;
    color: var(--acb-text-soft);
    line-height: 1.5;
}

.acb__sidebar-reassurance-icon {
    grid-row: 1 / 3;
    color: var(--acb-green);
    padding-top: 2px;
}

.acb__sidebar-reassurance strong {
    color: var(--acb-text);
    font-weight: 700;
    font-size: 13px;
}

/* Panel */
.acb__panel {
    background: var(--acb-card);
    border: 1px solid var(--acb-border);
    border-radius: var(--acb-radius);
    padding: 32px;
    box-shadow: var(--acb-shadow);
}

.acb__step {
    display: none;
}

.acb__step.is-active {
    display: block;
}

.acb__step-eyebrow {
    display: inline-block;
    color: var(--acb-green);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--acb-border);
    min-width: 140px;
}

.acb__step-title {
    color: var(--acb-blue);
    font-size: 24px;
    font-weight: 800;
    margin: 8px 0 8px;
    line-height: 1.25;
}

.acb__step-sub {
    color: var(--acb-text-muted);
    font-size: 14px;
    margin: 0 0 24px;
}

/* Fields */
.acb__field-block {
    margin-bottom: 20px;
    flex: 1;
    min-width: 0;
}

.acb__field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.acb__field-label {
    display: block;
    color: var(--acb-blue);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.acb__field-hint {
    color: var(--acb-text-soft);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    font-size: 12px;
    margin-left: 4px;
}

.acb__field-help {
    color: var(--acb-text-soft);
    font-size: 13px;
    margin: -4px 0 8px;
}

.acb__required {
    color: #C0392B;
}

.acb .acb__input,
.acb input.acb__input[type="text"],
.acb input.acb__input[type="email"],
.acb input.acb__input[type="tel"],
.acb input.acb__input[type="url"],
.acb input.acb__input[type="number"],
.acb .acb__textarea {
    width: 100%;
    height: auto;
    min-height: 0;
    background: var(--acb-bg-input);
    border: 1px solid transparent;
    border-radius: var(--acb-radius-sm);
    padding: 12px 14px;
    margin: 0;
    font-size: 14px;
    color: var(--acb-text);
    font-family: inherit;
    line-height: 1.5;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: background .2s, border-color .2s, box-shadow .2s;
    box-sizing: border-box;
}

.acb .acb__input:focus,
.acb input.acb__input[type="text"]:focus,
.acb input.acb__input[type="email"]:focus,
.acb input.acb__input[type="tel"]:focus,
.acb .acb__textarea:focus {
    background: #FFFFFF;
    border-color: var(--acb-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(22, 60, 121, .12);
}

.acb__textarea {
    resize: vertical;
    min-height: 100px;
}

.acb__char-counter {
    text-align: right;
    color: var(--acb-text-soft);
    font-size: 12px;
    margin-top: 4px;
}

/* Checkboxes en grille 2 colonnes */
.acb__options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.acb__option {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--acb-bg-input);
    border: 1px solid transparent;
    border-radius: var(--acb-radius-sm);
    padding: 12px 14px;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}

.acb__option:hover {
    border-color: var(--acb-border);
}

.acb__option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid #C9D1DC;
    background: #FFFFFF;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: border-color .15s, background .15s;
}

.acb__option input[type="checkbox"]:checked {
    background: var(--acb-blue);
    border-color: var(--acb-blue);
}

.acb__option input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0;
    width: 5px;
    height: 10px;
    border: solid #FFFFFF;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.acb__option:has(input:checked) {
    background: #EEF2F8;
    border-color: var(--acb-blue);
}

.acb__option-label {
    font-size: 14px;
    color: var(--acb-text);
    flex: 1;
    min-width: 0;
}

/* Step actions */
.acb__step-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 24px;
    margin-top: 24px;
    border-top: 1px solid var(--acb-border);
}

.acb__step-actions .acb__btn--ghost {
    margin-right: auto;
}

/* Recap (step 3) */
.acb__recap {
    background: #F8F9FB;
    border: 1px solid var(--acb-border);
    border-radius: var(--acb-radius-sm);
    padding: 18px 20px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
}

.acb__recap-row {
    display: flex;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--acb-border);
}

.acb__recap-row:last-child {
    border-bottom: none;
}

.acb__recap-label {
    color: var(--acb-text-soft);
    font-weight: 600;
    min-width: 130px;
    flex-shrink: 0;
}

.acb__recap-value {
    color: var(--acb-text);
    flex: 1;
}

/* RGPD */
.acb__rgpd {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #F8F9FB;
    border: 1px solid var(--acb-border);
    border-radius: var(--acb-radius-sm);
    padding: 14px 16px;
    cursor: pointer;
    font-size: 13px;
    color: var(--acb-text-muted);
    line-height: 1.5;
}

.acb__rgpd input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid #C9D1DC;
    background: #FFFFFF;
    margin: 0;
    margin-top: 1px;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
}

.acb__rgpd input[type="checkbox"]:checked {
    background: var(--acb-blue);
    border-color: var(--acb-blue);
}

.acb__rgpd input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0;
    width: 5px;
    height: 10px;
    border: solid #FFFFFF;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Feedback */
.acb__feedback {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: var(--acb-radius-sm);
    font-size: 14px;
}

.acb__feedback.is-error {
    background: #FDECEA;
    color: #B32D2E;
    border: 1px solid #F5C2C2;
}

.acb__feedback.is-success {
    background: #E8F6EC;
    color: #1E7E34;
    border: 1px solid #B4DDB9;
}

/* ============================================================
   SUCCESS
   ============================================================ */
.acb__success {
    background: var(--acb-card);
    border: 1px solid var(--acb-border);
    border-radius: var(--acb-radius);
    padding: 60px 32px;
    text-align: center;
    box-shadow: var(--acb-shadow);
}

.acb__success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--acb-green-soft);
    color: var(--acb-green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.acb__success-title {
    color: var(--acb-blue);
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 12px;
}

.acb__success-message {
    color: var(--acb-text-muted);
    font-size: 15px;
    max-width: 480px;
    margin: 0 auto 24px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
    .acb__cards {
        grid-template-columns: 1fr;
    }

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

    .acb__sidebar {
        order: 2;
    }

    .acb__panel {
        order: 1;
    }

    .acb__hub-hint {
        text-align: left;
        max-width: none;
    }
}

@media (max-width: 640px) {
    .acb__hub-title {
        font-size: 24px;
    }

    .acb__step-title {
        font-size: 20px;
    }

    .acb__panel {
        padding: 20px;
    }

    .acb__card {
        grid-template-columns: 48px 1fr;
        gap: 14px;
        padding: 18px;
    }

    .acb__card-icon {
        width: 48px;
        height: 48px;
    }

    .acb__card-arrow {
        display: none;
    }

    .acb__options,
    .acb__field-row {
        grid-template-columns: 1fr;
    }

    .acb__extra {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .acb__extra .acb__btn {
        align-self: stretch;
        justify-content: center;
    }

    .acb__selected {
        flex-wrap: wrap;
    }

    .acb__step-actions {
        flex-wrap: wrap;
    }

    .acb__step-actions .acb__btn {
        flex: 1;
        justify-content: center;
    }
}