/**
 * Paiement en ligne - Multi-step form + page de remerciement
 *
 * @package Thibierge_Notaires
 */

/* =============================================
   PAGE MERCI POUR VOTRE PAIEMENT
============================================= */

.page-merci-paiement {
    position: relative;
}

.merci-paiement-hero {
    position: relative;
    padding: 180px 0 180px;
}

.merci-paiement-hero__bg {
    position: absolute;
    top: -53px;
    left: -7px;
    width: 1767px;
    height: 1117px;
    pointer-events: none;
    z-index: 0;
    background: linear-gradient(169.65deg, rgba(255, 255, 255, 1) 36%, rgba(1, 153, 164, 1) 121%);
    transform: scaleY(-1) rotate(180deg);
}

.merci-paiement-hero__shape {
    position: absolute;
    top: -147px;
    left: -903px;
    width: 3467px;
    height: 1850px;
    pointer-events: none;
    z-index: 0;
}

.merci-paiement-hero__shape img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.merci-paiement-hero__content {
    position: relative;
    z-index: 1;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--gutter-desktop);
    text-align: center;
}

.merci-paiement-hero__title {
    font-family: var(--font-magnetik);
    font-weight: 200;
    font-size: 81.37px;
    line-height: 90px;
    color: var(--color-text-dark);
    margin: 0 0 28px;
}

.merci-paiement-hero__subtitle {
    font-family: var(--font-magnetik);
    font-weight: 300;
    font-size: 18px;
    line-height: 30px;
    color: #72777b;
    max-width: 540px;
    margin: 0 auto 48px;
}

/* CTA "Retour à l'accueil" — même langage visuel que les boutons étapes paiement */
.merci-paiement-cta {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    text-decoration: none;
    cursor: pointer;
}

.merci-paiement-cta__content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.merci-paiement-cta__text {
    font-family: var(--font-magnetik);
    font-weight: 300;
    font-size: 18px;
    color: #1e1e1e;
    white-space: nowrap;
}

.merci-paiement-cta__icon {
    width: 12px;
    height: 11px;
    color: #1e1e1e;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.merci-paiement-cta:hover .merci-paiement-cta__icon {
    transform: translateX(4px);
}

.merci-paiement-cta__line {
    position: relative;
    width: 100%;
    height: 1px;
    background-color: transparent;
    overflow: hidden;
}

.merci-paiement-cta__line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1e1e1e;
    transform: translateX(0);
    transition: transform 0.3s ease;
}

.merci-paiement-cta:hover .merci-paiement-cta__line::after {
    animation: paiementLineWipe 0.5s ease;
}

@media (max-width: 1023px) {
    .merci-paiement-hero {
        padding: 80px 0;
    }
    .merci-paiement-hero__content {
        padding: 0 var(--gutter-tablet);
    }
    .merci-paiement-hero__title {
        font-size: 48px;
        line-height: 56px;
    }
}

@media (max-width: 767px) {
    .merci-paiement-hero {
        padding: 60px 0;
    }
    .merci-paiement-hero__content {
        padding: 0 var(--gutter-mobile);
    }
    .merci-paiement-hero__title {
        font-size: 36px;
        line-height: 44px;
        margin-bottom: 20px;
    }
    .merci-paiement-hero__subtitle {
        font-size: 16px;
        line-height: 26px;
        margin-bottom: 32px;
    }
}

/* =============================================
   PAGE LAYOUT
============================================= */

.page-paiement {
    position: relative;
}

/* =============================================
   HERO SECTION
============================================= */

.paiement-hero {
    position: relative;
    padding: 100px 0 0;
}

.paiement-hero__bg {
    position: absolute;
    top: -53px;
    left: -7px;
    width: 1767px;
    height: 1117px;
    pointer-events: none;
    z-index: 0;
    background: linear-gradient(169.65deg, rgba(255, 255, 255, 1) 36%, rgba(1, 153, 164, 1) 121%);
    transform: scaleY(-1) rotate(180deg);
}

.paiement-hero__shape {
    position: absolute;
    top: -147px;
    left: -903px;
    width: 3467px;
    height: 1850px;
    pointer-events: none;
    z-index: 0;
}

