/* Reset & Base */
* {
    box-sizing: border-box;
}
body.donation-page { /* Added specificity class if needed, or just rely on page template constraints */
    margin: 0;
    padding: 0;
    font-family: "Poppins", sans-serif;
}
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
td, table { border: none; }
.submitbtn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Utilities */
.jms-my { margin-top: 10px; margin-bottom: 10px; }
.jms-mx { margin-left: auto; margin-right: auto; }
.jms-mr { margin-right: 10px; }
.jms-text-center { text-align: center; }
.jms-d-flex { display: flex; }
.hidden { display: none; }
.error {
    color: red;
    font-size: 12px;
    display: none;
}

/* Container & Cards */
.jms-container-donation {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    font-family: "Poppins", sans-serif;
    font-weight: 400;
}
.jms-container-donation .form-group label,
.jms-container-donation input[type=button] {
    font-family: "Poppins", sans-serif;
    font-weight: 400;
}
.jms-cards {
    display: flex;
    justify-content: center;
    flex-direction: row;
    gap: 10px;
    align-items: stretch;
    max-width: 1200px;
    margin: 0 auto;
}
.jms-one-card,
.jms-two-card,
.jms-three-card {
    display: flex;
    flex: 1;
    min-height: 100%;
}
.jms-card {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}
.jms-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}
.jms-card-header {
    background: #7DC242;
    color: #fff;
    padding: 10px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}
.jms-card-body {
    padding: 15px;
    flex-grow: 1;
}

