/**
 * AMS Focus — PMPro — étape avant Stripe.
 */

body.amsfocus-pmpro-precheckout {
    --af-p-blue: #0875f5;
    --af-p-navy: #07194e;
    --af-p-text: #566d94;
    --af-p-border: #dbe7f5;
    --af-p-bg: #f4f8fd;
    --af-p-green: #079a63;

    margin: 0;

    background: var(--af-p-bg);
}

/* Aucun CTA commercial dans l'espace PMPro. */
body.amsfocus-pmpro-precheckout .ams-header__actions,
body.amsfocus-pmpro-precheckout .ams-header__login-mobile {
    display: none !important;
}

/* Neutraliser uniquement le conteneur WordPress. */
body.amsfocus-pmpro-precheckout .site-main,
body.amsfocus-pmpro-precheckout .content-area,
body.amsfocus-pmpro-precheckout article.page,
body.amsfocus-pmpro-precheckout .entry-content,
body.amsfocus-pmpro-precheckout .page-content {
    width: 100% !important;
    max-width: none !important;

    margin: 0 !important;
    padding: 0 !important;
}

body.amsfocus-pmpro-precheckout .entry-header,
body.amsfocus-pmpro-precheckout .entry-title {
    display: none !important;
}

.amsfocus-precheckout-shell,
.amsfocus-precheckout-shell * {
    box-sizing: border-box;
}

.amsfocus-precheckout-shell {
    min-height: 75vh;

    background:
        radial-gradient(
            circle at 84% 4%,
            rgba(8, 117, 245, 0.10),
            transparent 35%
        ),
        linear-gradient(
            180deg,
            #f8fbff 0%,
            #f2f7fd 100%
        );
}

.amsfocus-precheckout-main {
    width: 100%;

    padding: 82px 0;
}

/* --------------------------------------------------------------------------
   ALIGNEMENT DESKTOP
   Même axe interne que .ams-header__inner.
   -------------------------------------------------------------------------- */

@media (min-width: 981px) {

    .amsfocus-precheckout-container {
        padding-left:
            min(
                8.333%,
                96px
            );
    }
}

/* Navigation retour — checkout Free et Pro */

body.amsfocus-pmpro-precheckout
.amsfocus-precheckout-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin: 0 0 24px;
    color: #0868e9;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    text-decoration: none;
}

body.amsfocus-pmpro-precheckout
.amsfocus-precheckout-back:hover {
    color: #064bab;
    text-decoration: underline;
}

body.amsfocus-pmpro-precheckout
.amsfocus-precheckout-back:focus-visible {
    outline: 2px solid #0868e9;
    outline-offset: 4px;
}

.amsfocus-precheckout-hero {
    max-width: 850px;

    margin: 0 0 31px;
}

.amsfocus-precheckout-hero h1 {
    margin: 0;

    color: var(--af-p-navy);

    font-size: clamp(42px, 3.8vw, 54px);
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.045em;
}

.amsfocus-precheckout-hero p {
    margin: 12px 0 0;

    color: var(--af-p-text);

    font-size: 16px;
    line-height: 1.55;
}

.amsfocus-precheckout-grid {
    display: grid;

    grid-template-columns: minmax(0, 1fr);

    max-width: 1080px;

    gap: 24px;

    align-items: start;
}


/* --------------------------------------------------------------------------
   COLONNE GAUCHE
   -------------------------------------------------------------------------- */

.amsfocus-precheckout-left {
    display: grid;

    gap: 18px;
}

.amsfocus-precheckout-card,
.amsfocus-precheckout-account,
.amsfocus-precheckout-next {
    border: 1px solid var(--af-p-border);
    border-radius: 15px;

    background: #fff;

    box-shadow:
        0 12px 34px rgba(31, 79, 137, 0.07);
}

.amsfocus-precheckout-card,
.amsfocus-precheckout-account,
.amsfocus-precheckout-next {
    padding: 25px 27px;
}

.amsfocus-precheckout-card-heading {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;
}

.amsfocus-precheckout-card h2,
.amsfocus-precheckout-account h2,
.amsfocus-precheckout-next h2 {
    margin: 0;

    color: var(--af-p-navy);

    font-size: 19px;
    line-height: 1.3;
    font-weight: 800;
}

.amsfocus-precheckout-status {
    display: inline-flex;

    padding: 7px 11px;

    border-radius: 999px;

    background: rgba(7, 154, 99, 0.08);
    color: var(--af-p-green);

    font-size: 10px;
    font-weight: 800;
}

.amsfocus-precheckout-plan {
    display: grid;

    grid-template-columns:
        46px
        minmax(0, 1fr)
        auto;

    gap: 13px;

    align-items: center;

    padding: 18px;

    border: 1px solid #e0e9f5;
    border-radius: 11px;

    background: #f9fbfe;
}

.amsfocus-precheckout-plan-icon {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    background: #eaf3ff;
    color: var(--af-p-blue);
}

.amsfocus-precheckout-plan-icon {
    width: 46px;
    height: 46px;

    border-radius: 11px;
}

