/* lock.css — WP8. Full-viewport access gate (email-not-verified / pending
 * approval / rejected / no ChemTrust) + the styled 404, plus the in-app
 * gated-feature overlays (blur+nudge, profile gate). Ported from the EUDR
 * platform's access-lock.css with gt-lock__ → ct-lock__.
 *
 * Colour: everything comes from tokens. The gate pages are public pages
 * (always light, no theme-boot): the background loop (or the light ground
 * painted by layout.css's fixed body::before layer when the clip is absent)
 * under a veil, and EUDR's 97 % sheet on top. The card has NO
 * backdrop-filter: at 97 % the blur was invisible, but it was recomputed for
 * every frame of the video (EUDR access-lock.css:56-57). The in-app overlays
 * at the bottom live inside the shell and flip with the theme through the
 * same tokens. Reduced-motion is handled globally (tokens.css). */

/* ═══════════════════════════ Full-page gate ═══════════════════════════ */
.ct-lock {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: safe center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  overflow-y: auto;
  font-family: var(--font-body, "Nunito", sans-serif);
}

.ct-lock__video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  z-index: 0;
}

/* The veil exists to keep the card legible over a VIDEO, and is heavier than
   the sign-in page's wash to say "gate" (EUDR access-lock.css:31). With no
   video it paints nothing and the brand ground shows. `~`, not `+`:
   _bg_video.html puts its <script> between the video and the veil. */
.ct-lock__veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.ct-lock__video ~ .ct-lock__veil {
  background:
    radial-gradient(ellipse at center, rgb(var(--storm-rgb) / 0.55) 0%, rgb(var(--storm-rgb) / 0.88) 100%),
    linear-gradient(180deg, rgb(var(--storm-rgb) / 0.35) 0%, rgb(var(--storm-rgb) / 0.75) 100%);
}

/* EUDR's gate card: a 97 % white sheet (the video barely shows through,
   so the text keeps its contrast whatever the frame), a hairline, the gate
   shadow, and no blur behind it. */
.ct-lock__card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 460px;
  margin: auto;
  padding: 40px 36px 32px;
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  border: 1px solid rgb(var(--storm-rgb) / 0.1);
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 var(--surface),
    0 30px 80px -20px rgb(var(--storm-rgb) / 0.55),
    0 10px 30px -12px rgb(var(--storm-rgb) / 0.35);
  color: var(--text);
  text-align: center;
  animation: ct-lock-card-in 0.55s cubic-bezier(0.22, 0.8, 0.35, 1) both;
}
/* The lite tier flattens shadows (lite.css); the gate's own goes with them. */
html.ct-lite .ct-lock__card {
  box-shadow: var(--shadow-lg);
}

@keyframes ct-lock-card-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ct-lock__logo {
  display: inline-block;
  max-width: 76px;
  height: auto;
  margin-bottom: 18px;
  opacity: 0.95;
}

/* The emblem: one still disc. EUDR's earlier pulsing rings are gone there
   too (access-lock.css:75), so the well is the disc's own size. */
.ct-lock__halo {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
}

/* A Storm disc with a cyan glyph: the brand pair, 10.7:1. Drawn from palette
   tokens that never flip, so it reads the same wherever it is used. */
.ct-lock__halo-core {
  position: relative;
  z-index: 1;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--storm-78) 0%, var(--brand-storm) 100%);
  display: grid;
  place-items: center;
  box-shadow:
    0 10px 24px -8px rgb(var(--storm-rgb) / 0.55),
    0 0 0 1px rgb(var(--storm-rgb) / 0.25) inset;
}

.ct-lock__halo-core svg {
  width: 28px;
  height: 28px;
  color: var(--brand-cyan);
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Typography */
.ct-lock__eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  /* --link is the "reads as cyan" ink: --cyan-ink on white (5.3:1), full cyan
     on dark. Plain cyan on white would be 1.44:1. */
  color: var(--link);
  margin: 0 0 10px;
}