/* Donation Plans */
.jms-plans-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}
.jms-one-plan-card-img,
.jms-two-plan-card-img,
.jms-three-plan-card-img {
    display: flex;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: space-between;
    background: #7dc24250;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}
.jms-plans-card div:hover {
    background: rgba(125, 194, 66, 0.52);
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(125, 194, 66, 0.25);
}
.jms-card-img-plan {
    width: 45%;
    flex-shrink: 0;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.jms-card-img-plan-top {
    width: 100%;
    height: auto;
    display: block;
}
.jms-card-text-img-plan {
    font-size: 12px;
    color: #555;
    margin: 0;
    padding: 5px 8px;
    font-weight: bold;
}
.jms-card-w {
    width: 50%;
    margin-left: 5%;
}

/* Form Elements */
.jms-donation-container {
    max-width: 400px;
    border-radius: 5px;
}
.jms-donation-heading {
    font-size: 18px;
    font-weight: bold;
}
.jms-donation-label {
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.jms-amount-div {
    display: flex;
    align-items: center;
    justify-content: space-around;
    border: 1px solid #000 !important; /* Update to dark black */
    border-radius: 5px;
    width: 50%;
}
.jms-amount-div input {
    width: 70%;
    border: none !important;
    border-right: 1px solid #000 !important; /* Fix inner vertical line color */
}
.jms-container-donation input[type="text"],
.jms-container-donation input[type="email"],
.jms-container-donation input[type="number"] {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    box-sizing: border-box;
}
.jms-container-donation input[type="radio"] {
    width: 15px;
    height: 15px;
}
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 5px;
    color: #333;
}
.form-group select {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
    color: #333;
    box-sizing: border-box;
}

/* Comment Box */
.jms-comment-box {
    width: 100%;
    height: 80px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
}

/* Name & Address row layout (moved from inline styles) */
.name-fields-row,
.address-fields-row {
    display: flex;
    gap: 10px;
}

/* Checkbox */
.checkbox-wrapper-13 input[type=checkbox] {
    --active: #7DC242;
    --active-inner: #fff;
    --border: #BBC1E1;
    --border-hover: #7DC242;
    --background: #fff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    height: 21px;
    width: 21px;
    outline: none;
    display: inline-block;
    vertical-align: top;
    position: relative;
    margin: 0;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--background);
    transition: background 0.3s, border-color 0.3s, box-shadow 0.2s;
    border-radius: 7px;
}
.checkbox-wrapper-13 input[type=checkbox]:checked {
    background: var(--active);
    border-color: var(--active);
}
.checkbox-wrapper-13 input[type=checkbox]:after {
    content: "";
    display: block;
    left: 7px;
    top: 4px;
    position: absolute;
    width: 5px;
    height: 9px;
    border: 2px solid var(--active-inner);
    border-top: 0;
    border-left: 0;
    transform: rotate(43deg);
    opacity: 0;
    transition: opacity 0.3s;
}
.checkbox-wrapper-13 input[type=checkbox]:checked:after {
    opacity: 1;
}
.checkbox-wrapper-13 label {
    width: 92%;
    margin-left: 4px;
    cursor: pointer;
}

/* Payment Section */
.inner-container {
    padding: 10px 0px;
}
.payment_mode_title {
    font-size: 16px;
    font-weight: 500;
    margin-top: 8px;
    white-space: nowrap;
}
.clickable-div {
    display: inline-block;
    border: 2px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    position: relative;
}
.clickable-div.active {
    border-color: #2F4250 !important;
}
.clickable-div.active::after {
    content: "";
    height: 16px;
    width: 16px;
    background-color: var(--main-action-color, #2F4250);
    border-radius: 16px;
    position: absolute;
    top: -8px;
    right: -8px;
    background-image: url('data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27white%27 viewBox=%270 0 448 512%27%3E%3Cpath d=%27M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z%27/%3E%3C/svg%3E');
    background-size: 9px;
    background-repeat: no-repeat;
    background-color: #2F4250 !important;
    background-position: center;
}
/* Hover icônes paiement (identique à espoir-applications-don) */
.payment-icon {
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}
.payment-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}
.clickable-div2 {
    display: inline;
    border: 2px solid #d1d1d1;
    border-radius: 5px;
    cursor: pointer;
    position: relative;
    margin: 2px;
}
.clickable-div2 img {
    height: 30px;
    width: 50px;
    object-fit: contain;
}
.clickable-div2.active {
    border-color: #2F4250 !important;
}
.clickable-div2.active::after {
    content: "";
    height: 16px;
    width: 16px;
    background-color: var(--main-action-color, #2F4250);
    border-radius: 16px;
    position: absolute;
    top: -8px;
    right: -8px;
    background-image: url('data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27white%27 viewBox=%270 0 448 512%27%3E%3Cpath d=%27M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z%27/%3E%3C/svg%3E');
    background-size: 9px;
    background-repeat: no-repeat;
    background-color: #2F4250 !important;
    background-position: center;
}
.payments {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: nowrap;
}
.payments > .payment-icon {
    padding: 20px 5px;
    text-align: center;
}
#submitbtn-btn {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    align-items: center;
    width: calc(100% + 30px);
    height: 60px;
    background: linear-gradient(135deg, #596873 0%, #4e5d68 100%);
    cursor: pointer;
    color: #FFFFFF;
    font-size: 17px;
    font-weight: 700;
    margin-top: 20px;
    margin-bottom: 10px;
    margin-left: -15px;
    margin-right: -15px;
    border-radius: 8px;
    padding: 0 15px;
    box-sizing: border-box;
    box-shadow: 0 3px 12px rgba(89, 104, 115, 0.3);
    border: none;
    transition: all 0.25s ease;
}
#submitbtn-btn:hover {
    box-shadow: 0 5px 18px rgba(89, 104, 115, 0.4);
    transform: translateY(-1px);
    filter: brightness(1.06);
}
#submitbtn-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(89, 104, 115, 0.3);
}

/* ─── État Formulaire Valide (Prêt à soumettre) ─── */
#submitbtn-btn.ready-to-submit {
    background: linear-gradient(135deg, #2b3035 0%, #15181a 100%) !important;
    box-shadow: 0 4px 15px rgba(21, 24, 26, 0.4) !important;
}
#submitbtn-btn.ready-to-submit:hover {
    box-shadow: 0 6px 20px rgba(21, 24, 26, 0.5) !important;
    filter: brightness(1.1);
}

