/* ==========================================================================
   Cookie Consent Banner & Modal
   Brand: 4founder.ch — #088aff primary, Inter font
   ========================================================================== */

/* ---------- Banner ---------- */
#ff-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999999;
  background: #fff;
  box-shadow: 0 -4px 24px rgba(103, 133, 219, 0.15);
  border-radius: 1rem 1rem 0 0;
  padding: 1.5rem 2rem;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#ff-cookie-banner.ff-cb-visible {
  transform: translateY(0);
}

.ff-cb-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.ff-cb-text {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #374151;
  margin: 0;
}

.ff-cb-link {
  color: #088aff;
  text-decoration: underline;
  font-weight: 500;
}

.ff-cb-link:hover {
  color: #0d3880;
}

.ff-cb-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* ---------- Buttons ---------- */
.ff-cb-btn {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  border-radius: 0.5rem;
  padding: 0.7rem 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.ff-cb-btn-primary {
  background: linear-gradient(238deg, #088aff, #08a6ff 50%, #088aff);
  color: #fff;
  background-size: 200% 100%;
}

.ff-cb-btn-primary:hover {
  background-position: right center;
  box-shadow: 0 4px 14px rgba(8, 138, 255, 0.35);
}

.ff-cb-btn-primary:focus-visible {
  outline: 3px solid #fff;
  box-shadow: 0 0 0 5px rgba(8, 138, 255, 0.45);
}

.ff-cb-btn-secondary {
  background: transparent;
  color: #088aff;
  border: 2px solid #088aff;
}

.ff-cb-btn-secondary:hover {
  background: #088aff;
  color: #fff;
}

.ff-cb-btn-text {
  background: transparent;
  color: #374151;
  padding: 0.7rem 0.75rem;
  font-weight: 400;
}

.ff-cb-btn-text:hover {
  text-decoration: underline;
  color: #088aff;
}

/* ---------- Modal Backdrop ---------- */
#ff-cookie-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999998;
  background: rgba(13, 31, 60, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

#ff-cookie-modal-backdrop.ff-cm-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Modal ---------- */
#ff-cookie-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  z-index: 9999999;
  background: #fff;
  border-radius: 1rem;
  width: 94%;
  max-width: 32rem;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 30px rgba(103, 133, 219, 0.2);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

#ff-cookie-modal.ff-cm-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

/* Modal header */
.ff-cm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.ff-cm-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0d1f3c;
}

.ff-cm-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  transition: background 0.2s, color 0.2s;
}

.ff-cm-close:hover {
  background: #f1f5f9;
  color: #0d1f3c;
}

/* Modal body */
.ff-cm-body {
  padding: 1rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.ff-cm-intro {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.6;
  margin: 0 0 1rem 0;
}

/* Category rows */
.ff-cm-category {
  border: 1.5px solid #e2e8f0;
  border-radius: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 1rem 1.25rem;
  transition: border-color 0.2s;
}

.ff-cm-category:hover {
  border-color: #c7e0ff;
}

.ff-cm-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.ff-cm-category-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0d1f3c;
}

.ff-cm-category-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: #088aff;
  background: #eff6ff;
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 8px;
  vertical-align: middle;
}

.ff-cm-category-desc {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.55;
  margin: 0;
}

/* ---------- Toggle Switch ---------- */
.ff-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.ff-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.ff-toggle-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.25s ease;
}

.ff-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.ff-toggle input:checked + .ff-toggle-slider {
  background: #088aff;
}

.ff-toggle input:checked + .ff-toggle-slider::before {
  transform: translateX(20px);
}

.ff-toggle input:focus-visible + .ff-toggle-slider {
  box-shadow: 0 0 0 3px rgba(8, 138, 255, 0.3);
}

/* Disabled (essential) */
.ff-toggle-disabled {
  opacity: 0.55;
  pointer-events: none;
}

/* ---------- Modal footer ---------- */
.ff-cm-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 0.75rem;
}

.ff-cm-footer .ff-cb-btn {
  flex: 1;
}

/* ---------- Floating Settings Button ---------- */
#ff-cookie-settings-btn {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  z-index: 999998;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 2px 10px rgba(103, 133, 219, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

#ff-cookie-settings-btn.ff-csb-visible {
  opacity: 1;
  pointer-events: auto;
}

#ff-cookie-settings-btn:hover {
  border-color: #088aff;
  box-shadow: 0 4px 16px rgba(8, 138, 255, 0.2);
  transform: scale(1.08);
}

#ff-cookie-settings-btn svg {
  width: 20px;
  height: 20px;
  fill: #64748b;
  transition: fill 0.2s;
}

#ff-cookie-settings-btn:hover svg {
  fill: #088aff;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  #ff-cookie-banner {
    padding: 1.25rem 1.25rem;
    border-radius: 0.75rem 0.75rem 0 0;
  }

  .ff-cb-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .ff-cb-text {
    font-size: 0.85rem;
    text-align: center;
  }

  .ff-cb-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .ff-cb-btn {
    width: 100%;
    text-align: center;
  }

  #ff-cookie-modal {
    width: 96%;
    max-height: 90vh;
  }

  .ff-cm-header,
  .ff-cm-body,
  .ff-cm-footer {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  .ff-cm-footer {
    flex-direction: column;
  }
}

@media (max-width: 380px) {
  #ff-cookie-banner {
    padding: 1rem;
  }

  .ff-cb-text {
    font-size: 0.8rem;
  }

  .ff-cb-btn {
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
  }
}
