/*
Theme Name: MindForge.ia Futurist
Theme URI: https://mindforge.ia
Author: Toi + GPT
Description: Thème one-page futuriste avec animations pour le pack IA MindForge.ia
Version: 1.1
Text Domain: mindforgeia-futurist
*/

/* Reset basique */
body {
    margin: 0;
}

/************************************
 * CHECKOUT MINDFORGE – VERSION CLEAN
 ************************************/

/* 1. Fond global du checkout */
body.woocommerce-checkout {
    background: radial-gradient(circle at top, #1b2b60 0%, #050817 55%, #02030a 100%);
    color: #f4f6ff;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", sans-serif;
    overflow-x: hidden; /* évite le scroll horizontal sur mobile */
}

/* 2. Conteneur principal du bloc checkout */
body.woocommerce-checkout .wp-block-woocommerce-checkout.alignwide {
    max-width: 1100px;
    margin: 32px auto 40px;
    padding: 24px;
    border-radius: 24px;
    background: rgba(4, 9, 30, 0.96);
    border: 1px solid rgba(120, 164, 255, 0.25);
    box-shadow: 0 26px 80px rgba(5, 10, 40, 0.85);
}

/* 3. Layout colonnes : on laisse Woo gérer ses colonnes internes */
body.woocommerce-checkout .wp-block-woocommerce-checkout {
    display: block; /* surtout PAS de grid ici */
}

body.woocommerce-checkout .wc-block-checkout__columns {
    display: flex;
    align-items: flex-start;
    gap: 32px;
}

body.woocommerce-checkout .wc-block-checkout__main {
    flex: 1.6;
}

body.woocommerce-checkout .wc-block-checkout__sidebar {
    flex: 1;
}

/* Mobile : tout en colonne, largeur auto */
@media (max-width: 900px) {
    body.woocommerce-checkout .wp-block-woocommerce-checkout.alignwide {
        margin: 12px;
        padding: 14px;
        border-radius: 18px;
        width: auto;
        max-width: 100%;
        box-sizing: border-box;
        box-shadow: 0 18px 50px rgba(3, 7, 33, 0.9);
    }

    body.woocommerce-checkout .wc-block-checkout__columns {
        flex-direction: column;
        gap: 24px;
    }

    body.woocommerce-checkout .wc-block-checkout__sidebar {
        width: 100%;
        margin-top: 4px;
    }
}

/* 4. Titres / sections */
body.woocommerce-checkout h1,
body.woocommerce-checkout h2,
body.woocommerce-checkout h3 {
    font-family: inherit;
    font-weight: 700;
    letter-spacing: .02em;
    color: #f9fbff;
}

body.woocommerce-checkout h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

body.woocommerce-checkout h2 {
    font-size: 1.25rem;
    margin: 18px 0 10px;
}

/* 5. Labels au-dessus des champs */
body.woocommerce-checkout .wc-block-components-text-input label,
body.woocommerce-checkout .wc-block-components-address-form__field-label {
    font-size: 12px;
    font-weight: 500;
    color: rgba(229, 231, 235, 0.9);
    margin-bottom: 6px;
}

/* 6. Champs ultra lisibles (inputs / selects / textarea) */
body.woocommerce-checkout .wc-block-components-text-input input,
body.woocommerce-checkout .wc-block-components-text-input textarea,
body.woocommerce-checkout .wc-block-components-address-form input,
body.woocommerce-checkout .wc-block-components-address-form select,
body.woocommerce-checkout select {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.55);
    background: #050816;           /* fond sombre uniforme (PLUS de dégradé) */
    color: #f9fafb;
    padding: 12px 16px;
    font-size: 16px;               /* 16px pour éviter le zoom automatique sur iPhone */
    line-height: 1.4;
    box-shadow: none;
    outline: none;
}

/* Placeholders lisibles */
body.woocommerce-checkout .wc-block-components-text-input input::placeholder,
body.woocommerce-checkout .wc-block-components-text-input textarea::placeholder {
    color: rgba(156, 163, 175, 0.9);
}

/* Focus : simple contour lumineux propre */
body.woocommerce-checkout .wc-block-components-text-input input:focus,
body.woocommerce-checkout .wc-block-components-text-input textarea:focus,
body.woocommerce-checkout .wc-block-components-address-form input:focus,
body.woocommerce-checkout .wc-block-components-address-form select:focus,
body.woocommerce-checkout select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 1px #60a5fa;
    outline: none;
}

/* 7. Messages d’erreur sous les champs */
body.woocommerce-checkout .wc-block-components-validation-error,
body.woocommerce-checkout .wc-block-components-validation-error span {
    color: #ff9b9b;
    font-size: 12px;
}

