/*
 * Consumer Access V2 gate UI. Loaded on every homepage/surface but fully
 * inert until consumer-access-v2.js opens a modal / footer (which only
 * happens on a server 402, and the server never returns 402 while the
 * feature is dark). Visual language mirrors the existing quota gate
 * (showQuotaGate) and sticky handoff bar so it reads as one product.
 */

.zcv2-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 29, 0.68);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 100001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 2vw, 1.5rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  font-family: inherit;
}

.zcv2-gate-stack {
  display: grid;
  gap: 0.75rem;
  width: 100%;
  max-width: 30rem;
  margin: auto;
  padding: 0.25rem 0;
  outline: none;
  animation: zcv2-pop 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.zcv2-modal {
  background: #fbfaf7;
  color: #1b1e22;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e2d8d0;
  border-radius: 18px;
  padding: clamp(1.2rem, 4vw, 1.6rem);
  box-shadow: 0 24px 60px -20px rgba(15, 20, 26, 0.55);
}

.zcv2-modal:focus { outline: none; }

@keyframes zcv2-pop {
  from { transform: translateY(12px) scale(0.985); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.zcv2-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #a70f27;
  margin: 0 0 0.4rem 0;
}

.zcv2-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  line-height: 1.25;
}

.zcv2-lede {
  font-size: 0.9rem;
  color: #5b6670;
  margin: 0 0 0.9rem 0;
  line-height: 1.55;
}

.zcv2-address-chip {
  display: block;
  background: #f7f4ef;
  border: 1px solid #e2d8d0;
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-size: 0.82rem;
  color: #5b6670;
  margin-bottom: 1rem;
  word-break: break-word;
}

.zcv2-address-chip strong {
  display: block;
  color: #1b1e22;
  font-weight: 600;
  margin-top: 0.1rem;
}

.zcv2-price {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin: 0 0 0.9rem 0;
}

.zcv2-price-amount {
  font-size: 1.6rem;
  font-weight: 800;
  color: #1b1e22;
}

.zcv2-price-unit {
  font-size: 0.85rem;
  color: #68727c;
}

.zcv2-benefit {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #3e4852;
  margin: 0 0 0.5rem 0;
}

.zcv2-benefit svg { flex: 0 0 auto; margin-top: 0.1rem; }

.zcv2-choice-list {
  display: grid;
  gap: 0.65rem;
}

.zcv2-choice {
  border: 1px solid #e2d8d0;
  border-radius: 12px;
  padding: 0.9rem;
  background: #fff;
}

.zcv2-choice--featured {
  border-color: #d85a70;
  background: #fff6f5;
}

.zcv2-choice-kicker {
  margin: 0 0 0.2rem;
  color: #a70f27;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.zcv2-choice-title {
  margin: 0;
  color: #1b1e22;
  font-size: 1rem;
  font-weight: 750;
}

.zcv2-choice-copy {
  margin: 0.35rem 0 0.75rem;
  color: #5b6670;
  font-size: 0.8rem;
  line-height: 1.45;
}

.zcv2-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.zcv2-actions--compact { margin-top: 0.25rem; }

.zcv2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 0;
  text-decoration: none;
  box-sizing: border-box;
  font-family: inherit;
  transition: filter 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.zcv2-btn:focus-visible,
.zcv2-footer-close:focus-visible,
.zcv2-notice-close:focus-visible {
  outline: 3px solid rgba(200, 16, 46, 0.24);
  outline-offset: 2px;
}

.zcv2-btn:disabled { opacity: 0.6; cursor: default; }
.zcv2-btn[hidden] { display: none; }

.zcv2-btn--primary {
  background: linear-gradient(135deg, #c8102e, #a70f27);
  color: #fff;
}
.zcv2-btn--primary:hover { filter: brightness(1.05); }

.zcv2-btn--google {
  background: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
}
.zcv2-btn--google:hover { background: #f8f9fa; }

.zcv2-btn--ghost {
  background: #fff;
  color: #3e4852;
  border: 1px solid #d8cec6;
}
.zcv2-btn--ghost:hover { background: #f7f4ef; }

.zcv2-btn--link {
  background: transparent;
  color: #68727c;
  border: 0;
  font-weight: 500;
  padding: 0.5rem;
}
.zcv2-btn--link:hover { color: #3e4852; }

.zcv2-fineprint {
  font-size: 0.75rem;
  color: #68727c;
  text-align: center;
  margin: 0.75rem 0 0 0;
}

.zcv2-fineprint a { color: #a70f27; font-weight: 600; }

.zcv2-error {
  font-size: 0.8rem;
  color: #a70f27;
  margin: 0.6rem 0 0 0;
  min-height: 1em;
}

.zcv2-auth-error:empty { display: none; }

/* ---- Handoff form (inside the modal) ---- */

.zcv2-field { margin-bottom: 0.7rem; }

.zcv2-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #3e4852;
  margin-bottom: 0.25rem;
}

.zcv2-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid #d8cec6;
  font-size: 0.9rem;
  color: #1b1e22;
  background: #fff;
  font-family: inherit;
}

.zcv2-input:focus { outline: 3px solid rgba(200, 16, 46, 0.18); border-color: #c8102e; }

.zcv2-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: #5b6670;
  line-height: 1.45;
  margin: 0.6rem 0 0.2rem 0;
}

.zcv2-consent input { margin-top: 0.15rem; flex: 0 0 auto; }

/* ---- Local professional panel under the gate ---- */

.zcv2-footer {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  border: 1px solid #e2d8d0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 44px -24px rgba(15, 20, 26, 0.48);
  font-family: inherit;
  animation: zcv2-fade 0.2s ease-out;
}

.zcv2-professional-prompt {
  padding: 0.85rem 2.75rem 0.75rem 1rem;
  background: #f7f4ef;
  border-bottom: 1px solid #e2d8d0;
}

.zcv2-professional-question {
  margin: 0;
  color: #1b1e22;
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.35;
}

.zcv2-professional-answer {
  margin: 0.2rem 0 0;
  color: #5b6670;
  font-size: 0.78rem;
  line-height: 1.4;
}

.zcv2-footer-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.8rem 1rem;
}

.zcv2-avatar {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: #c8102e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.zcv2-footer-copy { flex: 1 1 auto; min-width: 0; }

.zcv2-footer-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #a70f27;
  margin: 0;
}

.zcv2-footer-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1b1e22;
  margin: 0.05rem 0 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zcv2-footer-sub {
  font-size: 0.78rem;
  color: #68727c;
  margin: 0.05rem 0 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zcv2-footer-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.zcv2-footer-actions .zcv2-btn { width: auto; padding: 0.55rem 0.9rem; }
.zcv2-footer-actions .zcv2-btn--primary { flex: 1 1 14rem; }

.zcv2-footer-close {
  grid-column: 3;
  grid-row: 1;
  background: transparent;
  border: 0;
  color: #a1a1aa;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
}

.zcv2-footer-close:hover { color: #5b6670; }

@keyframes zcv2-slide-up {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* ---- Subtle non-blocking notice (anon free used) ---- */

.zcv2-notice {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 1rem;
  z-index: 99999;
  max-width: 32rem;
  width: calc(100% - 2rem);
  background: #18181b;
  color: #fafafa;
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.83rem;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.5);
  font-family: inherit;
  animation: zcv2-slide-up 0.22s ease-out;
}

.zcv2-notice-text { flex: 1 1 auto; line-height: 1.4; }

.zcv2-notice a {
  color: #fca5a5;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.zcv2-notice-close {
  background: transparent;
  border: 0;
  color: #a1a1aa;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  flex: 0 0 auto;
}

/* ---- Resume toast (pending-check resume after sign-in / subscribe) ---- */

.zcv2-resume {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: 1rem;
  z-index: 99999;
  max-width: 30rem;
  width: calc(100% - 2rem);
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.25);
  font-family: inherit;
  animation: zcv2-fade 0.2s ease-out;
}

.zcv2-resume-text { flex: 1 1 auto; line-height: 1.4; }
.zcv2-resume-text strong { font-weight: 700; }

.zcv2-resume--error {
  background: #fff7ed;
  border-color: #fdba74;
  color: #9a3412;
}

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

@media (max-width: 560px) {
  .zcv2-overlay {
    align-items: flex-start;
    padding: max(0.65rem, env(safe-area-inset-top)) 0.65rem max(0.65rem, env(safe-area-inset-bottom));
  }
  .zcv2-gate-stack { gap: 0.6rem; }
  .zcv2-modal { border-radius: 16px; }
  .zcv2-footer-inner { gap: 0.75rem; }
  .zcv2-footer-actions .zcv2-btn { flex: 1 1 auto; }
  .zcv2-footer-actions .zcv2-btn--primary { flex-basis: 100%; }
  .zcv2-footer-close { position: absolute; top: 0.55rem; right: 0.55rem; }
}