.amsfocus-precheckout-plan-icon svg {
    width: 22px;
    height: 22px;
}

.amsfocus-precheckout-plan strong {
    display: block;

    color: var(--af-p-navy);

    font-size: 13px;
    font-weight: 800;
}

.amsfocus-precheckout-plan span:not(.amsfocus-precheckout-plan-icon) {
    display: block;

    margin-top: 3px;

    color: var(--af-p-text);

    font-size: 10px;
}

.amsfocus-precheckout-plan-price {
    color: var(--af-p-navy);

    text-align: right;

    font-size: 14px;
    font-weight: 800;

    white-space: nowrap;
}

.amsfocus-precheckout-plan-price small {
    display: block;

    margin-top: 2px;

    color: var(--af-p-text);

    font-size: 9px;
    font-weight: 600;
}


/* Compte */

.amsfocus-precheckout-account h2,
.amsfocus-precheckout-next h2 {
    margin-bottom: 17px;
}

.amsfocus-precheckout-account-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 13px;
}

.amsfocus-precheckout-account-grid > div {
    padding: 14px 15px;

    border: 1px solid #e0e9f5;
    border-radius: 9px;

    background: #f9fbfe;
}

.amsfocus-precheckout-account-grid span {
    display: block;

    margin-bottom: 5px;

    color: var(--af-p-text);

    font-size: 10px;
}

.amsfocus-precheckout-account-grid strong {
    display: block;

    overflow-wrap: anywhere;

    color: var(--af-p-navy);

    font-size: 12px;
}

.amsfocus-precheckout-account > p,
.amsfocus-precheckout-next > p {
    margin: 14px 0 0;

    color: var(--af-p-text);

    font-size: 12px;
    line-height: 1.55;
}


/* --------------------------------------------------------------------------
   FORMULAIRE PMPRO NATIF
   -------------------------------------------------------------------------- */

.amsfocus-precheckout-native {
    margin-top: 18px;
}

/* Champs d'inscription natifs PMPro 3.8.8 */

body.amsfocus-pmpro-precheckout
#pmpro_user_fields {
    margin-top: 28px;
}

body.amsfocus-pmpro-precheckout
#pmpro_user_fields .pmpro_form_fields {
    display: block;
}

body.amsfocus-pmpro-precheckout
#pmpro_user_fields .pmpro_form_fields > .pmpro_cols-2 {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 18px !important;
    align-items: start !important;
    margin: 0 0 20px !important;
}

body.amsfocus-pmpro-precheckout
#pmpro_user_fields .pmpro_form_field-username {
    margin: 0 0 20px !important;
}

body.amsfocus-pmpro-precheckout
#pmpro_user_fields .pmpro_cols-2 > .pmpro_form_field {
    position: relative;
    display: block !important;
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
}

body.amsfocus-pmpro-precheckout
#pmpro_user_fields .pmpro_form_field label.pmpro_form_label {
    display: block;
    min-height: 20px;
    margin: 0 0 8px !important;
    line-height: 20px;
}

body.amsfocus-pmpro-precheckout
#pmpro_user_fields .pmpro_form_field input.pmpro_form_input {
    display: block;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
    height: 50px !important;
    min-height: 50px !important;
    margin: 0 !important;
    padding: 10px 14px;
}

body.amsfocus-pmpro-precheckout
#pmpro_user_fields .pmpro_form_field #password {
    padding-right: 52px !important;
}


/* AMS Focus — aide dédiée au mot de passe.
   N'utilise pas les messages globaux de PMPro. */

body.amsfocus-pmpro-precheckout
#pmpro_user_fields .amsfocus-password-help {
    display: block !important;
    position: static !important;
    box-sizing: border-box;
    width: 100% !important;
    margin: 9px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #536681 !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    overflow-wrap: normal;
}

body.amsfocus-pmpro-precheckout
#pmpro_user_fields .amsfocus-password-help.is-error {
    color: #b42318 !important;
}

/* Oeil discret, intégré au champ mot de passe */

body.amsfocus-pmpro-precheckout
#pmpro_user_fields .pmpro_form_field-password-toggle {
    position: absolute !important;
    right: 10px !important;
    top: 39px !important;
    bottom: auto !important;
    z-index: 2;
    width: 28px !important;
    height: 28px !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.amsfocus-pmpro-precheckout
#pmpro_user_fields .pmpro_btn-password-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    min-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 5px !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    color: #416488 !important;
}

body.amsfocus-pmpro-precheckout
#pmpro_user_fields .pmpro_btn-password-toggle:hover,
body.amsfocus-pmpro-precheckout
#pmpro_user_fields .pmpro_btn-password-toggle:focus-visible {
    background: #edf4ff !important;
    box-shadow: none !important;
}

body.amsfocus-pmpro-precheckout
#pmpro_user_fields .pmpro_btn-password-toggle svg {
    width: 20px;
    height: 20px;
    stroke: #416488 !important;
}

body.amsfocus-pmpro-precheckout
#pmpro_user_fields .pmpro_form_field-password-toggle-state {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    white-space: nowrap;
    clip-path: inset(50%);
}