.paiement-hero__shape img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.paiement-hero__content {
    position: relative;
    z-index: 1;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--gutter-desktop);
}

.paiement-hero__title {
    font-family: var(--font-magnetik);
    font-weight: 200;
    font-size: 81.37px;
    line-height: 90px;
    color: var(--color-text-dark);
    margin: 0 0 28px;
}

.paiement-hero__subtitle {
    font-family: var(--font-magnetik);
    font-weight: 300;
    font-size: 18px;
    line-height: 30px;
    color: #72777b;
    max-width: 365px;
    margin: 0;
}

/* =============================================
   FORM SECTION
============================================= */

.paiement-form-section {
    position: relative;
    z-index: 1;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 100px var(--gutter-desktop) 0;
}

.paiement-form-section__header {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    max-width: 1117px;
    margin: 0 auto 20px;
}

.paiement-form-section__icon {
    width: 96px;
    height: 56px;
    flex-shrink: 0;
}

.paiement-form-section__icon img,
.paiement-form-section__icon svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* =============================================
   STEP INDICATOR
============================================= */

.paiement-steps {
    display: flex;
    align-items: center;
    gap: 20px;
    font-family: var(--font-magnetik);
    font-size: 18px;
    line-height: normal;
}

.paiement-steps__item {
    font-weight: 300;
    color: var(--color-text-dark);
    transition: font-weight var(--transition-fast);
}

.paiement-steps__item--active {
    font-weight: 600;
}

.paiement-steps__separator {
    font-weight: 300;
    color: var(--color-text-dark);
}

/* =============================================
   FORM WRAPPER
============================================= */

.paiement-form-wrapper {
    position: relative;
    background-color: var(--color-bg-white);
    border: 1px solid #ddd;
    width: 1117px;
    max-width: 100%;
    margin: 0 auto;
}

.paiement-form-wrapper__progress {
    position: relative;
    height: 11px;
    width: 100%;
}

.paiement-form-wrapper__progress-bg {
    position: absolute;
    inset: 0;
    background-color: rgba(9, 46, 80, 0.3);
}

.paiement-form-wrapper__progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background-color: #092e50;
    transition: width 0.4s ease-out;
}

/* =============================================
   FORM
============================================= */

.paiement-form {
    padding: 63px 57px 54px;
}

.paiement-form__grid {
    display: grid;
    grid-template-columns: 432px 432px;
    gap: 64px;
    justify-content: space-between;
    align-items: start;
}

.paiement-form__column {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.paiement-form__field {
    display: flex;
    flex-direction: column;
}

.paiement-form__label {
    font-family: var(--font-magnetik);
    font-weight: 600;
    font-size: 15px;
    line-height: 28px;
    color: var(--color-text-dark);
    margin-bottom: 2px;
}

.paiement-form__input-wrapper {
    position: relative;
}

.paiement-form__input {
    width: 100%;
    height: 50px;
    padding: 0 16px;
    font-family: var(--font-magnetik);
    font-weight: 300;
    font-size: 15px;
    color: var(--color-text-dark);
    background-color: var(--color-bg-white);
    border: 1px solid #d8d8d8;
    transition: border-color var(--transition-fast);
    appearance: none;
}

.paiement-form__input--with-tooltip {
    padding-right: 48px;
}

.paiement-form__input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.paiement-form__input::placeholder {
    color: #b0b0b0;
    font-weight: 300;
}

.paiement-form__input--error {
    border-color: #b50d0c;
}

/* Hide spinner buttons on number inputs to keep visual parity with Figma */
.paiement-form__input[type="number"]::-webkit-outer-spin-button,
.paiement-form__input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.paiement-form__input[type="number"] {
    -moz-appearance: textfield;
}

/* =============================================
   TOOLTIP "?"
============================================= */

.paiement-form__tooltip {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-family: var(--font-magnetik);
    font-weight: 700;
    font-size: 14px;
    color: #ffffff;
    background-color: var(--color-teal);
    border-radius: 50%;
    cursor: help;
    user-select: none;
    line-height: 1;
}

.paiement-form__tooltip:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.paiement-form__tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background-color: var(--color-text-dark);
    color: #ffffff;
    font-weight: 400;
    font-size: 13px;
    line-height: 1.4;
    white-space: normal;
    width: max-content;
    max-width: 260px;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: var(--z-tooltip);
}

