/* ==========================================================================
   Avento Consent Manager
   Custom replacement for Klaro — banner + modal styles
   ========================================================================== */

:root {
  --cc-blue-light: #1b4ff5;
  --cc-text: #0b0e1a;
  --cc-muted: #4a4f5b;
  --cc-border: rgba(2, 28, 112, 0.08);
  --cc-shadow: 0 -4px 40px rgba(2, 28, 112, 0.25);
  --cc-radius: 8px;
}


/* ==========================================================================
   1. BANNER — Fixed bottom consent bar
   ========================================================================== */

.cc-banner {
  background: #fff;
  color: var(--cc-text);
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 16px 16px 0 0;
  box-shadow: var(--cc-shadow);
  border-top: 1px solid var(--cc-border);
  z-index: 999;
  display: flex;
  justify-content: center;
  outline: none;
}

.cc-banner-body {
  padding: 24px 32px;
  width: 100%;
  max-width: 1200px;
}

.cc-banner-layout {
  display: flex;
  align-items: center;
  gap: 32px;
}

.cc-banner-text {
  flex: 1;
  min-width: 0;
}

.cc-title {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--cc-text);
  margin: 0 0 8px 0;
}

.cc-desc {
  color: var(--cc-muted);
  font-size: 14px;
  font-weight: 400;
  margin: 0 0 8px 0;
}

.cc-details-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--cc-blue-light);
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  text-decoration: underline;
  cursor: pointer;
  display: inline-block;
  margin-top: 8px;
}

.cc-banner-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.cc-banner-actions .cc-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cc-banner-actions .cc-btn {
  min-width: 200px;
}


/* ==========================================================================
   2. BUTTONS — Shared across banner and modal
   ========================================================================== */

.cc-btn {
  border-radius: var(--cc-radius);
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  padding: 10px 20px;
  min-width: 140px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: opacity 0.15s ease;
  text-align: center;
}

.cc-btn:hover {
  opacity: 0.85;
}

.cc-btn:focus-visible {
  outline: 2px solid var(--cc-blue-light);
  outline-offset: 2px;
}

.cc-btn-primary {
  background: var(--cc-blue-light);
  border-color: var(--cc-blue-light);
  color: #fff;
}

.cc-btn-secondary {
  background: transparent;
  border: 2px solid var(--cc-blue-light);
  color: var(--cc-blue-light);
}


/* ==========================================================================
   3. OVERLAY — Semi-transparent backdrop behind modal
   ========================================================================== */

.cc-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}


/* ==========================================================================
   4. MODAL — Detail/preferences dialog
   ========================================================================== */

.cc-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1001;
  background: #fff;
  color: var(--cc-text);
  border-radius: var(--cc-radius);
  box-shadow: 0 30px 45px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(2, 28, 112, 0.06);
  width: 90%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  outline: none;
}

.cc-modal-inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.cc-modal-header {
  padding: 28px 32px 4px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.cc-modal-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--cc-text);
  margin: 0;
}

.cc-modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  font-family: inherit;
  cursor: pointer;
  color: var(--cc-muted);
  padding: 4px 8px;
  line-height: 1;
}

.cc-modal-close:hover {
  opacity: 0.7;
}

.cc-modal-close:focus-visible {
  outline: 2px solid var(--cc-blue-light);
  outline-offset: 2px;
}

.cc-modal-body {
  padding: 8px 32px 24px 32px;
  overflow-y: auto;
  flex: 1;
}

.cc-modal-description {
  color: var(--cc-text);
  line-height: 1.5;
  font-size: 14px;
  font-weight: 400;
  margin: 0 0 20px 0;
}

.cc-modal-footer {
  padding: 12px 32px 32px 32px;
  flex-shrink: 0;
}

.cc-modal-footer .cc-buttons {
  display: flex;
  gap: 12px;
}

.cc-modal-footer .cc-btn {
  flex: 1;
}

.cc-modal-footer .cc-btn-primary {
  order: 3;
}

.cc-modal-footer .cc-btn[data-action="save"] {
  order: 2;
}

.cc-modal-footer .cc-btn[data-action="decline"] {
  order: 1;
}


/* ==========================================================================
   5. SERVICES — Purpose groups and individual service rows
   ========================================================================== */

.cc-purpose-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--cc-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 20px 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--cc-border);
}

.cc-purpose-title:first-child {
  margin-top: 0;
}

.cc-service {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 0;
}

.cc-service-required {
  opacity: 0.6;
}

.cc-service-info {
  flex: 1;
  min-width: 0;
}

.cc-service-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--cc-text);
  display: block;
  margin-bottom: 4px;
}

.cc-service-desc {
  color: var(--cc-blue-light);
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
}


/* ==========================================================================
   6. TOGGLE SWITCH
   ========================================================================== */

.cc-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.cc-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.cc-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(27, 79, 245, 0.25);
  border-radius: 12px;
  transition: background 0.2s ease;
}

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

.cc-switch input:checked + .cc-slider {
  background: var(--cc-blue-light);
}

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

.cc-switch input:disabled + .cc-slider {
  cursor: not-allowed;
}

.cc-switch input:focus-visible + .cc-slider {
  outline: 2px solid var(--cc-blue-light);
  outline-offset: 2px;
}


/* ==========================================================================
   7. RESPONSIVE — Mobile (640px and below)
   ========================================================================== */

@media (max-width: 640px) {
  .cc-banner-body {
    padding: 16px;
  }

  .cc-title {
    font-size: 20px;
    margin: 0 0 4px 0;
  }

  .cc-desc {
    margin: 0 0 4px 0;
  }

  .cc-details-link {
    margin-top: 4px;
  }

  .cc-banner-layout {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .cc-banner-actions {
    width: 100%;
    display: block;
  }

  .cc-banner-actions .cc-buttons {
    align-items: stretch;
    width: 100%;
    gap: 8px;
  }

  .cc-banner-actions .cc-btn {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 18px;
  }

  /* Modal */
  .cc-modal {
    width: 95%;
    max-height: 90vh;
  }

  .cc-modal-header,
  .cc-modal-body,
  .cc-modal-footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .cc-modal-footer .cc-buttons {
    flex-direction: column;
    width: 100%;
  }

  .cc-modal-footer .cc-btn {
    width: 100%;
  }
}