/* ─── Ajustement Padding Bouton Validation ───────────────────────────
   Alignement "Je valide mon paiement de 100€" sur une seule ligne 
─────────────────────────────────────────────────────────────────────────── */
@media (min-width: 961px) {
    #submitbtn-btn.is-onetime,
    #submitbtn-btn.is-monthly {
        margin-left: -15px !important;
        margin-right: -15px !important;
        padding-left: 5px !important;
        padding-right: 5px !important;
        box-sizing: border-box !important;
        width: calc(100% + 30px) !important;
        white-space: nowrap !important;
        flex-wrap: nowrap !important;
        font-size: clamp(12px, 1.1vw, 15px) !important;
        overflow: hidden !important;
    }
    #submitbtn-btn.is-onetime svg,
    #submitbtn-btn.is-monthly svg {
        margin-left: 4px !important;
        width: 18px !important;
        height: 18px !important;
    }
    #submitbtn-btn.is-onetime span,
    #submitbtn-btn.is-monthly span {
        white-space: nowrap !important;
    }
}

/* ─── Pulse Animation : Bouton prêt à valider ─── */
@keyframes subtlePulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(21, 24, 26, 0.4); }
    50% { box-shadow: 0 4px 25px rgba(21, 24, 26, 0.6); }
}
#submitbtn-btn.ready-to-submit {
    animation: subtlePulse 2s ease-in-out infinite;
}
#submitbtn-btn.ready-to-submit:hover {
    animation: none;
}

/* ─── Shake Animation : Bouton cliqué avec champs manquants ─── */
@keyframes dzc-shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
    40%, 60% { transform: translate3d(3px, 0, 0); }
}

/* Info Boxes */
.jms-add-row {
    border-top: 1px solid;
    border-bottom: 1px solid;
    margin-top: 10px;
    padding: 10px 0px;
}
.jms-ssl-security-box {
    display: flex;
    padding: 10px;
    font-size: 13px;
    align-items: center;
    margin-bottom: 10px;
}
.jms-ssl-security-box img {
    width: 70px;
}
.jms-ssl-security-box .jms-content-text {
    padding: 10px;
}

/* Loading */
.jms-loader {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: none;
    position: absolute;
    border: 3px solid;
    border-color: #7DC242 #7DC242 transparent transparent;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    top: 50%;
    left: 50%;
    z-index: 1000;
}
@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Style pour la case à cocher don anonyme */
.ira-form-item {
    margin: 15px 0 5px 0;
}
.ira-form-item .checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    padding-left: 31px;
    margin-left: 0;
    font-size: 14px;
    font-weight: normal;
    text-transform: none;
}
.ira-form-item .checkbox input[type="checkbox"] {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 21px;
    height: 21px;
    cursor: pointer;
}
.ira-form-item .checkbox span {
    margin-left: 5px;
}

/* Style pour l'affichage du don anonyme */
.anonymous-notice {
    background: #f0f9e8;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #7DC242;
    margin: 15px 0;
    text-align: center;
}
.anonymous-notice p {
    margin: 0;
    color: #555;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 960px) {
    .jms-container-donation .jms-cards {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
    }
    .jms-container-donation .jms-one-card,
    .jms-container-donation .jms-two-card,
    .jms-container-donation .jms-three-card {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 20px !important;
    }
    .jms-container-donation .jms-card {
        width: 100% !important;
        max-width: 100% !important;
    }
    /* R&eacute;duire l'espacement pour 'Mes coordonn&eacute;es' */
    .user-details .fieldset-step2:first-of-type {
        margin-top: 15px !important;
    }
    .user-details .fieldset-step2:last-of-type {
        padding-bottom: 25px !important;
    }

    /* Augmenter la taille du texte du tooltip sur tablette */
    #anonymous-tooltip-message {
        font-size: 18px !important; /* 13px + 5px = 18px */
    }
}
@media (max-width: 768px) {
    .jms-container-donation {
        padding: 10px !important;
        max-width: 100% !important;
    }
    .jms-cards {
        flex-direction: column !important;
        gap: 15px !important;
        width: 100% !important;
    }
    .jms-card {
        width: 100% !important;
        margin: 0 !important;
    }
    .jms-card-body {
        padding: 10px !important;
    }
    .inner-container {
        padding: 10px 5px !important;
    }
    .payments {
        gap: 20px !important;
    }
}
@media (max-width: 500px) {
    .jms-amount-div {
        width: calc(100% - 22px) !important;
    }
    .jms-container-donation {
        padding: 5px !important;
    }
    .jms-card-body {
        padding: 8px !important;
    }
}