.paiement-form__tooltip:hover::after,
.paiement-form__tooltip:focus::after {
    opacity: 1;
}

/* =============================================
   FORM FOOTER / NAVIGATION
============================================= */

.paiement-form__footer {
    margin-top: 50px;
    padding-top: 54px;
    border-top: 1px solid #e0e0e0;
}

.paiement-form__nav {
    display: flex;
    align-items: center;
    gap: 40px;
}

.paiement-form__nav--systempay {
    justify-content: space-between;
}

.paiement-form__nav-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
}

.paiement-form__nav-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.paiement-form__nav-text {
    font-family: var(--font-magnetik);
    font-weight: 300;
    font-size: 18px;
    color: #1e1e1e;
    white-space: nowrap;
}

.paiement-form__nav-icon {
    width: 12px;
    height: 11px;
    color: #1e1e1e;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.paiement-form__nav-btn:hover .paiement-form__nav-icon {
    transform: translateX(4px);
}

.paiement-form__nav-line {
    position: relative;
    width: 100%;
    height: 1px;
    background-color: transparent;
    overflow: hidden;
}

.paiement-form__nav-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1e1e1e;
    transform: translateX(0);
    transition: transform 0.3s ease;
}

.paiement-form__nav-btn:hover .paiement-form__nav-line::after {
    animation: paiementLineWipe 0.5s ease;
}

@keyframes paiementLineWipe {
    0% { transform: translateX(0); }
    50% { transform: translateX(100%); }
    50.01% { transform: translateX(-100%); }
    100% { transform: translateX(0); }
}

/* =============================================
   SECURE NOTICE (étape 3)
============================================= */

.paiement-form__secure-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    font-family: var(--font-magnetik);
    font-weight: 200;
    font-style: italic;
    font-size: 18px;
    color: #72777b;
    line-height: 1.4;
}

.paiement-form__secure-icon {
    color: #ffb601;
    flex-shrink: 0;
}

/* =============================================
   MESSAGE
============================================= */

.paiement-form__message {
    margin: 24px 57px;
    padding: 16px 24px;
    font-family: var(--font-magnetik);
    font-size: 15px;
    line-height: 1.5;
}

.paiement-form__message--error {
    background-color: #ffebee;
    color: #c62828;
    border-left: 4px solid #c62828;
}

.paiement-form__message--success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #2e7d32;
}

/* =============================================
   SYSTEMPAY (étape 3) — thème "neon" Krypton, custom CSS minimal
   - Police Magnetik
   - Cardholder name + register checkbox cachés
   - Bouton natif Krypton caché (on a notre bouton "Payer" custom)
   - Pas d'ombres (cohérence avec étapes 1/2 qui sont à plat)
   - Grille 2 colonnes : PAN top-left / MM-AA top-right / CVV bottom-left
============================================= */

.paiement-form--systempay .kr-embedded,
.paiement-form--systempay .kr-embedded * {
    font-family: var(--font-magnetik) !important;
}

/* Layout 2 colonnes matchant Figma */
.paiement-form--systempay .kr-embedded {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    column-gap: 64px;
    row-gap: 24px;
    width: 100% !important;
    margin: 0 !important;
    align-items: start;
}

.paiement-form--systempay .kr-embedded .kr-pan { grid-column: 1; grid-row: 1; }
.paiement-form--systempay .kr-embedded .kr-expiry { grid-column: 2; grid-row: 1; }
.paiement-form--systempay .kr-embedded .kr-security-code { grid-column: 1; grid-row: 2; }
.paiement-form--systempay .kr-embedded .kr-form-error { grid-column: 1 / -1; grid-row: 3; }

.paiement-form--systempay .kr-embedded .kr-field-element {
    width: 100% !important;
    margin: 0 !important;
}

