/**
 * IA & Marketing – Styles du checkout Stripe Payment Element.
 *
 * Thème direction-ia :
 * - fond plein écran bleu nuit
 * - overlay sombre avec blur
 * - carte centrale dégradée, bordure cyan, motif grille discret
 * - bouton CTA orange, texte Poppins
 *
 * La modale couvre tout le viewport (position: fixed; inset: 0).[web:213][web:214]
 */

/* Reset minimal pour la zone checkout */

.iem-dd-checkout-wrapper {
    position: relative;
    margin: 24px 0;
    font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Header produit / prix */

.iem-dd-checkout-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.iem-dd-checkout-product-name {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.iem-dd-brand-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #38d0ff;
    font-weight: 600;
}

.iem-dd-product-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.iem-dd-checkout-price {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(56, 208, 255, 0.4);
}

.iem-dd-price-amount {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.iem-dd-price-currency {
    font-size: 12px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
}

.iem-dd-price-tax-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
}

/* CTA principal (bouton d’ouverture de la modale) */

.iem-dd-checkout-cta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.iem-dd-checkout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 240px;
    padding: 12px 20px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #ff7a2a, #ff6100);
    color: #ffffff;
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(255, 255, 255, 0.06);
    transition: transform 0.14s ease-out, box-shadow 0.14s ease-out, background 0.14s ease-out;
}

.iem-dd-checkout-button:hover,
.iem-dd-checkout-button:focus-visible {
    background: linear-gradient(135deg, #ff8e4a, #ff7a2a);
    box-shadow:
        0 22px 52px rgba(0, 0, 0, 0.9),
        0 0 0 1px rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
    outline: none;
}

.iem-dd-checkout-button:active {
    transform: translateY(0);
    box-shadow:
        0 12px 26px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

.iem-dd-checkout-reassurance {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.82);
}

/* Overlay FULL SCREEN */

.iem-dd-checkout-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(56, 208, 255, 0.16), transparent 55%),
                radial-gradient(circle at bottom right, rgba(255, 97, 0, 0.18), transparent 60%),
                #001024;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9990;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modale (plein écran + carte centrale) */

.iem-dd-checkout-modal {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px 16px;
    z-index: 10000;
    outline: none;
}

.iem-dd-checkout-modal-inner {
    position: relative;
    max-width: 540px;
    width: 100%;
    background:
        radial-gradient(circle at top left, rgba(56, 208, 255, 0.18), transparent 60%),
        radial-gradient(circle at bottom right, rgba(255, 97, 0, 0.22), transparent 60%),
        linear-gradient(135deg, #07395e, #001629);
    border-radius: 18px;
    border: 1px solid rgba(56, 208, 255, 0.55);
    box-shadow:
        0 28px 80px rgba(0, 0, 0, 0.95),
        0 0 0 1px rgba(0, 0, 0, 0.8);
    padding: 24px 24px 18px 24px;
    color: #ffffff;
    overflow: hidden;
}

/* Motif grille discret */

.iem-dd-checkout-modal-inner::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(transparent 0, transparent 22px, rgba(255, 255, 255, 0.04) 22px, rgba(255, 255, 255, 0.04) 23px),
        linear-gradient(90deg, transparent 0, transparent 22px, rgba(255, 255, 255, 0.04) 22px, rgba(255, 255, 255, 0.04) 23px);
    background-size: 24px 24px;
    opacity: 0.75;
    pointer-events: none;
}

.iem-dd-checkout-modal-inner > * {
    position: relative;
    z-index: 1;
}

/* Bouton de fermeture X */

.iem-dd-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.55);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7);
    transition: background 0.12s ease-out, transform 0.12s ease-out, box-shadow 0.12s ease-out;
}

.iem-dd-modal-close:hover,
.iem-dd-modal-close:focus-visible {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-1px);
    outline: none;
}

.iem-dd-modal-close:active {
    transform: translateY(0);
    box-shadow: 0 3px 9px rgba(0, 0, 0, 0.65);
}

/* Header modale */

.iem-dd-modal-header {
    margin-bottom: 12px;
}

.iem-dd-modal-title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
}

.iem-dd-modal-subtitle {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.88);
}

/* Corps de la modale */

.iem-dd-modal-body {
    margin-bottom: 10px;
}