/* Plan selection visual indicator */
.jms-one-plan-card-img.active-payment,
.jms-two-plan-card-img.active-payment,
.jms-three-plan-card-img.active-payment {
    border: 2px solid #7DC242;
    box-shadow: 0 2px 8px rgba(125, 194, 66, 0.3);
}

/* Email field icon */
#c-email {
    position: relative;
}
#c-email::before {
    content: "\2709";
    position: absolute;
    top: 38px;
    left: 18px;
    font-size: 18px;
    color: #999;
    z-index: 1;
    pointer-events: none;
}

/* Input focus green border */
.fieldset-step2 input:focus,
.fieldset-step2 select:focus,
.fieldset-step2 textarea:focus {
    border-color: #7DC242 !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(125, 194, 66, 0.2);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* FadeIn animation on form load */
@keyframes jms-fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}
.jms-container-donation {
    animation: jms-fadeIn 0.5s ease-out;
}

/* Large screens constraint */
@media (min-width: 1400px) {
    .jms-container-donation {
        max-width: 1300px;
    }
}

/* Mobile: submit button full width + larger text */
@media (max-width: 768px) {
    #submitbtn-btn {
        width: calc(100% + 30px) !important;
        margin-left: -15px !important;
        margin-right: -15px !important;
        font-size: 15px !important;
        padding: 0 10px !important;
        white-space: nowrap !important;
        flex-wrap: nowrap !important;
        overflow: hidden !important;
    }
    #submitbtn-btn svg {
        width: 18px !important;
        height: 18px !important;
        margin-left: 4px !important;
    }
}

/* =========================================================================
   UI PORTING FROM APPLICATIONS-DON (Mes coordonnees styling logic)
   ========================================================================= */

/* Fieldset and input layout */
.fieldset-step2 {
    border: none;
    padding: 0;
    margin: 0;
}

.fieldset-step2 > p {
    position: relative;
    text-align: left;
    margin-bottom: 6px;
    min-height: 45px;
    font-size: 13px;
}

.fieldset-step2 #c-email::before {
    content: "";
    display: block;
    height: 16px;
    width: 16px;
    position: absolute;
    top: 20px;
    left: 14px;
    background-size: 16px;
    background-position: center center;
    background-repeat: no-repeat;
}

.fieldset-step2 label {
    font-size: 14px !important;
    min-height: 12px;
    position: relative;
    padding: 0 4px;
    background-color: #fff;
    font-weight: bold !important;
    text-transform: uppercase;
    max-width: calc(100% - 20px);
    overflow: hidden;
    z-index: 1;
    margin-left: 10px;
    display: inline-block;
    border-radius: 4px;
}

.fieldset-step2 input,
.fieldset-step2 select {
    background-color: #fff;
    outline: none;
    box-shadow: none;
    width: 100%;
    height: 45px;
    border-radius: 4px;
    border: 1px solid #d1d1d1;
    margin-top: -12px;
}

.fieldset-step2 input {
    padding-left: 0.4rem;
}