.ct-lock__title {
  font-family: var(--font-display, "Nunito", sans-serif);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0 0 10px;
  line-height: 1.2;
}

.ct-lock__message {
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 18px;
}

/* Chip row: the e-mail and the status on ONE line, at one 30px height and
   baseline (EUDR access-lock.css:137). The status never shrinks; the e-mail
   gives way, cut with an ellipsis (the full address is the chip's title and
   is read out whole), so the pair stays on one line down to a 360px phone. */
.ct-lock__chips {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  margin: 0 0 22px;
}

.ct-lock__email-chip,
.ct-lock__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 14px;
  margin: 0;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  box-sizing: border-box;
  white-space: nowrap;
}

.ct-lock__email-chip {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text);
}
.ct-lock__email-chip[hidden] {
  display: none;
}
.ct-lock__email-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  /* the cap-height sits in the middle of the chip, like the status text */
  line-height: 1.2;
}

.ct-lock__email-chip svg {
  width: 14px;
  height: 14px;
  color: var(--text-subtle);
  flex: 0 0 auto;
}

/* Status chips are the semantic exception: amber / red / green. */
.ct-lock__status {
  flex: none;
  background: var(--potential-tint);
  border: 1px solid var(--potential-edge);
  color: var(--potential);
  letter-spacing: 0.02em;
}

.ct-lock__status--pending {
  background: var(--potential-tint);
  border-color: var(--potential-edge);
  color: var(--potential);
}

.ct-lock__status--rejected {
  background: var(--confirmed-tint);
  border-color: var(--confirmed-edge);
  color: var(--confirmed);
}

.ct-lock__status--approved {
  background: var(--clear-tint);
  border-color: var(--clear-edge);
  color: var(--clear);
}

.ct-lock__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  /* Three pulses, then the dot stays still (EUDR access-lock.css:207-209):
     an endless box-shadow animation repaints on the main thread every
     frame. */
  animation: ct-lock-dot-pulse 1.8s ease-out 3;
}

@keyframes ct-lock-dot-pulse {
  0% {
    box-shadow: 0 0 0 0 currentColor;
    opacity: 1;
  }
  70% {
    box-shadow: 0 0 0 8px transparent;
    opacity: 0.6;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
    opacity: 1;
  }
}

/* Action stack */
.ct-lock__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 14px;
}

.ct-lock__btn {
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-family: inherit;
  font-size: 0.93rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  /* The 404's primary is an <a>: without this it inherited the link
     underline. The ghost variant below re-adds its own on purpose. */
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.ct-lock__btn:active {
  transform: translateY(1px);
}
.ct-lock__btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.ct-lock__btn--primary {
  background: var(--action);
  color: var(--action-ink);
  box-shadow: var(--action-glow);
}

/* color is restated on hover: on the 404's <a> the global `a:hover`
   (tokens.css) would otherwise repaint the label in --link-hover, which is
   Storm on a Storm button. */
.ct-lock__btn--primary:hover:not(:disabled) {
  background: var(--action-hover);
  color: var(--action-ink);
}

.ct-lock__btn--secondary {
  background: var(--action-2);
  color: var(--action-2-ink);
  border: 1.5px solid var(--action-2-edge);
}

.ct-lock__btn--secondary:hover:not(:disabled) {
  background: var(--action-2-hover);
  border-color: var(--accent);
}

.ct-lock__btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border: none;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  font-weight: 600;
  padding: 8px 10px;
  font-size: 0.86rem;
}

.ct-lock__btn--ghost:hover:not(:disabled) {
  color: var(--text);
  text-decoration-thickness: 1.5px;
}

/* Feedback line. Its room is kept while it is empty, so a message appearing
   moves nothing (the card is centred: a taller card would shift up). EUDR's
   1.2em was less than one line (1.35), so every message nudged the card by
   2px; and the longer sentences ("Verification email sent — check your
   inbox.", the offline and too-many-tries lines) take two lines in Greek on
   every screen, and in English on a phone. So two full lines are kept. */
