/**
 * Thelis — Page Contact
 * Préfixe : .ct-
 *
 * Concept : "Engineering Brief" — formulaire de briefing précis + carte dark.
 * Hero sombre avec titre Cormorant et "real." en italique rouge.
 * Formulaire sur fond warm off-white avec floating labels, sélecteur de domaine,
 * underline rouge animé au focus, soumission avec hover fill.
 * Carte Leaflet Carto dark + marqueur rouge pulsant.
 */

/* ══ Suppression des overrides Blocksy ══════════════════════════════════════ */

#primary.thelis-contact {
    padding: 0 !important;
    margin-top: 0 !important;
    max-width: none !important;
}

/* ══ Sections — fonds ═══════════════════════════════════════════════════════ */

#primary.thelis-contact .ct-hero {
    background: #111118 !important;
}

#primary.thelis-contact .ct-main {
    background: #f7f5f1 !important;
}

/* ══ HERO ════════════════════════════════════════════════════════════════════ */

.ct-hero {
    position: relative;
    min-height: clamp(380px, 52vh, 560px);
    display: flex;
    align-items: center;
    overflow: hidden;
    background: #111118; /* fallback si photo absente */
}

/* Photo de fond */
.ct-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.ct-hero-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 38%;
    display: block;
    filter: brightness(0.44) saturate(0.62);
}

/* Overlay gradient — plus sombre à gauche (texte), plus ouvert à droite (bâtiment) */
.ct-hero-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        108deg,
        rgba(17, 17, 24, 0.62) 0%,
        rgba(17, 17, 24, 0.34) 55%,
        rgba(17, 17, 24, 0.10) 100%
    );
}

/* Lettre fantôme */
.ct-hero-ghost {
    position: absolute;
    top: 50%;
    left: -0.06em;
    transform: translateY(-52%);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(220px, 30vw, 400px);
    font-weight: 600;
    line-height: 1;
    color: rgba(232, 41, 74, 0.022);
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

.ct-hero-inner {
    position: relative;
    z-index: 1;
    padding: clamp(60px, 8vh, 100px) 0;
    max-width: 680px;
}

/* Label eyebrow */
.ct-hero-label {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #E8294A !important;
    margin-bottom: 20px;
    /* Animation page load */
    opacity: 0;
    animation: ctHeroReveal 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;
}

.ct-label-line {
    display: block;
    width: 28px;
    height: 1px;
    background: #E8294A;
    flex-shrink: 0;
    opacity: 0.7;
}

/* Titre principal — même police que les titres de section (Syne 700) */
.ct-hero-title {
    font-family: 'Syne', sans-serif;
    font-size: clamp(50px, 7.5vw, 88px);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -2px;
    color: #ffffff !important;
    margin: 0 0 22px;
    opacity: 0;
    animation: ctHeroReveal 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) 0.34s both;
}

/* Syne n'a pas d'italic distinctif — on garde la couleur rouge comme différenciation */
.ct-hero-title em {
    font-style: normal;
    color: #E8294A !important;
}

/* Sous-titre */
.ct-hero-sub {
    font-family: 'Syne', sans-serif;
    font-size: 16px;
    font-weight: 300;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.58) !important;
    margin: 0 0 36px;
    max-width: 520px;
    opacity: 0;
    animation: ctHeroReveal 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.54s both;
}

/* Chips de contact */
.ct-hero-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    opacity: 0;
    animation: ctHeroReveal 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.70s both;
}

.ct-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.65) !important;
    text-decoration: none !important;
    transition: border-color 0.25s ease, color 0.25s ease;
}

.ct-chip:hover {
    border-color: rgba(232, 41, 74, 0.40);
    color: #ffffff !important;
}

.ct-chip-dash {
    color: #E8294A !important;
    font-size: 12px;
    line-height: 1;
}

/* ══ Keyframe hero ══════════════════════════════════════════════════════════ */

