/**
 * /calculator/ email gate — styles.
 *
 * Scoped entirely to .ava-cg-* . It adds no rule that can reach an existing selector, so the
 * control arm (and every other page) is untouched by this file even when it loads.
 *
 * The BLUR IS NOT HERE. It is written inline by calc-gate.js, in the same statement block that
 * inserts the placeholder digits — deliberately, so that a stylesheet which fails to load can
 * never leave a fabricated number readable. This file only styles the modal on top.
 */

/* NO backdrop-filter here, deliberately.
   The matrix behind is ALREADY blurred, inline, by calc-gate.js. Blurring the backdrop as well
   stacked 7px on 6px and turned the octagram into fog — destroying the one thing the visitor is
   supposed to see: that their matrix is built, and waiting, and merely unreadable. A plain scrim
   darkens without erasing. */
.ava-cg-host {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  background: rgba(10, 8, 24, .58);
  animation: ava-cg-fade .22s ease-out;
}

/* Dismissed: the card is gone, the scrim is gone, the blurred matrix is all that is left —
   plus the bar. Clicks must reach the page again, so the host stops catching them. */
.ava-cg-host.is-dismissed {
  background: transparent;
  pointer-events: none;
  animation: none;
}

.ava-cg-host.is-dismissed .ava-cg-bar { pointer-events: auto; }

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

html.ava-cg-lock { overflow: hidden; }

.ava-cg-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin: auto;
  padding: 28px 26px 22px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 20px;
  background: #171429;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
  color: #ececf4;
  animation: ava-cg-rise .26s cubic-bezier(.16, 1, .3, 1);
}

@keyframes ava-cg-rise {
  from { transform: translateY(14px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.ava-cg-title {
  margin: 0 0 6px;
  font-size: 23px;
  line-height: 1.25;
  font-weight: 700;
  color: #fff;
}

.ava-cg-sub {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.5;
  color: #b9b6cc;
}

.ava-cg-sub strong { color: #fff; word-break: break-all; }

.ava-cg-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #b9b6cc;
}

.ava-cg-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 15px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  font-size: 16px;                 /* 16px or iOS zooms the page on focus */
  outline: none;
  transition: border-color .15s ease, background-color .15s ease;
}

.ava-cg-input:focus {
  border-color: #8b5cf6;
  background: rgba(255, 255, 255, .07);
}

.ava-cg-input::placeholder { color: #6f6b85; }

.ava-cg-err {
  min-height: 18px;
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.35;
  color: #ff8a8a;
}

/* The consent box: a real 44px tap target, never a pre-ticked afterthought. */
.ava-cg-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 10px 0 16px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
  cursor: pointer;
}

.ava-cg-consent input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: #8b5cf6;
  cursor: pointer;
}

.ava-cg-consent span {
  font-size: 13px;
  line-height: 1.45;
  color: #c6c3d6;
}

.ava-cg-btn {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 13px 18px;
  border: 0;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s cubic-bezier(.16, 1, .3, 1), opacity .15s ease, border-color .15s ease;
}

.ava-cg-btn:hover { transform: translateY(-1px); }
.ava-cg-btn:disabled { opacity: .6; cursor: default; transform: none; }

.ava-cg-btn-primary {
  background: linear-gradient(92deg, #7a3ff2 0%, #b06ef5 100%);
  color: #fff;
}

.ava-cg-btn-outline {
  border: 1px solid rgba(255, 255, 255, .28);
  background: transparent;
  color: #ececf4;
}

.ava-cg-btn-outline:hover { border-color: rgba(255, 255, 255, .5); }

.ava-cg-btn-ghost {
  border: 1px solid rgba(255, 255, 255, .22);
  background: transparent;
  color: #d6d6e4;
  font-weight: 600;
}

.ava-cg-fine {
  margin: 10px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: #8d89a3;
  text-align: center;
}

/* ------------------------------------------------------------------- buy --- */

.ava-cg-buy { margin-top: 20px; }

.ava-cg-or {
  position: relative;
  margin: 0 0 16px;
  text-align: center;
}

.ava-cg-or::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, .12);
}

.ava-cg-or span {
  position: relative;
  padding: 0 12px;
  background: #171429;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #6f6b85;
}

.ava-cg-buy-lead {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.5;
  color: #c6c3d6;
}

/* The monthly plan really is cheaper to hold, and this is the line that says so. It renders only
   when the live prices make it true — see ava_cg_modal_html(). It never sits on the weekly plan. */
.ava-cg-win {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
  color: #7ee0a6;
}

/* The renewal price is a legal statement, not fine print: same size as everything around it. */
.ava-cg-renew {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
  color: #c6c3d6;
}

.ava-cg-buy-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

/* The one-off: the quietest of the three, still a proper 44px target. */
.ava-cg-once {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: transparent;
  color: #b9b6cc;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}

.ava-cg-once:hover {
  border-color: rgba(255, 255, 255, .38);
  background: rgba(255, 255, 255, .05);
  color: #ececf4;
}

.ava-cg-nomail { margin-top: 12px; }

/* ------------------------------------------------- close + re-open bar ----- */

/* A real 44px target, not a decorative 12px cross in a corner. */
.ava-cg-x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #8d89a3;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}

.ava-cg-x:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.ava-cg-x:focus-visible { outline: 2px solid #8b5cf6; outline-offset: 2px; }

/* The way back in, after a dismiss. */
.ava-cg-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100000;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 255, 255, .12);
  background: rgba(23, 20, 41, .96);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .45);
  animation: ava-cg-bar-up .3s cubic-bezier(.16, 1, .3, 1);
}

@keyframes ava-cg-bar-up {
  from { transform: translateY(100%); }
  to   { transform: none; }
}

.ava-cg-bar-in {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 900px;
  margin: 0 auto;
}

.ava-cg-bar-txt {
  font-size: 14.5px;
  font-weight: 600;
  color: #ececf4;
}

.ava-cg-bar-btn {
  width: auto;
  min-height: 44px;
  padding: 11px 26px;
  font-size: 14.5px;
}

/* ----------------------------------------------------------------- toast --- */

.ava-cg-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 100001;
  max-width: min(92vw, 460px);
  padding: 13px 20px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px;
  background: #1d1933;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .5);
  color: #ececf4;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  animation: ava-cg-rise .26s cubic-bezier(.16, 1, .3, 1);
  transition: opacity .5s ease, transform .5s ease;
}

.ava-cg-toast.is-out {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
}

/* ----------------------------------------------------------------- small --- */

@media (max-width: 520px) {
  .ava-cg-host { padding: 12px; align-items: flex-start; }
  .ava-cg-card { padding: 22px 18px 18px; border-radius: 16px; }
  .ava-cg-title { font-size: 20px; }
  .ava-cg-bar-in { flex-direction: column; gap: 10px; }
  .ava-cg-bar-btn { width: 100%; }
  .ava-cg-bar-txt { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .ava-cg-host,
  .ava-cg-card,
  .ava-cg-toast { animation: none; }
  .ava-cg-btn { transition: none; }
  .ava-cg-btn:hover { transform: none; }
}
