/* ================================================================
   WP Zammad Turnstile — Frontend Styles
   ================================================================ */

/* ---------- Custom chat button ---------- */

.wzt-btn {
  position: fixed;
  bottom: 20px;
  z-index: 99990;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  height: 52px;
  border: none;
  border-radius: 26px;
  background: var(--wzt-bg, #371ea3);
  color: var(--wzt-color, #fff);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

.wzt-btn.wzt-visible {
  display: flex;
}

.wzt-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
}

.wzt-btn:active {
  transform: translateY(0);
}

.wzt-btn.wzt-pos-right { right: 20px; }
.wzt-btn.wzt-pos-left  { left: 20px; }

.wzt-btn-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ---------- Overlay & backdrop ---------- */

.wzt-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
}

.wzt-overlay.wzt-visible {
  display: flex;
}

.wzt-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: wztFadeIn 0.2s ease;
}

/* ---------- Verification card ---------- */

.wzt-card {
  position: relative;
  z-index: 1;
  width: 380px;
  max-width: calc(100vw - 32px);
  padding: 32px 28px 28px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
  text-align: center;
  animation: wztSlideUp 0.25s ease;
}

.wzt-card-loading {
  opacity: 0.6;
  pointer-events: none;
}

.wzt-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #666;
  font-size: 22px;
  line-height: 32px;
  cursor: pointer;
  transition: background 0.15s;
}

.wzt-close:hover {
  background: #f0f0f0;
  color: #333;
}

.wzt-card-title {
  margin: 0 0 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
}

.wzt-card-subtitle {
  margin: 0 0 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #666;
}

.wzt-widget {
  display: flex;
  justify-content: center;
  min-height: 65px;
}

.wzt-error {
  display: none;
  margin: 16px 0 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fef2f2;
  color: #b91c1c;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.4;
}

/* ---------- Floating loader ---------- */

.wzt-loader {
  position: fixed;
  bottom: 20px;
  z-index: 99990;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 0 22px;
  height: 52px;
  border-radius: 26px;
  background: var(--wzt-bg, #371ea3);
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  -webkit-font-smoothing: antialiased;
}

.wzt-loader.wzt-visible {
  display: flex;
}

.wzt-loader.wzt-pos-right { right: 20px; }
.wzt-loader.wzt-pos-left  { left: 20px; }

.wzt-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: wztSpin 0.7s linear infinite;
}

/* ---------- Toast notice ---------- */

.wzt-notice {
  position: fixed;
  bottom: 20px;
  z-index: 99990;
  padding: 14px 22px;
  border-radius: 12px;
  background: var(--wzt-bg, #371ea3);
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  animation: wztSlideUp 0.3s ease;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.wzt-notice.wzt-pos-right { right: 20px; }
.wzt-notice.wzt-pos-left  { left: 20px; }

.wzt-notice-hide {
  opacity: 0;
  transform: translateY(10px);
}

/* ---------- Animations ---------- */

@keyframes wztFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes wztSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes wztSpin {
  to { transform: rotate(360deg); }
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
  .wzt-btn {
    bottom: 14px;
    height: 48px;
    padding: 0 18px;
    font-size: 14px;
  }

  .wzt-btn.wzt-pos-right { right: 14px; }
  .wzt-btn.wzt-pos-left  { left: 14px; }

  .wzt-card {
    padding: 24px 20px 22px;
    border-radius: 14px;
  }

  .wzt-loader {
    bottom: 14px;
    height: 48px;
    padding: 0 18px;
    font-size: 13px;
  }

  .wzt-loader.wzt-pos-right { right: 14px; }
  .wzt-loader.wzt-pos-left  { left: 14px; }

  .wzt-notice {
    bottom: 14px;
    right: 14px;
    left: 14px;
    text-align: center;
  }
}