/* 8. Bouton principal “Commander” */
body.woocommerce-checkout .wc-block-components-checkout-place-order-button,
body.woocommerce-checkout .wc-block-components-checkout-place-order-button button,
body.woocommerce-checkout .wc-block-components-button {
    border-radius: 999px !important;
    border: none;
    background: linear-gradient(135deg, #3b82ff, #8b5cf6);
    color: #fdfdff;
    font-weight: 600;
    font-size: 15px;
    padding: 14px 28px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: 0 18px 45px rgba(58, 124, 255, 0.6);
    transition: transform .12s ease-out, box-shadow .12s ease-out, filter .12s ease-out;
}

body.woocommerce-checkout .wc-block-components-checkout-place-order-button:hover,
body.woocommerce-checkout .wc-block-components-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 26px 60px rgba(58, 124, 255, 0.75);
    filter: brightness(1.04);
}

body.woocommerce-checkout .wc-block-components-checkout-place-order-button:active,
body.woocommerce-checkout .wc-block-components-button:active {
    transform: translateY(0);
    box-shadow: 0 10px 30px rgba(58, 124, 255, 0.6);
}

/* 9. Carte résumé commande (sidebar) */
body.woocommerce-checkout .wp-block-woocommerce-checkout-totals-block {
    border-radius: 20px;
    background: radial-gradient(circle at top, rgba(43, 65, 150, 0.75), rgba(6, 9, 36, 0.98));
    padding: 18px 18px 20px;
    border: 1px solid rgba(138, 180, 255, 0.4);
}

body.woocommerce-checkout .wp-block-woocommerce-checkout-order-summary-block {
    border: none;
    padding: 0;
}

/* Lignes totaux + mini-texte */
body.woocommerce-checkout .wc-block-components-totals-item,
body.woocommerce-checkout .wc-block-components-order-summary-item__description {
    color: rgba(230, 238, 255, 0.9);
}

/* Prix / total bien visibles */
body.woocommerce-checkout .wc-block-components-formatted-money-amount {
    font-weight: 600;
    color: #fefeff;
}

/* 10. Supprimer l’overlay "is-loading" de Woo qui faisait un voile transparent */
body.woocommerce-checkout .wc-block-checkout.is-loading {
    opacity: 1 !important;
    filter: none !important;
    pointer-events: auto !important;
}

body.woocommerce-checkout .wc-block-checkout.is-loading::before,
body.woocommerce-checkout .wc-block-checkout.is-loading .wc-block-components-spinner {
    display: none !important;
}

/* 11. Sécurité : si jamais on avait créé un overlay custom avant */
.mindforge-checkout-card::before,
.mindforge-checkout-overlay {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
/************************************
 * PATCH FORCE – CHAMPS + MOBILE
 ************************************/

/* Champs texte / textarea / selects : fond uni + texte lisible */
body.woocommerce-checkout input,
body.woocommerce-checkout textarea,
body.woocommerce-checkout select {
    font-size: 16px !important;               /* évite le zoom iPhone */
    background: #050816 !important;           /* plus de dégradé */
    color: #f9fafb !important;
    background-image: none !important;        /* supprime tout dégradé injecté */
    border-radius: 12px !important;
    border: 1px solid rgba(148, 163, 184, 0.65) !important;
    box-shadow: none !important;
}

/* Placeholders bien contrastés */
body.woocommerce-checkout input::placeholder,
body.woocommerce-checkout textarea::placeholder {
    color: rgba(156, 163, 175, 0.9) !important;
}

/* Focus propre sans gros glow */
body.woocommerce-checkout input:focus,
body.woocommerce-checkout textarea:focus,
body.woocommerce-checkout select:focus {
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 1px #60a5fa !important;
    outline: none !important;
}

/* Empêche toute largeur > viewport (zoom / décalage sur mobile) */
html,
body,
body.woocommerce-checkout {
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* Le conteneur du checkout ne doit JAMAIS dépasser 100% */
body.woocommerce-checkout .wp-block-woocommerce-checkout.alignwide,
body.woocommerce-checkout .wc-block-checkout__columns,
body.woocommerce-checkout .wc-block-checkout__main,
body.woocommerce-checkout .wc-block-checkout__sidebar {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Sur mobile : on enlève les marges agressives et les bords qui forcent le zoom */
@media (max-width: 900px) {
    body.woocommerce-checkout .wp-block-woocommerce-checkout.alignwide {
        margin: 0 !important;
        padding: 16px !important;
        border-radius: 0 !important;
        width: 100% !important;
    }

    body.woocommerce-checkout .wc-block-checkout__columns {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }

    body.woocommerce-checkout .wc-block-checkout__sidebar {
        width: 100% !important;
        margin-top: 0 !important;
    }
}

/* Voile de chargement WooCommerce (on le tue totalement) */
body.woocommerce-checkout .wc-block-checkout.is-loading,
body.woocommerce-checkout .wc-block-checkout::before,
body.woocommerce-checkout .wc-block-checkout .wc-block-components-spinner {
    opacity: 1 !important;
    filter: none !important;
    display: none !important;
    pointer-events: auto !important;
}

/* Si jamais un overlay custom traîne encore */
.mindforge-checkout-overlay,
.mindforge-checkout-card::before {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