.iem-dd-modal-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.iem-dd-form-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.iem-dd-form-label {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.iem-dd-form-input {
    border-radius: 8px;
    border: 1px solid rgba(56, 208, 255, 0.42);
    background: rgba(0, 0, 0, 0.35);
    color: #ffffff;
    padding: 8px 10px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.12s ease-out, box-shadow 0.12s ease-out, background 0.12s ease-out;
}

.iem-dd-form-input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.iem-dd-form-input:focus-visible {
    border-color: #38d0ff;
    box-shadow: 0 0 0 3px rgba(56, 208, 255, 0.22);
    background: rgba(0, 0, 0, 0.55);
    outline: none;
}

/* Ligne CGV */

.iem-dd-form-row-terms {
    margin-top: 4px;
}

.iem-dd-form-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

.iem-dd-form-checkbox {
    margin-top: 2px;
}

.iem-dd-form-checkbox-text a {
    color: #38d0ff;
    text-decoration: none;
    border-bottom: 1px solid rgba(56, 208, 255, 0.6);
}

.iem-dd-form-checkbox-text a:hover,
.iem-dd-form-checkbox-text a:focus-visible {
    color: #ffffff;
    border-color: #ffffff;
    outline: none;
}

/* Payment Element wrapper */

.iem-dd-payment-row {
    margin-top: 4px;
}

.iem-dd-payment-element-wrapper {
    border-radius: 10px;
    padding: 10px 10px 12px 10px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(56, 208, 255, 0.32);
}

/* Bouton paiement + loading */

.iem-dd-form-row-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.iem-dd-pay-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 16px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #ff7a2a, #ff6100);
    color: #ffffff;
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(255, 255, 255, 0.06);
    transition: transform 0.14s ease-out, box-shadow 0.14s ease-out, background 0.14s ease-out, opacity 0.12s ease-out;
}

.iem-dd-pay-button:hover,
.iem-dd-pay-button:focus-visible {
    background: linear-gradient(135deg, #ff8e4a, #ff7a2a);
    box-shadow:
        0 22px 52px rgba(0, 0, 0, 0.9),
        0 0 0 1px rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
    outline: none;
}

.iem-dd-pay-button:active {
    transform: translateY(0);
    box-shadow:
        0 12px 26px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

.iem-dd-pay-button:disabled {
    opacity: 0.7;
    cursor: default;
}

.iem-dd-loading-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}

.iem-dd-loading-spinner {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 2px solid rgba(56, 208, 255, 0.25);
    border-top-color: #38d0ff;
    animation: iem-dd-spin 700ms linear infinite;
}

@keyframes iem-dd-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Erreur & succès */

.iem-dd-error-container {
    margin-top: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.65);
    color: #fecaca;
    font-size: 13px;
}

.iem-dd-success-container {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(56, 208, 255, 0.12);
    border: 1px solid rgba(56, 208, 255, 0.6);
    color: rgba(255, 255, 255, 0.92);
}

.iem-dd-success-title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
}

.iem-dd-success-text {
    margin: 0;
    font-size: 13px;
}

/* Footer modale */

.iem-dd-modal-footer {
    margin-top: 6px;
}

.iem-dd-modal-footer-text {
    margin: 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.78);
}

/* Thème minimal */

.iem-dd-theme-minimal .iem-dd-checkout-header {
    color: #111827;
}

.iem-dd-theme-minimal .iem-dd-brand-label {
    color: #2563eb;
}

.iem-dd-theme-minimal .iem-dd-product-title {
    color: #111827;
}

.iem-dd-theme-minimal .iem-dd-checkout-price {
    background: #f9fafb;
    border-color: #d1d5db;
}

.iem-dd-theme-minimal .iem-dd-checkout-wrapper {
    color: #111827;
}

.iem-dd-theme-minimal .iem-dd-checkout-button {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow:
        0 10px 20px rgba(15, 23, 42, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.02);
}