@keyframes ctHeroReveal {
    from {
        opacity: 0;
        transform: translateY(28px);
        filter: blur(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* ══ SECTION PRINCIPALE ═════════════════════════════════════════════════════ */

.ct-main {
    padding: 100px 0 120px;
}

/* Grille 58 / 42 */
.ct-grid {
    display: grid;
    grid-template-columns: 58fr 42fr;
    gap: 80px;
    align-items: start;
}

/* Label de colonne */
.ct-col-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #E8294A !important;
    margin-bottom: 36px;
}

/* ══ FORMULAIRE ═════════════════════════════════════════════════════════════ */

/* ── Sélecteur de domaine ── */

.ct-domain-group {
    margin-bottom: 40px;
}

.ct-domain-heading {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(17, 17, 24, 0.38) !important;
    margin-bottom: 12px;
}

.ct-domains {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ct-domain-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid rgba(17, 17, 24, 0.12);
    border-radius: 2px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(17, 17, 24, 0.52);
    cursor: pointer;
    transition: border-color 0.22s ease, color 0.22s ease, background 0.22s ease;
    line-height: 1;
}

.ct-domain-btn:hover {
    border-color: #E8294A;
    color: #E8294A;
}

.ct-domain-btn--active {
    background: #E8294A !important;
    border-color: #E8294A !important;
    color: #ffffff !important;
}

/* ── Colonne formulaire — fond blanc pour contraster avec la section #f7f5f1 ── */

.ct-form-col {
    background: #ffffff;
    padding: 44px 40px 48px;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(17, 17, 24, 0.06), 0 8px 32px rgba(17, 17, 24, 0.05);
}

.hidden-fields-container
{
    display:none;
}


/* ── Champs avec labels flottants ── */

.ct-field {
    position: relative;
    padding-top: 28px; /* espace réservé pour le label flottant */
    margin-bottom: 18px;
    border-bottom: 2px solid rgba(17, 17, 24, 0.14);
    transition: border-bottom-color 0.28s ease;
}

/* Underline rouge animé au focus */
.ct-field::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #E8294A;
    transition: width 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.ct-field:focus-within::after,
.ct-field--error::after {
    width: 100%;
}

.ct-field--textarea {
    margin-bottom: 24px;
    border-bottom: none; /* textarea a son propre cadre */
    padding-top: 0;
}

/* Label flottant — placeholder-like dans l'état par défaut */
.ct-lbl {
    position: absolute;
    /* Aligné avec la baseline du texte saisi : padding-top (28) + input padding-top (8) */
    top: 36px;
    left: 0;
    font-family: 'Syne', sans-serif;
    font-size: 15px;
    font-weight: 300;
    letter-spacing: 0;
    text-transform: none;
    color: rgba(17, 17, 24, 0.36);
    transition:
        top 0.22s ease,
        font-size 0.22s ease,
        letter-spacing 0.22s ease,
        color 0.22s ease;
    pointer-events: none;
    line-height: 1;
}

/* État flottant — focus ou rempli : petit label technique au-dessus */
.ct-field:focus-within .ct-lbl,
.ct-field--filled .ct-lbl {
    top: 6px;
    font-size: 9px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #E8294A;
}

.ct-field--error .ct-lbl {
    color: #E8294A !important;
}

.ct-req {
    color: #E8294A;
    margin-left: 3px;
    font-style: normal;
}

.ct-opt {
    color: rgba(17, 17, 24, 0.30);
    font-size: 0.70em; /* proportionnel : ~11px en default, ~6px en floated */
    letter-spacing: 0;
    font-weight: 300;
    margin-left: 5px;
    text-transform: none;
}

/* Input + textarea */
.ct-input,
.ct-textarea {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    padding: 8px 0 10px;
    font-family: 'Syne', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #111118;
    -webkit-appearance: none;
    appearance: none;
    line-height: 1.5;
}

.ct-textarea {
    resize: none;
    display: block;
    border: 1.5px solid rgba(17, 17, 24, 0.14) !important;
    border-radius: 2px;
    padding: 14px 16px !important;
    transition: border-color 0.28s ease;
}

.ct-textarea:focus,
.ct-textarea:focus-visible {
    border-color: #E8294A !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Label statique au-dessus de la textarea (pas flottant) */
.ct-field--textarea .ct-lbl {
    position: static;
    display: block;
    font-size: 9px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: rgba(17, 17, 24, 0.45);
    margin-bottom: 10px;
    transition: color 0.22s ease;
}

.ct-field--textarea:focus-within .ct-lbl {
    color: #E8294A;
}

/* Supprime le pseudo-élément ::after (underline) sur la textarea */
.ct-field--textarea::after {
    display: none;
}

.ct-input::placeholder,
.ct-textarea::placeholder {
    color: transparent; /* masqué — label flottant remplace */
}

/* Éliminer toute outline et box-shadow navigateur/Blocksy */
.ct-input:focus,
.ct-input:focus-visible,
.ct-textarea:focus,
.ct-textarea:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border-color: transparent !important; /* Blocksy peut ajouter border sur focus */
}

/* ── Bouton d'envoi ── */

/* Sélecteur renforcé (#primary) pour battre les règles Blocksy sur button */
#primary .ct-submit {
    width: 100%;
    margin-top: 36px;
    padding: 18px 28px;
    background: #E8294A !important;
    background-color: #E8294A !important;
    border: none !important;
    outline: none;
    cursor: pointer;
    font-family: 'Syne', sans-serif !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 2.5px !important;
    text-transform: uppercase !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    border-radius: 2px !important;
    box-shadow: none;
    transition: box-shadow 0.25s ease;
}

/* Fill sombre de gauche à droite au hover */
#primary .ct-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #c91e38;
    transform: translateX(-100%);
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 0;
}

