/* Verification dialog. Self-contained so it looks the same wherever it appears,
   and carries its own tokens rather than inheriting whatever the host page has. */

.psv {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  padding: 20px; background: rgba(31, 55, 91, 0.45); backdrop-filter: blur(6px);
  font-family: var(--sans); color: var(--text);
  animation: psv-fade .2s var(--ease) both;
}
.psv[hidden] { display: none !important; }
@keyframes psv-fade { from { opacity: 0; } to { opacity: 1; } }

.psv-card {
  position: relative; width: min(430px, 100%);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 22px;
  padding: clamp(24px, 4vw, 32px);
  box-shadow: var(--shadow-lg);
  animation: psv-in .28s var(--ease) both;
  max-height: calc(100dvh - 40px); overflow-y: auto;
}
@keyframes psv-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

/*
 * The close button comes first in the DOM, so without a stacking context every
 * later sibling paints on top of it. On a phone the title wraps to two lines,
 * covers this corner, and swallows the tap — the button looked fine and simply
 * did not work.
 *
 * It also had no background until hover, which on a touch screen means no
 * affordance at all: an unadorned × floating over the text.
 */
.psv-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 40px; height: 40px;
  display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-dim); font-size: 20px; line-height: 1;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.psv-close:hover, .psv-close:focus-visible {
  color: var(--text); background: var(--surface-3); border-color: var(--line-strong);
}
.psv-close:active { transform: scale(.94); }

/* Keeps a wrapping title out from under the button. */
.psv-title { padding-right: 44px; }

.psv-strip {
  display: flex; align-items: center; gap: 9px; margin-bottom: 20px;
  padding: 9px 13px; border-radius: 999px; font-size: 13px; color: var(--text-dim);
  background: var(--crimson-soft); border: 1px solid rgba(174, 28, 65, 0.20);
}
.psv-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--accent-2);
  animation: psv-pulse 1.9s var(--ease) infinite;
}
@keyframes psv-pulse {
  0% { box-shadow: 0 0 0 0 var(--sky-soft); }
  70% { box-shadow: 0 0 0 7px rgba(52,216,240,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,216,240,0); }
}
.psv-strip.is-ready { background: rgba(74,222,128,0.1); border-color: rgba(74,222,128,0.3); }
.psv-strip.is-ready .psv-dot { background: var(--ok); animation: none; }

.psv-step { animation: psv-rise .26s var(--ease) both; }
@keyframes psv-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.psv-title {
  margin: 0 0 6px; font-family: 'Instrument Serif', Georgia, serif; font-weight: 400;
  font-size: 1.7rem; letter-spacing: -0.01em;
}
.psv-sub { margin: 0 0 22px; color: var(--text-dim); font-size: 14.5px; line-height: 1.55; }
.psv-sub strong { color: var(--text); }

.psv-form { display: flex; flex-direction: column; gap: 15px; }
.psv-field { display: flex; flex-direction: column; gap: 6px; }
.psv-field > span { font-size: 12.5px; font-weight: 500; color: var(--text-faint); }
.psv-field em { font-style: normal; color: var(--text-faint); }
.psv-field input {
  width: 100%; min-height: 46px; padding: 11px 14px; font: inherit; font-size: 15px;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.psv-field input:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--crimson-soft);
}

.psv-code { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.psv-box {
  width: 100%; aspect-ratio: 3 / 4; min-height: 52px; padding: 0; text-align: center;
  font-family: 'Instrument Serif', Georgia, serif; font-size: 1.7rem; line-height: 1;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
}
.psv-box:focus-visible {
  outline: none; border-color: var(--accent); background: var(--crimson-soft);
  box-shadow: 0 0 0 3px var(--crimson-soft);
}
.psv-box.is-filled { border-color: var(--line-strong); background: rgba(255,255,255,0.05); }
.psv-code.is-wrong .psv-box { border-color: var(--danger); animation: psv-shake .34s var(--ease); }
@keyframes psv-shake {
  10%, 90% { transform: translateX(-1px); }
  30%, 70% { transform: translateX(2px); }
  50% { transform: translateX(-2px); }
}

.psv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; min-height: 50px; padding: 13px 22px; border: 0; border-radius: 14px;
  cursor: pointer; font: inherit; font-size: 15.5px; font-weight: 600; color: var(--on-dark);
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 32px -14px rgba(174, 28, 65, 0.28);
  transition: transform .16s var(--ease), box-shadow .16s var(--ease);
}
.psv-btn:hover:not(:disabled) { transform: translateY(-1px); }
.psv-btn:disabled { opacity: .5; cursor: default; }

