/* --- 1. 基礎樣式 --- */
/* 關閉時用 HTML hidden + display:none，避免 opacity/visibility 在部分環境仍露出內文 */
.kms-loc-consent-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: rgba(12, 18, 32, 0.55);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
}

.kms-loc-consent-overlay[hidden] {
  display: none !important;
}

body.kms-loc-modal-open {
  overflow: hidden;
  touch-action: none;
}

.kms-loc-consent-card {
  width: 100%;
  max-width: 400px;
  border-radius: 18px;
  background: linear-gradient(155deg, rgba(32, 42, 62, 0.96) 0%, rgba(22, 28, 44, 0.98) 100%);
  border: 1px solid rgba(0, 242, 255, 0.22);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  color: #dce4ec;
}

.kms-loc-consent-icon {
  font-size: 2.25rem;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(0, 242, 255, 0.35));
}

.kms-loc-consent-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #f0f4f8;
}

.kms-loc-consent-body {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #aeb8c6;
}

.kms-loc-consent-error {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #ffb4a8;
}

.kms-loc-btn {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.kms-loc-btn-primary {
  background: linear-gradient(180deg, #1ad4e8 0%, #0aa8bc 100%);
  color: #0c141f;
  box-shadow: 0 4px 14px rgba(0, 242, 255, 0.28);
}

.kms-loc-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #dce4ec;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* --- 2. 布局樣式 --- */
.kms-loc-consent-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 26px 22px 22px;
}

.kms-loc-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  width: 100%;
  margin-top: 4px;
}

.kms-loc-consent-error {
  width: 100%;
  text-align: center;
}

/* --- 3. 交互樣式 --- */
@media (hover: hover) {
  .kms-loc-btn-primary:hover {
    box-shadow: 0 6px 20px rgba(0, 242, 255, 0.38);
    transform: translateY(-1px);
  }

  .kms-loc-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
  }
}

.kms-loc-btn:active {
  transform: scale(0.97);
}

.kms-loc-consent-card:focus-within {
  outline: none;
}

/* --- 4. 響應式樣式 --- */
@media screen and (max-width: 480px) {
  .kms-loc-consent-card {
    max-width: none;
    border-radius: 16px;
    padding: 22px 18px 18px;
    gap: 12px;
  }

  .kms-loc-consent-title {
    font-size: 1.05rem;
  }

  .kms-loc-consent-body {
    font-size: 0.86rem;
  }

  .kms-loc-consent-actions {
    flex-direction: column;
  }

  .kms-loc-btn {
    width: 100%;
    padding: 12px 16px;
  }
}