#primary .ct-submit:hover,
#primary .ct-submit:focus {
    background: #E8294A !important;
    background-color: #E8294A !important;
    color: #ffffff !important;
    box-shadow: 0 8px 32px rgba(232, 41, 74, 0.32) !important;
}

#primary .ct-submit:hover::before {
    transform: translateX(0);
}

#primary .ct-submit-label,
#primary .ct-submit-arrow {
    position: relative;
    z-index: 1;
    color: #ffffff !important;
}

.ct-submit-arrow {
    font-size: 18px;
    transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ct-submit:hover .ct-submit-arrow {
    transform: translateX(7px);
}

/* ── Alerte + succès ── */

.ct-alert {
    padding: 14px 18px;
    border-left: 3px solid #E8294A;
    background: rgba(232, 41, 74, 0.06);
    font-family: 'Syne', sans-serif;
    font-size: 13px;
    color: rgba(17, 17, 24, 0.72) !important;
    margin-bottom: 28px;
    border-radius: 0 2px 2px 0;
}

.ct-success {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 32px;
    border: 1px solid rgba(232, 41, 74, 0.18);
    border-top: 3px solid #E8294A;
    background: rgba(232, 41, 74, 0.04);
    border-radius: 0 0 2px 2px;
}

.ct-success-mark {
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    color: #E8294A;
    flex-shrink: 0;
    margin-top: 2px;
}

.ct-success strong {
    font-family: 'Syne', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #111118;
    display: block;
    margin-bottom: 5px;
}

.ct-success p {
    font-family: 'Syne', sans-serif;
    font-size: 14px;
    color: rgba(17, 17, 24, 0.55) !important;
    margin: 0;
}

/* ══ CARTE LEAFLET ══════════════════════════════════════════════════════════ */

.ct-map {
    width: 100%;
    height: 260px;
    border: 1px solid rgba(17, 17, 24, 0.12);
    overflow: hidden;
    margin-bottom: 0;
    background: #e8e5df; /* fallback warm light — correspond aux tuiles Carto Positron */
}

/* Marqueur personnalisé */
.ct-marker {
    background: none !important;
    border: none !important;
}

.ct-marker-core {
    width: 14px;
    height: 14px;
    background: #E8294A;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(232, 41, 74, 0.22), 0 0 18px rgba(232, 41, 74, 0.50);
    animation: ctMarkerPulse 2.4s ease-in-out infinite;
}

@keyframes ctMarkerPulse {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(232, 41, 74, 0.22), 0 0 18px rgba(232, 41, 74, 0.50);
    }
    50% {
        box-shadow: 0 0 0 9px rgba(232, 41, 74, 0.08), 0 0 30px rgba(232, 41, 74, 0.65);
    }
}

/* Override attributions Leaflet — fond clair */
.ct-map .leaflet-control-attribution {
    font-size: 9px;
    background: rgba(255, 255, 255, 0.75) !important;
    color: rgba(17, 17, 24, 0.45) !important;
}

.ct-map .leaflet-control-attribution a {
    color: #E8294A !important;
}

/* ══ DÉTAILS DE CONTACT ══════════════════════════════════════════════════════ */

.ct-details {
    border: 1px solid rgba(17, 17, 24, 0.07);
    border-top: 2px solid #E8294A;
    margin-top: 0;
}

.ct-detail {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 12px;
    align-items: start;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(17, 17, 24, 0.055);
}

.ct-detail:last-child {
    border-bottom: none;
}

.ct-detail-key {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: rgba(17, 17, 24, 0.36) !important;
    padding-top: 3px;
    line-height: 1.4;
}

.ct-detail-val {
    font-family: 'Syne', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #111118 !important;
    font-style: normal;
    line-height: 1.55;
}

.ct-detail-phone {
    text-decoration: none !important;
    transition: color 0.22s ease;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: 1px;
}

.ct-detail-phone:hover {
    color: #E8294A !important;
}

.ct-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.ct-detail-tags span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 3px 8px;
    border: 1px solid rgba(17, 17, 24, 0.09);
    color: rgba(17, 17, 24, 0.42) !important;
    border-radius: 1px;
}