.fieldset-step2 select {
    padding-left: 10px;
    background-size: 16px;
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.fieldset-step2 input:focus,
.fieldset-step2 select:focus {
    border-color: #7DC242 !important;
    box-shadow: 0 0 0 3px rgba(125, 194, 66, 0.15) !important;
    outline: none !important;
}

.required {
    color: #e53935;
    margin-left: 3px;
}

/* Checkbox specific styling from espoir-applications-don */
.checkbox {
    position: relative;
    min-height: 24px;
    padding-top: 4px;
    padding-bottom: 0;
    padding-left: 31px;
    margin: 0;
    line-height: 20px;
    color: #000;
    font-size: 13px;
    text-transform: none;
    font-weight: normal;
    max-width: 100%;
}

.checkbox::after {
    content: "";
    font-size: 25px;
    position: absolute;
    left: 3px;
    top: 0;
    height: 16px;
    width: 16px;
    line-height: 20px;
    font-weight: 400;
    text-align: center;
    border: solid 1px #9b9b9b;
    border-radius: 4px;
    z-index: 100;
    background-color: #fff;
    box-shadow: inset 0 0 3px 0 rgba(0, 0, 0, .1);
    margin: 3px 0;
}

.checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    display: none;
}

.checkbox span::after {
    content: "";
    font-size: inherit;
    position: absolute;
    left: 2px;
    top: 2px;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 12px;
    box-shadow: 0 0 4px 0 rgba(0, 0, 0, .25);
    margin: 0;
    border: 2px solid transparent;
    display: none;
    z-index: 101;
}

.checkbox input:checked+span::after {
    display: block;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='black' viewBox='0 0 448 512'%3E%3Cpath d='M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z'/%3E%3C/svg%3E");
}

/* Anonymous Alert box */
.anonymous-alert {
    background-color: #f0f9e8;
    border-radius: 8px;
    border-left: 4px solid #7DC242;
    padding: 15px;
    text-align: center;
    margin-bottom: 20px;
    display: none;
}

.anonymous-alert h4 {
    color: #7DC242;
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: bold;
}

.anonymous-alert p {
    margin: 0;
    font-size: 14px;
    color: #333;
}

/* ─── CORRECTION CHECKBOX - Affichage coche verte ─────────────────────────── */
.checkbox span {
  position: absolute !important;
  left: 3px !important;
  top: 3px !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 18px !important;
  height: 18px !important;
  border-radius: 4px !important;
  box-sizing: border-box !important;
  border: 1px solid transparent !important;
  display: block !important;
  z-index: 101 !important;
}

.checkbox span::after {
  content: "" !important;
  display: none !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  text-align: center !important;
  background-image: none !important;
}

.checkbox input:checked+span {
  background-color: #7DC242 !important;
  border-color: #7DC242 !important;
}

.checkbox input:checked+span::after {
  display: block !important;
  content: "" !important;
  position: absolute !important;
  top: 1px !important;
  left: 5px !important;
  width: 5px !important;
  height: 10px !important;
  border: solid white !important;
  border-width: 0 2px 2px 0 !important;
  transform: rotate(45deg) !important;
  background-image: none !important;
}

/* Tooltip now uses position:fixed with JS dynamic positioning */

