/* First-party cookie preference panel — Sürücü Akademisi. Does not restyle Google CMP. */

.sa-consent-root {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9000;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}

.sa-consent-root[hidden] {
  display: none !important;
}

/* Existing open/visible surfaces — hide first-party banner only (not Google CMP). */
body.public-gate-open .sa-consent-root,
body.exam-finish-gate-open .sa-consent-root,
body.sa-premium-checkout-open .sa-consent-root,
body:has(#web-password-reset-modal.is-visible) .sa-consent-root {
  visibility: hidden;
  pointer-events: none;
}

.sa-consent-panel {
  pointer-events: auto;
  width: min(720px, 100%);
  max-width: 100%;
  max-height: min(70dvh, 520px);
  margin: 0 auto;
  padding: 16px 16px 14px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  color: #e8f0fa;
  background:
    linear-gradient(180deg, rgba(12, 22, 40, 0.98), rgba(5, 8, 18, 0.98));
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 16px;
  box-shadow:
    0 0 0 1px rgba(5, 8, 18, 0.4),
    0 16px 40px rgba(2, 6, 16, 0.55),
    0 0 28px rgba(34, 211, 238, 0.12);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  box-sizing: border-box;
}

.sa-consent-title {
  margin: 0 0 8px;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #f1f7ff;
}

.sa-consent-copy {
  margin: 0 0 10px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #b6c4d6;
}

.sa-consent-policy {
  margin: 0 0 12px;
  font-size: 0.82rem;
}

.sa-consent-policy a {
  color: #67e8f9;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sa-consent-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.sa-consent-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(103, 232, 249, 0.55);
  background: rgba(34, 211, 238, 0.1);
  color: #f8fbff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-sizing: border-box;
}

.sa-consent-btn:hover,
.sa-consent-btn:focus-visible {
  background: rgba(34, 211, 238, 0.18);
  border-color: rgba(103, 232, 249, 0.85);
  outline: none;
}

.sa-consent-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.28);
}

.sa-consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 10px;
  padding: 10px 10px 9px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(8, 14, 28, 0.55);
  font-size: 0.82rem;
  line-height: 1.4;
  color: #c5d0de;
  cursor: pointer;
}

.sa-consent-row input {
  margin-top: 3px;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.sa-consent-row--locked {
  cursor: default;
  opacity: 0.92;
}

.sa-consent-row--locked input {
  accent-color: #22d3ee;
}

.sa-consent-footer-open {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.88rem;
  color: #94a3b8;
  cursor: pointer;
  text-decoration: none;
}

.sa-consent-footer-open:hover,
.sa-consent-footer-open:focus-visible {
  color: #e8f0fa;
  text-decoration: underline;
  outline: none;
}

.sa-consent-footer-nav {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.sa-consent-footer-open--fixed {
  position: fixed;
  left: max(12px, env(safe-area-inset-left, 0px));
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 8990;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 12px;
  box-sizing: border-box;
  border-radius: 8px;
  background: rgba(5, 8, 18, 0.72);
  font-size: 0.75rem;
}

@media (min-width: 640px) {
  .sa-consent-panel {
    padding: 18px 20px 16px;
  }

  .sa-consent-actions {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .sa-consent-actions--two {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sa-consent-panel,
  .sa-consent-btn {
    transition: none;
  }
}

/* Mobile/tablet only — reserve space while the first-party banner is open. */
@media (max-width: 900px) {
  body.sa-consent-open {
    padding-bottom: min(340px, 48vh);
  }
}