/* ══ Responsive — 1200px ════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
    .ct-grid {
        gap: 56px;
    }
}

/* ══ Responsive — 1024px ════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .ct-grid {
        grid-template-columns: 1fr;
        gap: 64px;
    }

    .ct-hero-inner {
        max-width: 100%;
    }

    .ct-main {
        padding: 80px 0 96px;
    }
}

/* ══ Responsive — 768px ═════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .ct-hero-title {
        font-size: clamp(44px, 11vw, 64px);
        letter-spacing: -1.5px;
    }

    .ct-hero-sub {
        font-size: 15px;
    }

    .ct-main {
        padding: 60px 0 72px;
    }

    .ct-chip {
        font-size: 10px;
        padding: 8px 12px;
    }
}

/* ══ Responsive — 480px ═════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .ct-domain-btn {
        font-size: 9px;
        padding: 7px 12px;
    }

    .ct-submit {
        padding: 16px 20px;
    }

    .ct-map {
        height: 220px;
    }
}

/* ══ CF7 — Resets structurels ═══════════════════════════════════════════════ */

/* Supprime TOUTE bordure du wrapper et du formulaire CF7 */
.wpcf7,
.wpcf7 form,
.wpcf7-form,
.wpcf7-form.invalid,
.wpcf7-form.unaccepted,
.wpcf7-form.sent,
.wpcf7-form.failed {
    border: none !important;
    outline: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
}

/* Span wrapper CF7 autour de chaque input — rendu block sans marges parasites */
.wpcf7-form-control-wrap {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* ── Response output — masqué par défaut, quelle que soit la version CF7 ── */
/* Stratégie robuste : toujours caché, sauf quand CF7 ajoute une classe de statut */
.wpcf7-response-output {
    display: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* ══ CF7 — États de validation ══════════════════════════════════════════════ */

/* Champ invalide : underline rouge seulement (pas de boîte) */
.wpcf7-not-valid.ct-input {
    border: none !important;
    border-bottom-color: #E8294A !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Textarea invalide : cadre rouge */
.wpcf7-not-valid.ct-textarea {
    border-color: #E8294A !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Checkbox group invalide — aucun cadre visible, erreur portée par le tip */
.wpcf7-not-valid.wpcf7-checkbox,
.ct-domains .wpcf7-not-valid,
span.wpcf7-not-valid {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* Tip d'erreur sous le champ */
.wpcf7-not-valid-tip {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #E8294A !important;
    margin-top: 5px;
    display: block;
}

/* Message de retour global */
.wpcf7-response-output {
    font-family: 'Syne', sans-serif;
    font-size: 13px;
    padding: 14px 18px;
    border-radius: 0 2px 2px 0;
    margin-top: 20px;
    border-left: 3px solid rgba(17, 17, 24, 0.3) !important;
    border-top: none !important;
    border-right: none !important;
    border-bottom: none !important;
    background: rgba(17, 17, 24, 0.04);
    color: rgba(17, 17, 24, 0.65) !important;
}

.wpcf7-mail-sent-ok.wpcf7-response-output {
    border-left-color: #E8294A !important;
    background: rgba(232, 41, 74, 0.05);
    color: rgba(17, 17, 24, 0.72) !important;
}

/* Spinner CF7 */
.wpcf7-spinner {
    display: none;
}

/* ══ CF7 — Domain checkboxes → toggle buttons ═══════════════════════════════ */

/* Container des checkboxes CF7 */
.ct-domains .wpcf7-checkbox {
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px;
}

.ct-domains .wpcf7-list-item {
    display: inline-flex !important;
    margin: 0 !important;
}

.ct-domains .wpcf7-list-item label {
    display: flex;
    cursor: pointer;
    margin: 0;
}

/* Masque la vraie checkbox */
.ct-domains .wpcf7-list-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Label stylé en pill-button */
.ct-domains .wpcf7-list-item-label {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid rgba(17, 17, 24, 0.12);
    border-radius: 2px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(17, 17, 24, 0.52) !important;
    cursor: pointer;
    transition: border-color 0.22s ease, color 0.22s ease, background 0.22s ease;
    line-height: 1;
    user-select: none;
}

.ct-domains .wpcf7-list-item-label:hover {
    border-color: #E8294A;
    color: #E8294A !important;
}

/* État coché — fond rouge plein */
.ct-domains .wpcf7-list-item input:checked + .wpcf7-list-item-label {
    background: #E8294A;
    border-color: #E8294A;
    color: #ffffff !important;
}