/* Ombres neutralisées (sur tous les niveaux que neon applique) */
.paiement-form--systempay .kr-embedded,
.paiement-form--systempay .kr-embedded *,
.paiement-form--systempay .kr-embedded .kr-field-wrapper,
.paiement-form--systempay .kr-embedded .kr-field-component,
.paiement-form--systempay .kr-embedded .kr-iframe-wrapper,
.paiement-form--systempay .kr-embedded .kr-pan,
.paiement-form--systempay .kr-embedded .kr-expiry,
.paiement-form--systempay .kr-embedded .kr-security-code {
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
}

/* Caché : option "enregistrer la carte", pas dans la maquette */
.paiement-form--systempay .kr-embedded .kr-do-register {
    display: none !important;
}

/* Nom du titulaire : requis par SystemPay → doit rester visible (sinon CLIENT_300). */
.paiement-form--systempay .kr-embedded .kr-card-holder-name { grid-column: 2; grid-row: 2; }

/* Bouton natif Krypton masqué : on déclenche le paiement via le bouton "Payer" custom
   (bridge JS qui clique ce bouton natif). C'est bien Krypton qui valide/soumet. */
.paiement-form--systempay .kr-embedded .kr-payment-button {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
}

/* Responsive */
@media (max-width: 1023px) {
    .paiement-form--systempay .kr-embedded {
        grid-template-columns: 1fr;
        row-gap: 18px;
    }
    .paiement-form--systempay .kr-embedded .kr-pan,
    .paiement-form--systempay .kr-embedded .kr-expiry,
    .paiement-form--systempay .kr-embedded .kr-security-code {
        grid-column: 1;
    }
    .paiement-form--systempay .kr-embedded .kr-pan { grid-row: 1; }
    .paiement-form--systempay .kr-embedded .kr-expiry { grid-row: 2; }
    .paiement-form--systempay .kr-embedded .kr-security-code { grid-row: 3; }
    .paiement-form--systempay .kr-embedded .kr-card-holder-name { grid-column: 1; grid-row: 4; }
    .paiement-form--systempay .kr-embedded .kr-form-error { grid-row: 5; }
}

/* =============================================
   RESPONSIVE
============================================= */

@media (max-width: 1700px) {
    .paiement-hero__content,
    .paiement-form-section {
        max-width: 100%;
    }
}

@media (max-width: 1279px) {
    .paiement-hero__title {
        font-size: 60px;
        line-height: 70px;
    }

    .paiement-form-wrapper {
        width: 100%;
    }

    .paiement-form__grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }

    .paiement-form-section__icon {
        display: none;
    }
}

@media (max-width: 1023px) {
    .paiement-hero {
        padding: 80px 0 0;
    }

    .paiement-hero__content {
        padding: 0 var(--gutter-tablet);
    }

    .paiement-hero__title {
        font-size: 48px;
        line-height: 56px;
    }

    .paiement-form-section {
        padding: 60px var(--gutter-tablet) 0;
    }

    .paiement-form-wrapper {
        width: 100%;
        max-width: 100%;
    }

    .paiement-form {
        padding: 40px 32px;
    }

    .paiement-form__grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .paiement-steps {
        flex-wrap: wrap;
        gap: 12px;
        font-size: 14px;
    }
}

@media (max-width: 767px) {
    .paiement-hero {
        padding: 60px 0 0;
    }

    .paiement-hero__content {
        padding: 0 var(--gutter-mobile);
    }

    .paiement-hero__title {
        font-size: 36px;
        line-height: 44px;
    }

    .paiement-hero__subtitle {
        font-size: 16px;
        line-height: 26px;
    }

    .paiement-form-section {
        padding: 40px var(--gutter-mobile) 0;
    }

    .paiement-form-section__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .paiement-form-section__icon {
        display: none;
    }

    .paiement-form {
        padding: 24px;
    }

    .paiement-form__nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }

    .paiement-form__nav--systempay {
        flex-direction: column-reverse;
        align-items: flex-start;
    }

    .paiement-form__secure-notice {
        margin-left: 0;
        font-size: 14px;
    }

    .paiement-form__message {
        margin: 24px;
    }
}