/* Media query updates for tablet UI spacing */
@media only screen and (min-width: 768px) and (max-width: 1024px) {

    /* --- En-têtes de cartes (Mon parrainage, Mes coordonnées, Mon règlement) --- */
    .jms-card-header {
        font-size: 24px !important;
        padding: 14px !important;
    }

    /* --- Sous-titre "Montant mensuel de mon parrainage" --- */
    .jms-card-body > div:first-child {
        font-size: 20px !important;
    }

    .fieldset-step2 p {
        font-size: 21px !important;
    }
    .checkbox {
        font-size: 22px !important;
        padding-left: 38px !important;
        min-height: 30px !important;
    }
    .checkbox::after { width: 24px !important; height: 24px !important; }
    .checkbox span { width: 26px !important; height: 26px !important; }
    .checkbox input:checked+span::after { top: 2px !important; left: 8px !important; width: 7px !important; height: 14px !important; border-width: 0 3px 3px 0 !important; }
    #info-icon-anonymous { width: 24px !important; height: 24px !important; line-height: 24px !important; font-size: 14px !important; }
    fieldset label { font-size: 20px !important; }

    /* --- Mon parrainage : radio labels, plan cards, montants --- */
    .jms-donation-label,
    .donation-label,
    .jms-monthly-pay {
        font-size: 20px !important;
    }
    .jms-text-center.jms-card-w {
        font-size: 22px !important;
    }
    .jms-card-text-img-plan {
        font-size: 20px !important;
    }
    .jms-add-row {
        font-size: 20px !important;
    }

    /* --- Champ montant libre (paiement unique) --- */
    .jms-donation-amount-paypal-onetime,
    .jms-amount-div input {
        font-size: 20px !important;
    }
    .jms-amount-div {
        font-size: 20px !important;
    }
    .jms-amount-help {
        font-size: 16px !important;
    }

    /* --- JE VEUX PARRAINER, choix fille/garçon --- */
    .jms-want-to-sponsor,
    .jms-want-to-sponsor div,
    .jms-want-to-sponsor label,
    .jms-rdo-girl,
    .jms-rdo-girl label,
    .jms-rdo-boy,
    .jms-rdo-boy label {
        font-size: 20px !important;
    }

    /* --- Commentaires --- */
    .jms-comment-box-section .jms-label {
        font-size: 20px !important;
    }
    .jms-comment-box {
        font-size: 18px !important;
    }

    /* --- Mes coordonnées : labels, inputs, selects --- */
    .fieldset-step2 label {
        font-size: 18px !important;
    }
    .fieldset-step2 input,
    .fieldset-step2 select {
        font-size: 18px !important;
    }
    .form-group label {
        font-size: 20px !important;
    }
    .form-group select {
        font-size: 18px !important;
    }
    #is-company-wrapper label,
    #is-company-wrapper {
        font-size: 20px !important;
    }

    /* --- Don anonyme checkbox --- */
    .ira-form-item .checkbox,
    .ira-form-item label.checkbox {
        font-size: 20px !important;
    }

    /* --- Mon règlement : bouton --- */
    #submitbtn-btn {
        font-size: 22px !important;
    }

    /* --- Fix cartes paiement (Carte de crédit / Paypal) sur tablette --- */
    .payments {
        gap: 15px !important;
        flex-wrap: nowrap !important;
        justify-content: center !important;
        align-items: flex-start !important;
    }
    .payments > .payment-icon.clickable-div {
        flex: none !important;
        width: 200px !important;
        padding: 15px 20px !important;
        margin: 0 5px 10px 5px !important;
        text-align: center !important;
        display: inline-flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .payments > .payment-icon img {
        height: 45px !important;
        width: auto !important;
        max-width: 70px !important;
    }
    .payment_mode_title {
        font-size: 22px !important;
    }

    /* Sections info crédit / paypal : corriger le padding hérité */
    #creditcard-section,
    #paypal-section {
        padding: 0 !important;
    }
    #creditcard-section p,
    #paypal-section p {
        font-size: 20px !important;
    }

    /* Bank cards exact trace matches */
    img[alt="Mastercard"], img[alt="Visa"], img[alt="Carte Bleue"] {
        height: 55px !important;
        width: auto !important;
        margin: 0 5px !important;
        object-fit: contain !important;
    }

    /* Alignement centré des icônes bancaires */
    div[style*="gap:5px"] {
        align-items: center !important;
    }

    /* --- Textes "Important", SSL sécurisé, et suspension parrainage --- */
    #important-message {
        font-size: 20px !important;
        line-height: 1.5 !important;
    }
    .fieldset-step2 table p {
        font-size: 20px !important;
        line-height: 1.4 !important;
    }
    .jms-ssl-security-box .jms-content-text p {
        font-size: 20px !important;
        line-height: 1.5 !important;
    }

    /* --- Donation heading --- */
    .jms-donation-heading {
        font-size: 22px !important;
    }
}