.psv-fine { margin: 0; font-size: 12px; color: var(--text-faint); text-align: center; }
.psv-link {
  padding: 0; border: 0; background: none; cursor: pointer; font: inherit; font-size: inherit;
  color: var(--accent); text-decoration: underline; text-underline-offset: 2px;
}
.psv-link:disabled { color: var(--text-faint); cursor: default; text-decoration: none; }

.psv-error {
  margin: 0; padding: 10px 13px; border-radius: 10px; font-size: 13.5px; color: var(--danger);
  background: #FDEBEF; border: 1px solid rgba(255,139,139,0.28);
}

.psv-done { text-align: center; }
.psv-check {
  width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center; font-size: 24px; color: var(--on-dark);
  background: linear-gradient(140deg, var(--ok), var(--accent-2));
  animation: psv-pop .3s var(--ease) both;
}
@keyframes psv-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

.psv-spin {
  width: 15px; height: 15px; border-radius: 50%; flex: none;
  border: 2px solid rgba(10,12,18,0.3); border-top-color: var(--on-dark);
  animation: psv-spin .7s linear infinite;
}
@keyframes psv-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .psv, .psv * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.human-slot:not(:empty) { margin-top: 14px; display: flex; justify-content: center; }

/* Where the code goes. Only rendered when text messaging is configured. */
.psv-channel { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.psv-chan {
  padding: 11px 12px; border-radius: 12px; cursor: pointer;
  font: inherit; font-size: 13.5px; color: var(--text-dim);
  background: transparent; border: 1px solid var(--line);
  transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease);
}
.psv-chan:hover { color: var(--text); border-color: var(--line-strong); }
.psv-chan.is-on {
  color: var(--text); font-weight: 500;
  border-color: var(--accent); background: var(--crimson-soft);
}

/* The plain-language version of who sees what, at the moment somebody is
   deciding to sign up — not buried in a policy page they will not open. */
.psv-privacy {
  margin: 14px 0 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-faint);
  text-align: left;
}

.psv-privacy a { color: var(--text-dim); text-decoration: underline; }
.psv-privacy a:hover { color: var(--accent); }

/* ------------------------------------------- sign in / create account tabs */

/* A first-time visitor needs to see a door marked "create account". Without
   one, "Sign in" reads as a members-only entrance and they leave. */
.psv-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  /*
   * The close button is absolutely positioned at the card's top-right corner
   * and predates this row, so the row was rendering underneath it — the ×
   * sat on top of "Create account". The top margin clears the button's 40px
   * plus its 10px offset, which leaves it alone in the corner where it reads
   * as a close button rather than as something stuck to a tab.
   */
  margin: 34px 0 20px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.psv-tab {
  padding: 10px 8px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--text-dim);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.psv-tab:hover { color: var(--text); }

.psv-tab.is-on {
  background: var(--surface);
  color: var(--crimson);
  box-shadow: 0 1px 4px rgba(16, 26, 51, .10);
}

.psv-fine strong { color: var(--text-dim); font-weight: 600; }

/* A suggestion, not a failure — so it should not look like one. */
.psv-error.psv-suggest {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--text-dim);
}

.psv-error.psv-suggest .psv-link {
  color: var(--accent-2);
  font-weight: 600;
  text-decoration: underline;
}

/* ------------------------------------------------- sign in with a provider */

.psv-oauth {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 18px;
}

.psv-oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}

.psv-oauth-btn:hover {
  border-color: var(--text-faint);
  background: var(--surface-2);
}

.psv-oauth-btn svg { flex: 0 0 auto; }

/* A rule with the word in the middle of it. */
.psv-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  color: var(--text-faint);
  font-size: 12.5px;
}

.psv-or::before,
.psv-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