.iem-dd-theme-minimal .iem-dd-checkout-button:hover,
.iem-dd-theme-minimal .iem-dd-checkout-button:focus-visible {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.iem-dd-theme-minimal .iem-dd-checkout-reassurance {
    color: #4b5563;
}

.iem-dd-theme-minimal .iem-dd-checkout-overlay {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(6px);
}

.iem-dd-theme-minimal .iem-dd-checkout-modal-inner {
    background: #ffffff;
    color: #111827;
    border-color: #e5e7eb;
    box-shadow:
        0 24px 50px rgba(15, 23, 42, 0.45),
        0 0 0 1px rgba(15, 23, 42, 0.35);
}

.iem-dd-theme-minimal .iem-dd-modal-title {
    color: #111827;
}

.iem-dd-theme-minimal .iem-dd-modal-subtitle {
    color: #4b5563;
}

.iem-dd-theme-minimal .iem-dd-form-label {
    color: #111827;
}

.iem-dd-theme-minimal .iem-dd-form-input {
    background: #ffffff;
    border-color: #d1d5db;
    color: #111827;
}

.iem-dd-theme-minimal .iem-dd-form-input::placeholder {
    color: #9ca3af;
}

.iem-dd-theme-minimal .iem-dd-form-input:focus-visible {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.iem-dd-theme-minimal .iem-dd-payment-element-wrapper {
    background: #f9fafb;
    border-color: #e5e7eb;
}

.iem-dd-theme-minimal .iem-dd-modal-footer-text {
    color: #6b7280;
}

/* Thème sales-dark */

.iem-dd-theme-sales-dark .iem-dd-checkout-wrapper {
    color: #e5e7eb;
}

.iem-dd-theme-sales-dark .iem-dd-brand-label {
    color: #f97316;
}

.iem-dd-theme-sales-dark .iem-dd-product-title {
    color: #f9fafb;
}

.iem-dd-theme-sales-dark .iem-dd-checkout-price {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(249, 115, 22, 0.5);
}

.iem-dd-theme-sales-dark .iem-dd-checkout-button {
    background: linear-gradient(135deg, #f97316, #ea580c);
    box-shadow:
        0 16px 40px rgba(15, 23, 42, 0.8),
        0 0 0 1px rgba(249, 115, 22, 0.2);
}

.iem-dd-theme-sales-dark .iem-dd-checkout-button:hover,
.iem-dd-theme-sales-dark .iem-dd-checkout-button:focus-visible {
    background: linear-gradient(135deg, #ea580c, #c2410c);
}

.iem-dd-theme-sales-dark .iem-dd-checkout-reassurance {
    color: #9ca3af;
}

.iem-dd-theme-sales-dark .iem-dd-checkout-overlay {
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(8px);
}

.iem-dd-theme-sales-dark .iem-dd-checkout-modal-inner {
    background:
        radial-gradient(circle at top left, rgba(249, 115, 22, 0.24), transparent 60%),
        radial-gradient(circle at bottom right, rgba(3, 105, 161, 0.3), transparent 60%),
        linear-gradient(135deg, #020617, #0b1120);
    color: #e5e7eb;
    border-color: rgba(249, 115, 22, 0.5);
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.9),
        0 0 0 1px rgba(15, 23, 42, 0.9);
}

.iem-dd-theme-sales-dark .iem-dd-form-label {
    color: #e5e7eb;
}

.iem-dd-theme-sales-dark .iem-dd-form-input {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(249, 115, 22, 0.5);
    color: #e5e7eb;
}

.iem-dd-theme-sales-dark .iem-dd-form-input::placeholder {
    color: #6b7280;
}

.iem-dd-theme-sales-dark .iem-dd-form-input:focus-visible {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.36);
}

.iem-dd-theme-sales-dark .iem-dd-payment-element-wrapper {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(30, 64, 175, 0.7);
}

.iem-dd-theme-sales-dark .iem-dd-modal-footer-text {
    color: #9ca3af;
}

/* Thème custom : base neutre */

.iem-dd-theme-custom .iem-dd-checkout-wrapper {
    color: inherit;
}

.iem-dd-theme-custom .iem-dd-checkout-button,
.iem-dd-theme-custom .iem-dd-checkout-modal-inner,
.iem-dd-theme-custom .iem-dd-checkout-overlay {
    box-shadow: none;
}

/* Responsif */

@media (max-width: 768px) {
    .iem-dd-checkout-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .iem-dd-checkout-button {
        width: 100%;
        min-width: 0;
    }

    .iem-dd-checkout-modal {
        padding: 24px 12px;
    }

    .iem-dd-checkout-modal-inner {
        border-radius: 16px;
        padding: 18px 16px 14px 16px;
    }
}

@media (max-width: 480px) {
    .iem-dd-product-title {
        font-size: 16px;
    }

    .iem-dd-modal-title {
        font-size: 18px;
    }

    .iem-dd-checkout-modal-inner {
        padding: 16px 12px 12px 12px;
    }
}

/* Focus visible global */

.iem-dd-checkout-wrapper button:focus-visible,
.iem-dd-checkout-wrapper input:focus-visible,
.iem-dd-checkout-wrapper a:focus-visible {
    outline: 2px solid #38d0ff;
    outline-offset: 2px;
}