/* mobile-cta-bar.vanilla.css — vanilla-CSS port of the canonical mobile
 * sticky-CTA bar for site-hub (the only site in the fleet that does NOT
 * use Tailwind).
 *
 * Class names are emitted by the macro when `brand: "vanilla"`. Both ports
 * share the same data-attributes, so a single JS controller drives both.
 *
 * Palette references site-hub's existing CSS custom properties (--green,
 * --green-deep, etc.). Falls back to literal values so the file is
 * self-contained if a site doesn't define those variables.
 */

.mcta-root {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (min-width: 1024px) {
  .mcta-root { display: none; }
}

.mcta-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 40;
  opacity: 0;
  transition: opacity 200ms ease-out;
}

.mcta-panel {
  position: relative;
  z-index: 50;
  background-color: var(--green-deep, #1a3d2e);
  color: #fff;
  border-top-left-radius: 1.5rem;
  border-top-right-radius: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  padding: 1.5rem 1.5rem 2rem;
  max-height: 85vh;
  overflow-y: auto;
}

.mcta-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.mcta-panel-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.mcta-panel-sub {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  margin: 0 0 1.25rem 0;
}

.mcta-close {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.6);
  padding: 0.25rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: background-color 150ms ease-out, color 150ms ease-out;
}
.mcta-close:hover { color: #fff; background-color: rgba(255, 255, 255, 0.1); }
.mcta-close-icon { width: 1.5rem; height: 1.5rem; }

.mcta-form { display: flex; flex-direction: column; gap: 1rem; }
.mcta-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.mcta-hp { position: absolute; left: -9999px; }

.mcta-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border-radius: 0.5rem;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1rem;          /* 16px — prevents iOS auto-zoom. */
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.mcta-input::placeholder { color: rgba(255, 255, 255, 0.4); }
.mcta-input:focus {
  outline: none;
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--green-light, #4ade80);
}

.mcta-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  background-color: var(--green, #16a34a);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.875rem 1rem;
  border-radius: 0.5rem;
  text-align: center;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  min-height: 44px;
  transition: background-color 150ms ease-out, transform 150ms ease-out;
}
.mcta-btn-primary:hover { background-color: var(--green-deep, #15803d); }
.mcta-btn-primary:active { transform: scale(0.98); }

.mcta-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.875rem 1rem;
  border-radius: 0.5rem;
  text-align: center;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  min-height: 44px;
  transition: background-color 150ms ease-out;
}
.mcta-btn-secondary:hover { background-color: rgba(255, 255, 255, 0.2); }

.mcta-trust {
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.75rem;
  margin: 1rem 0 0;
}

.mcta-idle {
  background-color: color-mix(in srgb, var(--green-deep, #1a3d2e) 95%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.mcta-idle > * { display: flex; gap: 0.75rem; padding: 0.75rem 1rem; }

/* sr-only — reused from the macro's labels. Match Tailwind's sr-only. */
.mcta-root .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .mcta-panel,
  .mcta-backdrop,
  .mcta-root {
    transition-duration: 100ms !important;
    transform: none !important;
  }
}