@media only screen and (max-width: 850px) {
    #c-fname {
        width: calc(50% - 10px) !important;
    }
.checkbox input:checked+span::after {
  display: block !important;
  content: "" !important;
  position: absolute !important;
  top: 1px !important;
  left: 5px !important;
  width: 5px !important;
  height: 10px !important;
  border: solid white !important;
  border-width: 0 2px 2px 0 !important;
  transform: rotate(45deg) !important;
  background-image: none !important;
}

/* Tooltip now uses position:fixed with JS dynamic positioning */

/* Media query updates for tablet UI spacing */
@media only screen and (min-width: 768px) and (max-width: 1024px) {

    /* --- En-têtes de cartes (Mon parrainage, Mes coordonnées, Mon règlement) --- */
    .jms-card-header {
        font-size: 24px !important;
        padding: 14px !important;
    }

    /* --- Sous-titre "Montant mensuel de mon parrainage" --- */
    .jms-card-body > div:first-child {
        font-size: 20px !important;
    }

    .fieldset-step2 p {
        font-size: 21px !important;
    }
    .checkbox {
        font-size: 22px !important;
        padding-left: 38px !important;
        min-height: 30px !important;
    }
    .checkbox::after { width: 24px !important; height: 24px !important; }
    .checkbox span { width: 26px !important; height: 26px !important; }
    .checkbox input:checked+span::after { top: 2px !important; left: 8px !important; width: 7px !important; height: 14px !important; border-width: 0 3px 3px 0 !important; }
    #info-icon-anonymous { width: 24px !important; height: 24px !important; line-height: 24px !important; font-size: 14px !important; }
    fieldset label { font-size: 20px !important; }

    /* --- Mon parrainage : radio labels, plan cards, montants --- */
    .jms-donation-label,
    .donation-label,
    .jms-monthly-pay {
        font-size: 20px !important;
    }
    .jms-text-center.jms-card-w {
        font-size: 22px !important;
    }
    .jms-card-text-img-plan {
        font-size: 20px !important;
    }
    .jms-add-row {
        font-size: 20px !important;
    }

    /* --- Champ montant libre (paiement unique) --- */
    .jms-donation-amount-paypal-onetime,
    .jms-amount-div input {
        font-size: 20px !important;
    }
    .jms-amount-div {
        font-size: 20px !important;
    }
    .jms-amount-help {
        font-size: 16px !important;
    }

    /* --- JE VEUX PARRAINER, choix fille/garçon --- */
    .jms-want-to-sponsor,
    .jms-want-to-sponsor div,
    .jms-want-to-sponsor label,
    .jms-rdo-girl,
    .jms-rdo-girl label,
    .jms-rdo-boy,
    .jms-rdo-boy label {
        font-size: 20px !important;
    }

    /* --- Commentaires --- */
    .jms-comment-box-section .jms-label {
        font-size: 20px !important;
    }
    .jms-comment-box {
        font-size: 18px !important;
    }

    /* --- Mes coordonnées : labels, inputs, selects --- */
    .fieldset-step2 label {
        font-size: 18px !important;
    }
    .fieldset-step2 input,
    .fieldset-step2 select {
        font-size: 18px !important;
    }
    .form-group label {
        font-size: 20px !important;
    }
    .form-group select {
        font-size: 18px !important;
    }
    #is-company-wrapper label,
    #is-company-wrapper {
        font-size: 20px !important;
    }

    /* --- Don anonyme checkbox --- */
    .ira-form-item .checkbox,
    .ira-form-item label.checkbox {
        font-size: 20px !important;
    }

    /* --- Mon règlement : bouton --- */
    #submitbtn-btn {
        font-size: 22px !important;
    }

    /* --- Fix cartes paiement (Carte de crédit / Paypal) sur tablette --- */
    .payments {
        gap: 15px !important;
        flex-wrap: nowrap !important;
        justify-content: center !important;
        align-items: flex-start !important;
    }
    .payments > .payment-icon.clickable-div {
        flex: none !important;
        width: 200px !important;
        padding: 15px 20px !important;
        margin: 0 5px 10px 5px !important;
        text-align: center !important;
        display: inline-flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .payments > .payment-icon img {
        height: 45px !important;
        width: auto !important;
        max-width: 70px !important;
    }
    .payment_mode_title {
        font-size: 22px !important;
    }

    /* Sections info crédit / paypal : corriger le padding hérité */
    #creditcard-section,
    #paypal-section {
        padding: 0 !important;
    }
    #creditcard-section p,
    #paypal-section p {
        font-size: 20px !important;
    }

    /* Bank cards exact trace matches */
    img[alt="Mastercard"], img[alt="Visa"], img[alt="Carte Bleue"] {
        height: 55px !important;
        width: auto !important;
        margin: 0 5px !important;
        object-fit: contain !important;
    }

    /* Alignement centré des icônes bancaires */
    div[style*="gap:5px"] {
        align-items: center !important;
    }

    /* --- Textes "Important", SSL sécurisé, et suspension parrainage --- */
    #important-message {
        font-size: 20px !important;
        line-height: 1.5 !important;
    }
    .fieldset-step2 table p {
        font-size: 20px !important;
        line-height: 1.4 !important;
    }
    .jms-ssl-security-box .jms-content-text p {
        font-size: 20px !important;
        line-height: 1.5 !important;
    }

    /* --- Donation heading --- */
    .jms-donation-heading {
        font-size: 22px !important;
    }
}

