/* =========================================================
   Soft Finanz Group — styles additionnels pour les fonctionnalités portées
   depuis AIC Finanz (simulateur, formulaire de demande, chat, cookies,
   sélecteur de langue). Couleurs alignées sur assets/css/style.css (:root) :
   --loanlift-primary-bg (#061525) / accent (#BE5518).
   ========================================================= */

.ll-form-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(6, 21, 37, 0.08);
  padding: 40px;
  height: 100%;
}
@media only screen and (max-width: 767px) {
  .ll-form-card { padding: 26px 20px; }
}
.ll-step-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #BE5518;
  margin-bottom: 6px;
  display: block;
}
.ll-card-title {
  font-size: 24px;
  line-height: 1.3;
  font-family: var(--loanlift-heading-font);
  color: var(--loanlift-text-black);
  margin-bottom: 18px;
}

/* ---- Simulateur : étape 1 pleine largeur, transition vers 2 colonnes ---- */
.aic-sim-row {
  display: grid;
  grid-template-columns: 1fr 0fr;
  gap: 0 24px;
  align-items: stretch;
  transition: grid-template-columns 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.aic-sim-row.is-simulated { grid-template-columns: 0.44fr 0.56fr; }
.aic-sim-col-form, .aic-sim-col-results { min-width: 0; }
.aic-sim-col-results { overflow: hidden; opacity: 0; transition: opacity 0.4s ease; }
.aic-sim-row.is-simulated .aic-sim-col-results { opacity: 1; transition: opacity 0.4s ease 0.25s; }
@media only screen and (max-width: 991px) {
  .aic-sim-row, .aic-sim-row.is-simulated { display: block; transition: none; }
  .aic-sim-col-results { margin-top: 24px; max-height: 0; opacity: 0; transition: max-height 0.5s ease, opacity 0.4s ease; }
  .aic-sim-row.is-simulated .aic-sim-col-results { max-height: 2000px; opacity: 1; }
}
.aic-field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--loanlift-text-black);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.aic-form-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--loanlift-text-black);
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(6,21,37,0.08);
  margin-top: 24px;
  margin-bottom: 8px;
}
.aic-sim-disclaimer { font-size: 12px; line-height: 1.6; color: var(--loanlift-text-dark-grey); }
.aic-sim-table-caption { caption-side: top; padding: 0 0 10px; font-size: 12px; color: var(--loanlift-text-dark-grey); text-align: left; }
.aic-sim-summary { --bs-gutter-x: 1rem; }
.aic-sim-summary__label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--loanlift-text-dark-grey); margin-bottom: 4px; }
.aic-sim-summary__value { display: block; font-size: 17px; font-weight: 700; color: var(--loanlift-text-black); margin-bottom: 16px; }
.aic-sim-table-wrap { max-height: 340px; overflow-y: auto; border: 1px solid rgba(6,21,37,0.08); border-radius: 6px; }
.aic-sim-table { margin: 0; font-size: 13px; width: 100%; }
.aic-sim-table thead th { position: sticky; top: 0; background: var(--loanlift-secondary-bg); color: var(--loanlift-text-black); font-weight: 700; border-bottom: none; z-index: 1; }
.aic-sim-table td, .aic-sim-table th { padding: 10px 12px; white-space: nowrap; }
.aic-sim-recap { background: var(--loanlift-secondary-bg); border-radius: 6px; padding: 12px 16px; font-size: 14px; color: var(--loanlift-text-black); }

