/* ==========================================
   MAGAZINE CHIC — FORMULAIRE DE CONTACT
   ========================================== */

.mcc-contact {
    --mcc-ink: #263d4a;
    --mcc-muted: #47616e;
    --mcc-accent: #355c6d;
    --mcc-radius: 12px;

    box-sizing: border-box;
    width: 100%;
    max-width: 820px;
    margin: 28px auto;
    padding: clamp(24px, 5vw, 46px);

    color: var(--mcc-ink);
    font-family: inherit;

    background:
        linear-gradient(
            115deg,
            transparent 15%,
            rgba(255, 255, 255, .72) 42%,
            rgba(255, 255, 255, .12) 55%,
            transparent 76%
        ),
        linear-gradient(
            125deg,
            #a9c4cb 0%,
            #f2f7f5 35%,
            #c7dce0 68%,
            #8eabb5 100%
        );

    border: 1px solid rgba(89, 128, 143, .48);
    border-radius: 18px;

    box-shadow:
        7px 8px 14px rgba(35, 32, 38, .18),
        0 20px 45px rgba(38, 61, 74, .08),
        inset 0 1px 0 rgba(255, 255, 255, .9);
}

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

/* Mise en page */

.mcc-contact .mcc-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 26px 22px;
    margin: 0;
    padding: 0;
}

.mcc-contact .mcc-form > * {
    grid-column: 1 / -1;
    min-width: 0;
}

/* Nom et email sur la même ligne */
.mcc-contact .mcc-form > p.mcc-field:first-of-type {
    grid-column: 1;
}

.mcc-contact .mcc-form > p.mcc-field:nth-of-type(2) {
    grid-column: 2;
}

.mcc-contact .mcc-field {
    margin: 0;
    padding: 0;
    border: 0;
}

/* Libellés */

.mcc-contact .mcc-field > label {
    display: block;
    margin: 0 0 10px;
    padding: 0;

    color: var(--mcc-ink);
    font-size: 14px;
    font-weight: 650;
    line-height: 1.5;
    letter-spacing: .025em;
}

.mcc-contact label > span[aria-hidden="true"] {
    color: var(--mcc-accent);
}

/* Champs */

.mcc-contact .mcc-field input[type="text"],
.mcc-contact .mcc-field input[type="email"],
.mcc-contact .mcc-field textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 15px 17px;

    appearance: none;
    color: var(--mcc-ink);
    caret-color: var(--mcc-accent);
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, .96),
            rgba(247, 251, 251, .82)
        );

    border: 1px solid rgba(89, 128, 143, .48);
    border-radius: var(--mcc-radius);

    box-shadow:
        inset 0 2px 4px rgba(38, 61, 74, .04),
        0 3px 7px rgba(38, 61, 74, .035);

    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        background-color .2s ease;
}

.mcc-contact .mcc-field input[type="text"],
.mcc-contact .mcc-field input[type="email"] {
    min-height: 58px;
}

.mcc-contact .mcc-field textarea {
    min-height: 210px;
    resize: vertical;
}

.mcc-contact .mcc-field input:hover,
.mcc-contact .mcc-field textarea:hover {
    border-color: rgba(53, 92, 109, .75);
}

.mcc-contact .mcc-field input:focus,
.mcc-contact .mcc-field textarea:focus {
    outline: 2px solid var(--mcc-accent);
    outline-offset: 3px;

    background: #fff;
    border-color: var(--mcc-accent);

    box-shadow:
        0 0 0 5px rgba(255, 255, 255, .35),
        0 6px 18px rgba(38, 61, 74, .09);
}

/* Vérification antispam */

.mcc-contact .mcc-form > div.mcc-field {
    padding: 20px;

    background: rgba(255, 255, 255, .36);
    border: 1px solid rgba(89, 128, 143, .32);
    border-radius: var(--mcc-radius);

    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65);
}

