/* QuoteCheck — Privacy-first Analytics Consent Banner
   DOM structure:
     aside.qc-consent (role="dialog" aria-label="...")
       p.qc-consent__text
       div.qc-consent__actions
         button.qc-consent__allow
         button.qc-consent__deny
         a.qc-consent__link
   Scoped entirely under .qc-consent and its BEM children.
*/

@keyframes qc-consent-slide-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.qc-consent,
.qc-consent__text,
.qc-consent__actions,
.qc-consent__allow,
.qc-consent__deny,
.qc-consent__link {
  box-sizing: border-box;
}

.qc-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  z-index: 1000;
  margin: 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px)) 16px;
  background: #ffffff;
  border-top: 1px solid #dce4d1;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -4px 20px rgba(41, 67, 48, 0.08);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  color: #294330;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: qc-consent-slide-up 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .qc-consent {
    animation: none;
  }
}

.qc-consent__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #294330;
  overflow-wrap: break-word;
}

.qc-consent__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.qc-consent__allow,
.qc-consent__deny {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.1px;
  border-radius: 7px;
  cursor: pointer;
  min-height: 44px;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 1 1 calc(50% - 4px);
  min-width: 110px;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

/* Primary "Allow" button */
.qc-consent__allow {
  background: #315d32;
  border: 1px solid #315d32;
  color: #ffffff;
}

.qc-consent__allow:hover {
  background: #274b28;
  border-color: #274b28;
}

.qc-consent__allow:active {
  background: #1f3c20;
  border-color: #1f3c20;
}

/* Secondary "Decline" button */
.qc-consent__deny {
  background: #f6f9f1;
  border: 1px solid #d5dfcb;
  color: #52734a;
}

.qc-consent__deny:hover {
  background: #edf3e6;
  border-color: #b8c9ad;
  color: #284723;
}

.qc-consent__deny:active {
  background: #e3ebd9;
  border-color: #a7bc9b;
}

/* Privacy policy link */
.qc-consent__link {
  font-family: inherit;
  font-size: 12px;
  color: #4c7640;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  min-height: 44px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  transition: color 0.15s ease;
}

.qc-consent__link:hover {
  color: #284723;
  text-decoration-thickness: 2px;
}

/* Visible accessible focus states */
.qc-consent__allow:focus,
.qc-consent__deny:focus,
.qc-consent__link:focus {
  outline: 2px solid #315d32;
  outline-offset: 2px;
}

.qc-consent__allow:focus:not(:focus-visible),
.qc-consent__deny:focus:not(:focus-visible),
.qc-consent__link:focus:not(:focus-visible) {
  outline: none;
}

/* Tablet & Desktop: Centered card layout */
@media (min-width: 641px) {
  .qc-consent {
    bottom: 20px;
    left: 16px;
    right: 16px;
    margin-left: auto;
    margin-right: auto;
    width: calc(100% - 32px);
    max-width: 720px;
    border: 1px solid #dce4d1;
    border-radius: 12px;
    padding: 18px 24px;
    box-shadow:
      0 10px 30px rgba(41, 67, 48, 0.12),
      0 2px 8px rgba(41, 67, 48, 0.05);
    gap: 14px;
  }

  .qc-consent__actions {
    gap: 10px;
  }

  .qc-consent__allow,
  .qc-consent__deny {
    flex: 0 0 auto;
    min-width: 100px;
  }

  .qc-consent__link {
    width: auto;
    margin-left: auto;
    justify-content: flex-end;
    padding: 0 4px;
  }
}

/* Footer text link to reopen analytics consent settings */
.qc-analytics-settings {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
  text-align: inherit;
  text-decoration: none;
  cursor: pointer;
  display: inline;
}

.qc-analytics-settings:hover {
  color: inherit;
  text-decoration: none;
}

.qc-analytics-settings:focus {
  outline: none;
}

.qc-analytics-settings:focus-visible {
  outline: 2px solid #436c35;
  outline-offset: 4px;
}