/* ---- Téléphone (préfixe pays + numéro) ---- */
.phone-input-group { display: flex; gap: 10px; }
.phone-input-group select.phone-code-select {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.phone-input-group .phone-code-picker { position: relative; flex: 0 0 150px; width: 150px; }
.phone-input-group input[type="tel"] { flex: 1 1 auto; min-width: 0; margin-bottom: 0; }
.phone-code-trigger {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 55px;
  font-size: 14px; font-family: inherit; color: rgba(6,21,37,0.85);
  background-color: var(--loanlift-secondary-bg); padding: 10px 14px;
  border: 1px solid #e4e4e4; border-radius: 5px; cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.phone-code-trigger:focus, .phone-code-trigger[aria-expanded="true"] {
  outline: none; border-color: #BE5518; box-shadow: 0 0 0 3px rgba(190,85,24,0.15);
}
.phone-code-trigger .fi { flex-shrink: 0; border-radius: 2px; width: 20px; height: 15px; background-size: cover; }
.phone-code-trigger-text { flex: 1 1 auto; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-code-trigger .fa-angle-down { flex-shrink: 0; font-size: 12px; color: #7c898d; }
.phone-code-list {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: 250px;
  max-height: 280px; overflow-y: auto; margin: 0; padding: 6px; list-style: none;
  background: #fff; border: 1px solid #e4e4e4; border-radius: 8px; box-shadow: 0 12px 34px rgba(6,21,37,0.16);
}
.phone-code-list li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 13px; color: #16222d; border-radius: 6px; cursor: pointer; }
.phone-code-list li .fi { flex-shrink: 0; border-radius: 2px; width: 20px; height: 15px; background-size: cover; }
.phone-code-list li:hover, .phone-code-list li:focus { background: #ecf0f4; outline: none; }
.phone-code-list li.is-active { background: rgba(190,85,24,0.15); font-weight: 600; }
@media only screen and (max-width: 480px) {
  .phone-input-group { flex-wrap: wrap; }
  .phone-input-group .phone-code-picker { flex: 1 1 100%; width: 100%; }
  .phone-code-list { width: 100%; }
}

/* ---- Sélecteur de langue (remplace le bouton recherche dans .main-menu-right) ----
   Icône seule (drapeau) sur mobile/tablette (<=1024px, même palier que le burger
   du thème), drapeau + code langue sur desktop. */
.lang-switcher { position: relative; margin-right: 18px; }
.lang-switcher__current {
  display: flex; align-items: center; gap: 7px; background: none; border: none;
  cursor: pointer; padding: 0; font-family: inherit;
}
/* !important: style.css has a generic ".main-header-four .main-menu-right span"
   rule (the original template's phone/search divider bar, width:1px height:51px)
   that otherwise hijacks the flag <span> and code <span> below — both are plain
   <span> elements inside .main-menu-right, so they matched that selector and
   rendered as two thin vertical bars instead of the flag/text (#reported bug). */
.lang-switcher__flag {
  width: 22px !important; height: 16px !important; border-radius: 3px !important;
  background-color: transparent !important; box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
  flex-shrink: 0; display: inline-block !important;
}
.lang-switcher__code {
  width: auto !important; height: auto !important; background-color: transparent !important;
  display: inline-block !important;
  font-size: 13px; font-weight: 700; letter-spacing: 0.4px;
}
/* Home header (.main-header, plain): transparent over a dark hero image in both
   its default and sticky state, so the code/chevron stay light-colored always. */
.main-header .lang-switcher__code,
.main-header .lang-switcher__current .fa-chevron-down { color: var(--loanlift-text-light); }
/* Inner-page header (.main-header-four): white/light background by default
   (dark text), swaps to a dark blurred background only once
   .sticky-header--cloned.sticky-fixed is added on scroll (light text then) —
   the exact opposite of the home header, and of what this rule had before. */
.main-header-four .lang-switcher__code,
.main-header-four .lang-switcher__current .fa-chevron-down { color: var(--loanlift-text-black); }
.main-header-four.sticky-header--cloned.sticky-fixed .lang-switcher__code,
.main-header-four.sticky-header--cloned.sticky-fixed .lang-switcher__current .fa-chevron-down { color: var(--loanlift-text-light); }
.lang-switcher__current .fa-chevron-down { font-size: 9px; }
.lang-switcher__list {
  position: absolute; top: calc(100% + 16px); right: 0; z-index: 999;
  width: 190px; max-height: 320px; overflow-y: auto; margin: 0; padding: 8px;
  list-style: none; background: #fff; border-radius: 10px;
  box-shadow: 0 20px 50px rgba(6,21,37,0.18);
  display: none;
}
.lang-switcher.is-open .lang-switcher__list { display: block; }
.lang-switcher__list li a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px;
  color: var(--loanlift-text-black); font-size: 13px; line-height: 1.3; text-decoration: none;
}
.lang-switcher__list li a:hover { background: var(--loanlift-secondary-bg); }
.lang-switcher__list li.is-current a { font-weight: 700; color: #BE5518; }
.lang-switcher__list .fi { width: 20px !important; height: 15px !important; background-color: transparent !important; display: inline-block !important; border-radius: 2px; flex-shrink: 0; background-size: cover; }
.lang-switcher__name { width: auto !important; height: auto !important; background-color: transparent !important; display: inline-block !important; }
.lang-switcher--compact { margin-right: 0; }
.lang-switcher--compact .lang-switcher__flag { width: 24px !important; height: 17px !important; }

/* ---- Actions mobile : sélecteur de langue immédiatement à gauche du burger,
   burger tout à droite. Un wrapper dédié (plutôt que de compter sur l'ordre
   naturel de .main-menu-right, qui est trop loin du burger sur mobile) pousse
   les deux éléments ensemble contre le bord droit de .main-menu-inner. Caché
   par défaut (desktop) ; le CTA "Simuler un prêt"/téléphone de .main-menu-right
   et l'instance desktop du sélecteur sont cachés sur mobile en contrepartie. ---- */
.mobile-header-actions { display: none; }
@media only screen and (max-width: 1024px) {
  .mobile-header-actions {
    display: flex; align-items: center; gap: 16px; margin-left: auto;
  }
  .mobile-header-actions .header-right-end { margin-left: 0; margin-right: 0; }
  .main-menu-right .lang-switcher,
  .main-menu-cta { display: none; }
  /* Le sélecteur compact est collé au bord droit de l'écran (juste avant le
     burger) : ancrer le menu déroulant à droite (et non à gauche) pour qu'il
     s'ouvre vers l'intérieur de l'écran au lieu de déborder à droite. */
  .lang-switcher__list { right: 0; left: auto; }
}

/* ---- CTA "Simuler un prêt" dans le header des pages intérieures ----
   .btn-primary est un bouton fantôme (fond transparent, bordure/texte clairs)
   pensé pour un header transparent posé sur une image sombre — c'est le cas de
   .main-header (accueil), mais .main-header-four (pages intérieures) a un fond
   blanc par défaut et ne devient sombre qu'au scroll (.sticky-fixed), donc le
   bouton clair-sur-clair était invisible tant qu'on n'avait pas scrollé. Une
   couleur d'accent fixe reste lisible sur fond blanc ET sur le header sombre
   du scroll, sans dépendre de l'état sticky. */
.main-header-four .main-menu-cta.btn {
  background: #BE5518; border-color: #BE5518; color: #fff;
}
.main-header-four .main-menu-cta.btn:hover {
  background: var(--loanlift-primary-bg); border-color: var(--loanlift-primary-bg); color: #fff;
}
/* Les 2 barres de séparation d'origine du thème restent collées l'une à
   l'autre (plutôt qu'espacées par le column-gap de .main-menu-right) et
   séparent uniquement le sélecteur de langue du bouton "Simuler un prêt". */
.menu-divider-pair { display: flex; align-items: center; column-gap: 6px; }

/* ---- Formulaires : honeypot + alertes ---- */
.aic-hp-field { position: absolute !important; left: -9999px !important; top: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none; }
.aic-form-alert { display: none; margin-top: 14px; padding: 12px 16px; border-radius: 6px; font-size: 13px; line-height: 1.5; }
.aic-form-alert.is-success { display: block; background: rgba(16,140,90,0.1); color: #0d7a4d; border: 1px solid rgba(16,140,90,0.25); }
.aic-form-alert.is-error { display: block; background: rgba(191,45,45,0.08); color: #bf2d2d; border: 1px solid rgba(191,45,45,0.25); }
.aic-form-alert.is-loading { display: block; background: rgba(190,85,24,0.12); color: #8a4c16; border: 1px solid rgba(190,85,24,0.3); }

/* ===== Chat en direct — bouton flottant ===== */
.chat-float-btn {
  position: fixed; bottom: 20px; right: 20px; width: 60px; height: 60px; border-radius: 50%;
  background: var(--loanlift-primary-bg); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(6,21,37,0.35); z-index: 998; transition: all 0.3s ease;
}
.chat-float-btn i { color: #fff; font-size: 24px; }
.chat-float-btn:hover { background: #BE5518; transform: scale(1.08); }
.chat-float-btn::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-radius: 50%;
  background: var(--loanlift-primary-bg); opacity: 0.5; animation: chatFloatPulse 2.2s ease-out infinite; z-index: -1;
}
@keyframes chatFloatPulse { 0% { transform: scale(1); opacity: 0.5; } 100% { transform: scale(1.6); opacity: 0; } }
@media only screen and (max-width: 767px) { .chat-float-btn { width: 52px; height: 52px; bottom: 15px; right: 15px; } .chat-float-btn i { font-size: 20px; } }

/* ===== Chat en direct — popup ===== */
.chat-popup {
  position: fixed; bottom: 95px; right: 20px; width: 340px; max-width: calc(100vw - 40px);
  background: #fff; border-radius: 14px; box-shadow: 0 20px 60px rgba(6,21,37,0.28); overflow: hidden;
  z-index: 999; opacity: 0; visibility: hidden; transform: translateY(16px) scale(0.96); transition: all 0.25s ease;
}
.chat-popup.active { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.chat-popup-header { display: flex; align-items: center; gap: 12px; padding: 16px 40px 16px 18px; background: var(--loanlift-primary-bg); position: relative; }
.chat-avatar, .chat-bubble-avatar { width: 40px; height: 40px; border-radius: 50%; background: #fff; padding: 6px; object-fit: contain; flex-shrink: 0; }
.chat-window-name { display: block; color: #fff; font-weight: 700; font-size: 15px; }
.chat-window-status { display: block; color: rgba(255,255,255,0.65); font-size: 12px; margin-top: 2px; }
.chat-popup-close { position: absolute; top: 8px; right: 12px; background: none; border: none; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; opacity: 0.75; padding: 4px; }
.chat-popup-close:hover { opacity: 1; }
.chat-popup-body { padding: 20px 18px; background: #f6f8fa; max-height: 260px; overflow-y: auto; }
.chat-bubble { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.chat-bubble-text { background: #fff; padding: 14px 18px; border-radius: 4px 16px 16px 16px; font-size: 14px; color: var(--loanlift-text-black); box-shadow: 0 2px 10px rgba(6,21,37,0.06); max-width: 80%; }
.chat-popup-footer { padding: 16px 18px; border-top: 1px solid #eee; background: #fff; display: flex; flex-direction: column; gap: 10px; }
.chat-popup-footer .from-control { width: 100%; border: 1px solid rgba(6,21,37,0.15); border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 0; }
.chat-popup-footer .chat-textarea { min-height: 70px; resize: vertical; }
.chat-popup-footer input.readon.submit { width: 100%; text-align: center; cursor: pointer; background: #BE5518; color: #fff; border: none; border-radius: 8px; padding: 11px 16px; font-weight: 700; font-size: 13px; }
.chat-popup-footer input.readon.submit:hover { background: var(--loanlift-primary-bg); color: #fff; }
@media only screen and (max-width: 480px) { .chat-popup { right: 15px; bottom: 82px; width: calc(100vw - 30px); } }

/* ===== Chat en direct — fil de discussion ===== */
.chat-thread { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.chat-thread-msg { display: flex; justify-content: flex-start; }
.chat-thread-msg.is-mine { justify-content: flex-end; }
.chat-thread-bubble { max-width: 80%; background: #fff; padding: 10px 14px; border-radius: 4px 16px 16px 16px; font-size: 14px; color: var(--loanlift-text-black); box-shadow: 0 2px 10px rgba(6,21,37,0.06); }
.chat-thread-msg.is-mine .chat-thread-bubble { background: #BE5518; color: #fff; border-radius: 16px 4px 16px 16px; box-shadow: 0 2px 10px rgba(190,85,24,0.25); }
.chat-thread-time { margin-top: 4px; font-size: 10px; opacity: 0.6; }

/* ===== Bandeau cookies ===== */
.cookie-consent {
  position: fixed; bottom: 20px; left: 20px; width: 360px; max-width: calc(100vw - 40px);
  background: var(--loanlift-primary-bg); color: #fff; border-radius: 14px; box-shadow: 0 20px 60px rgba(6,21,37,0.28);
  padding: 22px 22px 20px; z-index: 998; opacity: 0; visibility: hidden; transform: translateY(16px); transition: all 0.25s ease;
}
.cookie-consent.active { opacity: 1; visibility: visible; transform: translateY(0); }
.cookie-consent p { margin: 0 0 18px; font-size: 14px; line-height: 1.6; color: rgba(255,255,255,0.88); }
.cookie-consent__actions { display: flex; gap: 10px; }
.cookie-consent__actions button { flex: 1; cursor: pointer; font-size: 14px; font-weight: 600; border-radius: 0 8px 0 8px; padding: 11px 16px; transition: all 0.25s ease; border: 1px solid transparent; }
.cookie-consent__accept { background: #BE5518; color: #fff; }
.cookie-consent__accept:hover { background: #ffffff; color: var(--loanlift-primary-bg); }
.cookie-consent__decline { background: transparent; color: #fff; border-color: rgba(255,255,255,0.35); }
.cookie-consent__decline:hover { background: rgba(255,255,255,0.1); }
@media only screen and (max-width: 480px) { .cookie-consent { left: 15px; right: 15px; bottom: 15px; width: auto; max-width: none; } }

/* ===== Simulateur "vitrine rapide" (widget noUiSlider existant du thème) ===== */
#loan-calculator .loan-result-box { background: var(--loanlift-secondary-bg); border-radius: 10px; padding: 20px; margin-top: 16px; }

/* ===== Étoiles d'avis (remplacent les photos des témoins dans les témoignages) ===== */
.testimonial-stars { display: flex; gap: 3px; margin-bottom: 10px; }
.testimonial-stars i { color: #FFA41C; font-size: 15px; }
.testimonial-two-box-meta .testimonial-stars { margin-bottom: 0; margin-right: 14px; }
