/*!
 * White River Wellness — WhatsApp pre-chat modal
 * Self-contained. Every rule is namespaced .wapc- so it cannot collide with lp-v2.css.
 * Minimum font-size is 16px throughout: anything smaller triggers iOS zoom-on-focus
 * and fails our accessibility baseline.
 */

.wapc-lock {
  overflow: hidden;
}

.wapc-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  /* margin:auto on the dialog (below) does the centering. It centers on both axes
     AND, unlike align-items:center, never clips the top of a dialog taller than the
     viewport — it just lets it scroll. This is what keeps it centered on mobile,
     including when the on-screen keyboard shrinks the viewport. */
  overflow-y: auto;
  padding: 16px;
  background: rgba(12, 24, 20, 0.62);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: wapc-fade 160ms ease-out;
}

.wapc-overlay[hidden] {
  display: none;
}

@keyframes wapc-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.wapc-dialog {
  position: relative;
  margin: auto; /* centers within the flex overlay, on both axes, without clipping */
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px); /* dvh: excludes the mobile address bar */
  overflow-y: auto;
  padding: 28px 24px 22px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  font-family: inherit;
  color: #1c2a26;
  animation: wapc-rise 200ms cubic-bezier(0.2, 0.8, 0.3, 1);
}

@keyframes wapc-rise {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.wapc-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: 0;
  background: none;
  font-size: 28px;
  line-height: 1;
  color: #7b8a85;
  cursor: pointer;
  border-radius: 8px;
}

.wapc-close:hover,
.wapc-close:focus-visible {
  background: #f1f4f3;
  color: #1c2a26;
}

.wapc-title {
  margin: 0 0 8px;
  padding-right: 32px;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
}

.wapc-sub {
  margin: 0 0 20px;
  font-size: 16px;
  line-height: 1.5;
  color: #52625c;
}

.wapc-label {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 600;
}

.wapc-opt {
  font-weight: 400;
  color: #7b8a85;
}

.wapc-input {
  display: block;
  width: 100%;
  margin-bottom: 16px;
  padding: 13px 14px;
  border: 1px solid #cfd8d5;
  border-radius: 9px;
  background: #fff;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  color: #1c2a26;
  box-sizing: border-box;
}

.wapc-input:focus {
  outline: none;
  border-color: #25d366;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.22);
}

.wapc-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 18px;
  font-size: 16px;
  line-height: 1.45;
  color: #52625c;
  cursor: pointer;
}

.wapc-consent input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: #25d366;
}

/* The landers style bare `a` as a solid green button. Without this reset the
   privacy link renders as a button in the middle of the consent sentence. */
.wapc-consent a {
  display: inline;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: none;
  font: inherit;
  color: #1c2a26;
  text-decoration: underline;
}

.wapc-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.wapc-error {
  margin: 0 0 14px;
  padding: 11px 13px;
  border-radius: 8px;
  background: #fdeceb;
  color: #a3231b;
  font-size: 16px;
  line-height: 1.4;
}

.wapc-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 14px 18px;
  border: 0;
  border-radius: 9px;
  background: #25d366;
  color: #06301b;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: background 140ms ease;
}

.wapc-submit:hover:not(:disabled) {
  background: #1fbe5a;
}

.wapc-submit:focus-visible {
  outline: 3px solid #06301b;
  outline-offset: 2px;
}

.wapc-submit:disabled {
  opacity: 0.72;
  cursor: default;
}

.wapc-fine {
  margin: 12px 0 0;
  font-size: 16px;
  line-height: 1.4;
  text-align: center;
  color: #7b8a85;
}

@media (max-width: 420px) {
  .wapc-dialog {
    padding: 24px 18px 18px;
  }
  .wapc-title {
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wapc-overlay,
  .wapc-dialog {
    animation: none;
  }
}
