/* =========================================================
   MON CARNET GOURMAND
   V1.4.0.2.2 — SYNCHRONISATION INGRÉDIENTS / ÉTAPES
   ========================================================= */

body.is-recipe-step-sync-open {
    overflow: hidden;
}

.recipe-step-sync-modal[hidden] {
    display: none;
}

.recipe-step-sync-modal {
    position: fixed;
    z-index: 5300;
    inset: 0;
    padding:
        max(16px, env(safe-area-inset-top))
        16px
        max(16px, env(safe-area-inset-bottom));
    display: grid;
    place-items: center;
}

.recipe-step-sync-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(52, 34, 25, 0.58);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 180ms ease;
}

.recipe-step-sync-dialog {
    width: min(100%, 470px);
    max-height: calc(
        100dvh -
        max(32px, env(safe-area-inset-top)) -
        max(32px, env(safe-area-inset-bottom))
    );
    padding: 24px 20px 20px;
    position: relative;
    z-index: 1;
    overflow-y: auto;
    border: 1px solid rgba(125, 146, 112, 0.2);
    border-radius: 28px;
    background:
        linear-gradient(
            150deg,
            rgba(255, 253, 249, 0.99),
            rgba(239, 245, 235, 0.98)
        );
    box-shadow:
        0 26px 70px
        rgba(44, 27, 18, 0.3);
    text-align: center;
    opacity: 0;
    transform:
        translateY(18px)
        scale(0.97);
    transition:
        opacity 180ms ease,
        transform 180ms ease;
}

.recipe-step-sync-modal.is-open
.recipe-step-sync-backdrop {
    opacity: 1;
}

.recipe-step-sync-modal.is-open
.recipe-step-sync-dialog {
    opacity: 1;
    transform:
        translateY(0)
        scale(1);
}

.recipe-step-sync-close {
    width: 38px;
    height: 38px;
    position: absolute;
    top: 12px;
    right: 12px;
    border: 1px solid rgba(111, 64, 44, 0.1);
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--color-brown-dark);
    background: rgba(255, 255, 255, 0.82);
    font-size: 23px;
    line-height: 1;
}

.recipe-step-sync-icon {
    width: 70px;
    height: 70px;
    margin: 2px auto 16px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    background:
        linear-gradient(
            135deg,
            var(--color-green-soft),
            rgba(255, 255, 255, 0.95)
        );
    box-shadow:
        inset 0 0 0 1px
        rgba(125, 146, 112, 0.12);
    font-size: 31px;
}

.recipe-step-sync-dialog h2 {
    margin-top: 7px;
    color: var(--color-brown-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 26px;
    line-height: 1.15;
}

.recipe-step-sync-description {
    margin-top: 11px;
    color: var(--color-text-soft);
    font-size: 12px;
    line-height: 1.65;
}

.recipe-step-sync-change {
    margin-top: 17px;
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        26px
        minmax(0, 1fr);
    align-items: stretch;
    gap: 8px;
}

.recipe-step-sync-change > div {
    min-width: 0;
    padding: 11px 10px;
    border: 1px solid rgba(111, 64, 44, 0.09);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.78);
    text-align: left;
}

.recipe-step-sync-change > span {
    display: grid;
    place-items: center;
    color: var(--color-terracotta-dark);
    font-size: 18px;
    font-weight: 900;
}

.recipe-step-sync-change small {
    display: block;
    color: var(--color-text-soft);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.recipe-step-sync-change strong {
    margin-top: 5px;
    display: block;
    overflow-wrap: anywhere;
    color: var(--color-brown-dark);
    font-size: 12px;
    line-height: 1.45;
}

.recipe-step-sync-steps {
    margin-top: 15px;
    display: grid;
    gap: 10px;
    text-align: left;
}

.recipe-step-sync-preview {
    padding: 12px;
    border: 1px solid rgba(111, 64, 44, 0.1);
    border-radius: 16px;
    background: rgba(255, 250, 242, 0.82);
}

.recipe-step-sync-preview > strong {
    color: var(--color-terracotta-dark);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.recipe-step-sync-preview p {
    margin-top: 7px;
    font-size: 11px;
    line-height: 1.55;
}

.recipe-step-sync-old-step {
    color: var(--color-text-soft);
}

.recipe-step-sync-new-step {
    padding: 9px 10px;
    border-radius: 11px;
    color: var(--color-brown-dark);
    background: rgba(232, 238, 227, 0.88);
    font-weight: 750;
}

.recipe-step-sync-help {
    margin-top: 14px;
    color: var(--color-text-soft);
    font-size: 10px;
    font-weight: 700;
}

.recipe-step-sync-actions {
    margin-top: 18px;
    display: grid;
    gap: 10px;
}

.recipe-step-sync-keep,
.recipe-step-sync-update {
    width: 100%;
    min-height: 62px;
    padding: 10px 13px;
    border-radius: 17px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    text-align: left;
}

.recipe-step-sync-keep {
    border: 1px solid rgba(111, 64, 44, 0.12);
    color: var(--color-brown-dark);
    background: rgba(255, 255, 255, 0.84);
}

.recipe-step-sync-update {
    border: 0;
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            var(--color-terracotta),
            var(--color-brown)
        );
    box-shadow:
        0 11px 25px
        rgba(126, 70, 45, 0.22);
}

.recipe-step-sync-keep > span:first-child,
.recipe-step-sync-update > span:first-child {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.55);
    font-size: 18px;
}

.recipe-step-sync-update > span:first-child {
    background: rgba(255, 255, 255, 0.16);
}

.recipe-step-sync-keep strong,
.recipe-step-sync-update strong {
    display: block;
    font-size: 12px;
}

.recipe-step-sync-keep small,
.recipe-step-sync-update small {
    margin-top: 3px;
    display: block;
    font-size: 9px;
    line-height: 1.4;
}

.recipe-step-sync-keep small {
    color: var(--color-text-soft);
}

.recipe-step-sync-update small {
    color: rgba(255, 255, 255, 0.78);
}

@media (max-width: 390px) {
    .recipe-step-sync-modal {
        padding-right: 11px;
        padding-left: 11px;
    }

    .recipe-step-sync-dialog {
        padding:
            22px
            16px
            17px;
        border-radius: 24px;
    }

    .recipe-step-sync-change {
        grid-template-columns: 1fr;
    }

    .recipe-step-sync-change > span {
        transform: rotate(90deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .recipe-step-sync-backdrop,
    .recipe-step-sync-dialog {
        transition: none;
    }
}