.mcc-contact .mcc-question {
    display: inline-block;
    margin-left: 6px;
    color: var(--mcc-ink);
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.mcc-contact .mcc-captcha-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.mcc-contact .mcc-captcha-row input[name="answer"] {
    flex: 0 0 100px;
    width: 100px;
    min-height: 54px;
    padding: 10px;

    text-align: center;
    font-size: 21px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

/* Boutons : base commune */

.mcc-contact .mcc-submit,
.mcc-contact .mcc-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    width: auto;
    margin: 0;
    font-family: inherit;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    text-transform: none;
    cursor: pointer;

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        background-color .2s ease;
}

/* Nouveau calcul */

.mcc-contact .mcc-refresh {
    min-height: 44px;
    padding: 10px 15px;

    color: var(--mcc-ink);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .015em;

    background: rgba(255, 255, 255, .6);
    border: 1px solid rgba(53, 92, 109, .45);
    border-radius: 8px;

    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}

.mcc-contact .mcc-refresh:hover:not(:disabled) {
    background: #fff;
    box-shadow: 0 4px 10px rgba(38, 61, 74, .08);
}

/* Bouton d’envoi */

.mcc-contact .mcc-actions {
    display: flex;
    justify-content: flex-end;
    margin: 0;
    padding: 0;
}

.mcc-contact .mcc-submit {
    min-height: 56px;
    min-width: 185px;
    padding: 16px 28px;

    color: #fff;
    font-size: 15px;
    font-weight: 650;
    letter-spacing: .04em;

    background: linear-gradient(135deg, #426a7b 0%, #263d4a 100%);
    border: 1px solid #263d4a;
    border-radius: 10px;

    box-shadow:
        0 6px 14px rgba(38, 61, 74, .2),
        inset 0 1px 0 rgba(255, 255, 255, .22);
}

.mcc-contact .mcc-submit:hover:not(:disabled) {
    color: #fff;
    transform: translateY(-2px);

    box-shadow:
        0 10px 20px rgba(38, 61, 74, .26),
        inset 0 1px 0 rgba(255, 255, 255, .22);
}

.mcc-contact .mcc-submit:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(38, 61, 74, .18);
}

.mcc-contact .mcc-submit:focus-visible,
.mcc-contact .mcc-refresh:focus-visible {
    outline: 2px solid var(--mcc-ink);
    outline-offset: 4px;
}

.mcc-contact button:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

/* Messages de confirmation et d’erreur */

.mcc-contact .mcc-feedback:empty {
    display: none;
}

.mcc-contact .mcc-feedback {
    margin: 0;
    padding: 16px 18px;

    font-size: 14px;
    line-height: 1.7;
    overflow-wrap: anywhere;

    border: 1px solid transparent;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(38, 61, 74, .04);
}

.mcc-contact .mcc-feedback.is-error {
    color: #822b27;
    background: #fff3f1;
    border-color: #dca9a3;
}

.mcc-contact .mcc-feedback.is-success {
    color: #24543c;
    background: #f0faf4;
    border-color: #a2c8af;
}

.mcc-contact .mcc-feedback:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

/* Champ piège : reste invisible */

.mcc-contact .mcc-honeypot[hidden] {
    display: none !important;
}

/* Affichage mobile */

@media (max-width: 600px) {
    .mcc-contact {
        margin: 20px auto;
        padding: 24px 18px;
        border-radius: 14px;

        box-shadow:
            4px 6px 12px rgba(35, 32, 38, .15),
            inset 0 1px 0 rgba(255, 255, 255, .85);
    }

    .mcc-contact .mcc-form {
        grid-template-columns: minmax(0, 1fr);
        gap: 22px;
    }

    .mcc-contact .mcc-form > p.mcc-field:first-of-type,
    .mcc-contact .mcc-form > p.mcc-field:nth-of-type(2) {
        grid-column: 1 / -1;
    }

    .mcc-contact .mcc-form > div.mcc-field {
        padding: 17px;
    }

    .mcc-contact .mcc-question {
        margin-left: 0;
        margin-right: 6px;
    }

    .mcc-contact .mcc-submit {
        width: 100%;
    }
}

/* Respect des préférences de réduction des animations */

@media (prefers-reduced-motion: reduce) {
    .mcc-contact *,
    .mcc-contact *::before,
    .mcc-contact *::after {
        transition: none !important;
    }

    .mcc-contact .mcc-submit:hover:not(:disabled) {
        transform: none;
    }
}