.ct-lock__feedback {
  min-height: 2.7em;
  font-size: 0.8rem;
  line-height: 1.35;
  margin: 10px 0 0;
  color: var(--text-muted);
}

.ct-lock__feedback--error {
  color: var(--confirmed);
}
.ct-lock__feedback--ok {
  color: var(--clear);
}

/* Footer */
.ct-lock__footer {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-subtle);
  line-height: 1.5;
}

.ct-lock__footer a {
  color: var(--link);
  text-decoration: none;
  font-weight: 700;
}

.ct-lock__footer a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* Phones: the login's 12px gutter, EUDR's ≤420 card, smaller chips so the
   pair fits one line. */
@media (max-width: 420px) {
  .ct-lock {
    padding: 12px;
  }
  .ct-lock__card {
    padding: 28px 20px 22px;
    border-radius: 14px;
  }
  .ct-lock__logo {
    max-width: 64px;
    margin-bottom: 14px;
  }
  .ct-lock__title {
    font-size: 1.35rem;
  }
  .ct-lock__halo {
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
  }
  .ct-lock__halo-core {
    width: 56px;
    height: 56px;
  }
  .ct-lock__halo-core svg {
    width: 24px;
    height: 24px;
  }
  .ct-lock__chips {
    gap: 6px;
  }
  .ct-lock__email-chip,
  .ct-lock__status {
    gap: 6px;
    padding: 0 11px;
    font-size: 0.78rem;
  }
}

/* ═══════════════════════════ In-app gated-feature overlays ═══════════════════════════ */
/* spec-theme §5.3 — a blurred-out container with a floating pulsing CTA. Lives
 * INSIDE the app shell, so it flips with the theme through its tokens: the
 * primary action is Storm with white ink in light mode and glowing cyan with
 * Storm ink in dark mode (--action*). No dark-mode block needed. */
.ct-card-blur {
  position: relative;
}
.ct-card-blur > *:not(.ct-nudge-overlay) {
  filter: blur(3px);
  pointer-events: none;
  user-select: none;
  opacity: 0.4;
  transition: filter 0.4s, opacity 0.4s;
}

.ct-nudge-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 24px;
  text-align: center;
  animation: ct-nudge-fade-in 0.5s ease;
}
.ct-nudge-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--action);
  box-shadow: var(--action-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--action-ink);
  margin-bottom: 16px;
  /* Three pulses, then still (EUDR style.css:1413): never forever. */
  animation: ct-nudge-pulse 2s ease-in-out 3;
}
.ct-nudge-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.ct-nudge-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 18px;
  max-width: 340px;
  line-height: 1.5;
}
.ct-nudge-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--action);
  color: var(--action-ink);
  border: none;
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--action-glow);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.ct-nudge-btn:hover {
  transform: translateY(-2px);
  background: var(--action-hover);
}
.ct-nudge-arrow {
  font-size: 1.1rem;
  /* Six nudges, then still (EUDR style.css:1459). */
  animation: ct-nudge-bounce-x 1s ease-in-out 6;
}

/* Inline (non-blur) empty-state gate */
.ct-profile-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 28px;
  text-align: center;
  animation: ct-nudge-fade-in 0.5s ease;
}
.ct-profile-gate-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--action);
  box-shadow: var(--action-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--action-ink);
  margin-bottom: 18px;
  animation: ct-nudge-pulse 2s ease-in-out 3;
}
.ct-profile-gate-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 8px;
  font-family: var(--font-display);
}
.ct-profile-gate-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 460px;
  line-height: 1.55;
  margin: 0 0 24px;
}

@keyframes ct-nudge-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}
@keyframes ct-nudge-bounce-x {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(4px);
  }
}
@keyframes ct-nudge-fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