@media only screen and (max-width: 850px) {
    #c-fname {
        width: calc(50% - 10px) !important;
    }
    #c-fname input {
        width: 100%;
    }
    .c-title {
        width: 100%;
    }
    #c-title {
        width: 100%;
    }
}

/* FORCE HORIZONTAL DESKTOP LAYOUT (LES CARTES) */
@media only screen and (min-width: 961px) {
    #parrainer-orphelin-form .jms-cards {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        justify-content: center !important;
        gap: 10px !important;
    }
    #parrainer-orphelin-form .jms-one-card,
    #parrainer-orphelin-form .jms-two-card,
    #parrainer-orphelin-form .jms-three-card {
        flex: 0 0 calc(33.333% - 7px) !important;
        width: calc(33.333% - 7px) !important;
        max-width: calc(33.333% - 7px) !important;
        margin-bottom: 0 !important;
    }
}

/* FORCE HORIZONTAL PAYMENT CARDS (LES CARTES DE PAIEMENT) */
#parrainer-orphelin-form .payments {
    flex-wrap: nowrap !important;
    gap: 10px !important;
    justify-content: center !important;
    align-items: flex-start !important; /* EMPÊCHE LE DÉCALAGE VERTICAL */
}
#parrainer-orphelin-form .payments > .payment-icon {
    flex: 1 1 50% !important; /* Adaptable 50% pour éviter l'overflow si la colonne rétrécit */
    width: 100% !important;
    max-width: 160px !important;
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

/* STABILISER TOTALEMENT LA COLONNE DE GAUCHE CONTRE LES SAUTS DYNAMIQUES */
#parrainer-orphelin-form .jms-donation-label {
    min-height: 60px !important; /* Préserve l'espace pour le champ montant libre */
}

/* Dynamic Spacing for Donation Label */
.donation-label.is-onetime-active {
    margin-top: 5px !important;
}
.donation-label.is-recurring-active {
    margin-top: -8px !important;
}

@media (max-width: 768px) {
    .donation-label.is-recurring-active {
        margin-top: -18px !important;
    }
}