@media (max-width: 760px) {
    body.amsfocus-pmpro-precheckout
    #pmpro_user_fields .pmpro_form_fields > .pmpro_cols-2 {
        grid-template-columns: minmax(0, 1fr) !important;
        row-gap: 20px !important;
    }
}

/*
 * Les informations d'offre et de compte sont déjà présentées
 * par notre interface. Elles restent dans le formulaire PMPro,
 * mais sont uniquement masquées visuellement.
 */
body.amsfocus-pmpro-precheckout
.amsfocus-precheckout-native
#pmpro_pricing_fields {
    display: none !important;
}

body.amsfocus-pmpro-precheckout
.amsfocus-precheckout-native form,
body.amsfocus-pmpro-precheckout
.amsfocus-precheckout-native .pmpro,
body.amsfocus-pmpro-precheckout
.amsfocus-precheckout-native .pmpro_card {
    width: 100% !important;
    max-width: none !important;

    margin: 0 !important;

    background: transparent !important;
    border: 0 !important;

    box-shadow: none !important;
}

body.amsfocus-pmpro-precheckout
.amsfocus-precheckout-native
.pmpro_form_submit {
    margin: 0 !important;
}

body.amsfocus-pmpro-precheckout
.amsfocus-precheckout-native
input[type="submit"],

body.amsfocus-pmpro-precheckout
.amsfocus-precheckout-native
button[type="submit"],

body.amsfocus-pmpro-precheckout
.amsfocus-precheckout-native
.pmpro_form_submit .pmpro_btn {
    width: 100% !important;

    min-height: 49px !important;

    margin: 0 !important;
    padding: 12px 18px !important;

    border: 0 !important;
    border-radius: 8px !important;

    background:
        linear-gradient(
            135deg,
            #0875f5,
            #0868e9
        ) !important;

    color: #fff !important;

    font-size: 12px !important;
    font-weight: 800 !important;

    box-shadow:
        0 9px 20px rgba(8, 117, 245, 0.18) !important;
}


/* Informations de confiance dans Votre adhésion. */
.amsfocus-precheckout-reassurance {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 24px;

    margin-top: 20px;
    padding-top: 18px;

    border-top: 1px solid var(--af-p-border);
}

.amsfocus-precheckout-reassurance > div {
    display: grid;

    grid-template-columns:
        30px
        minmax(0, 1fr);

    gap: 9px;

    align-items: start;
    flex: 1 1 300px;
    min-width: 0;
}

.amsfocus-precheckout-reassurance > div > span {
    width: 30px;
    height: 30px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #eaf3ff;
    color: var(--af-p-blue);
}

.amsfocus-precheckout-reassurance svg {
    width: 15px;
    height: 15px;
}

.amsfocus-precheckout-reassurance p {
    margin: 0;

    color: var(--af-p-text);

    font-size: 9px;
    line-height: 1.5;
}

.amsfocus-precheckout-reassurance strong {
    display: block;

    margin-bottom: 2px;

    color: var(--af-p-navy);

    font-size: 10px;
}


/* --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- */

@media (max-width: 980px) {

    .amsfocus-precheckout-grid {
        grid-template-columns: 1fr;
    }


}

@media (max-width: 620px) {

    .amsfocus-precheckout-main {
        padding: 54px 0 60px;
    }

    .amsfocus-precheckout-hero h1 {
        font-size: 38px;
    }

    .amsfocus-precheckout-card-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .amsfocus-precheckout-plan {
        grid-template-columns:
            42px
            minmax(0, 1fr);
    }

    .amsfocus-precheckout-plan-price {
        grid-column: 2;

        text-align: left;
    }

    .amsfocus-precheckout-account-grid {
        grid-template-columns: 1fr;
    }
}

/* AMSFOCUS_PMPRO_SPACING_PATCH_START */
/* Espacement bloc deja inscrit / Turnstile / bouton */

body.amsfocus-pmpro-precheckout
.amsfocus-precheckout-native
.pmpro_message {
    margin-bottom: 18px !important;
}

body.amsfocus-pmpro-precheckout
.amsfocus-precheckout-native
.cf-turnstile {
    display: inline-block !important;
    margin-top: 14px !important;
    margin-bottom: 22px !important;
}

body.amsfocus-pmpro-precheckout
.amsfocus-precheckout-native
.pmpro_form_submit,
body.amsfocus-pmpro-precheckout
.amsfocus-precheckout-native
.pmpro_submit {
    margin-top: 8px !important;
}

body.amsfocus-pmpro-precheckout
.amsfocus-precheckout-native
.pmpro_form_submit .pmpro_btn,
body.amsfocus-pmpro-precheckout
.amsfocus-precheckout-native
.pmpro_submit .pmpro_btn,
body.amsfocus-pmpro-precheckout
.amsfocus-precheckout-native
input[type="submit"].pmpro_btn,
body.amsfocus-pmpro-precheckout
.amsfocus-precheckout-native
button[type="submit"].pmpro_btn {
    margin-top: 0 !important;
}
/* AMSFOCUS_PMPRO_SPACING_PATCH_END */
