/* ================================================================
   Language Flow — Cookie Consent Component
   All selectors scoped to lf-consent-banner / lf-consent-modal
   Font-weight: max 500 per project rule. No global style changes.
   ================================================================ */

/* ── Banner ─────────────────────────────────────────────────────── */
#lf-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #ffffff;
  border-top: 1px solid #E0E4EA;
  box-shadow: 0 -4px 20px rgba(36,57,84,0.10);
  padding: 16px 20px;
  font-family: "Poppins", -apple-system, sans-serif;
}

#lf-consent-banner.lf-hidden {
  display: none;
}

.lf-cb-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.lf-cb-text {
  margin: 0;
  flex: 1 1 260px;
  font-size: 0.85rem;
  color: #243954;
  line-height: 1.5;
}

.lf-cb-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.lf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border-radius: 8px;
  font-family: "Poppins", -apple-system, sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  border: 2px solid transparent;
  line-height: 1.2;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  text-decoration: none;
  -webkit-font-smoothing: antialiased;
}

.lf-btn:focus-visible {
  outline: 3px solid #338aff;
  outline-offset: 2px;
}

.lf-btn-primary {
  background: #338aff;
  color: #ffffff;
  border-color: #338aff;
}
.lf-btn-primary:hover {
  background: #2270e0;
  border-color: #2270e0;
}

.lf-btn-secondary {
  background: transparent;
  color: #32487b;
  border-color: #32487b;
}
.lf-btn-secondary:hover {
  background: #f0f4f9;
}

.lf-btn-ghost {
  background: transparent;
  color: #338aff;
  border-color: transparent;
  padding-left: 8px;
  padding-right: 8px;
}
.lf-btn-ghost:hover {
  color: #2270e0;
  text-decoration: underline;
}

/* ── Modal overlay ───────────────────────────────────────────────── */
#lf-consent-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#lf-consent-modal.lf-hidden {
  display: none;
}

.lf-cm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(36, 57, 84, 0.45);
}

.lf-cm-dialog {
  position: relative;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(36, 57, 84, 0.18);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  font-family: "Poppins", -apple-system, sans-serif;
}

/* ── Modal header ────────────────────────────────────────────────── */
.lf-cm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #E0E4EA;
}

.lf-cm-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  color: #32487b;
  font-family: "Poppins", -apple-system, sans-serif;
}

.lf-cm-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  color: #243954;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 6px;
  opacity: 0.55;
  transition: opacity 0.15s;
  font-family: "Poppins", -apple-system, sans-serif;
}
.lf-cm-close:hover { opacity: 1; }
.lf-cm-close:focus-visible {
  outline: 3px solid #338aff;
  outline-offset: 2px;
  opacity: 1;
}

/* ── Modal body rows ─────────────────────────────────────────────── */
.lf-cm-body {
  padding: 0 24px;
}

.lf-cm-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid #E0E4EA;
}
.lf-cm-row:last-child {
  border-bottom: none;
}

.lf-cm-info {
  flex: 1;
  min-width: 0;
}

.lf-cm-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  color: #32487b;
  margin-bottom: 4px;
  font-family: "Poppins", -apple-system, sans-serif;
}

.lf-cm-desc {
  margin: 0;
  font-size: 0.78rem;
  color: rgba(36, 57, 84, 0.65);
  line-height: 1.5;
  font-family: "Poppins", -apple-system, sans-serif;
}

/* "Always active" badge */
.lf-cm-always {
  font-size: 0.75rem;
  font-weight: 500;
  color: #338aff;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 3px;
  font-family: "Poppins", -apple-system, sans-serif;
}

/* ── Toggle switch ───────────────────────────────────────────────── */
.lf-toggle {
  display: flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
}

.lf-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

.lf-toggle-track {
  display: block;
  width: 44px;
  height: 24px;
  background: #CBD5E1;
  border-radius: 12px;
  position: relative;
  transition: background 0.2s;
}

.lf-toggle-track::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  top: 2px;
  left: 2px;
  transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}

.lf-toggle input:checked + .lf-toggle-track {
  background: #338aff;
}

.lf-toggle input:checked + .lf-toggle-track::after {
  left: 22px;
}

.lf-toggle input:focus-visible + .lf-toggle-track {
  outline: 3px solid #338aff;
  outline-offset: 2px;
  border-radius: 12px;
}

/* ── Modal footer ────────────────────────────────────────────────── */
.lf-cm-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid #E0E4EA;
}

.lf-cm-footer .lf-btn {
  width: 100%;
}

/* ── Footer preference link ──────────────────────────────────────── */
.lf-footer-pref-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  font-size: inherit;
  padding: 0;
  margin: 0;
  vertical-align: baseline;
}
.lf-footer-pref-link:hover {
  color: #338aff;
}
.lf-footer-pref-link:focus-visible {
  outline: 2px solid #338aff;
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Mobile ──────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  #lf-consent-banner {
    padding: 14px 16px 20px;
  }

  .lf-cb-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .lf-cb-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .lf-btn {
    width: 100%;
    justify-content: center;
  }

  .lf-cm-header {
    padding: 16px 18px 12px;
  }

  .lf-cm-body {
    padding: 0 18px;
  }

  .lf-cm-footer {
    padding: 14px 18px 18px;
  }

  .lf-cm-dialog {
    border-radius: 10px;
    max-height: 85vh;
  }
}
