/* Phase 2+: per-screen styles land here. */

/* ═══════════════════════════ Dev login (Phase 1) ═══════════════════════════ */

.ct-devlogin-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}
.ct-devlogin-card {
  width: 100%;
  max-width: 460px;
}
.ct-devlogin-demo {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-4) 0 0;
}
.ct-devlogin-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--space-3) var(--space-4);
}
.ct-devlogin-btn span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ct-devlogin-btn small {
  font-weight: 500;
  opacity: 0.7;
}

/* Language toggle shows the target language's flag (eudr-x flag set) */
.ct-lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ct-lang-flag {
  width: 18px;
  height: 13px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

/* Green Trust logo in the portal's bar, with EUDR's treatment (style.css
   .nav-logo-left): one 3-D Y-spin shortly after the page appears, again on
   hover or keyboard focus of the brand, and a gentle scale on hover. Never
   forever: an endless spin keeps every frame of the page re-compositing. No
   spin under reduced motion or in the lite tier (lite.css). */
.ct-brand-logo {
  height: 26px;
  width: 26px;
  border-radius: 6px;
  object-fit: contain;
  background: var(--brand-white); /* the logo artwork needs its white tile in both themes */
  animation: ctLogoSpinY 0.9s linear 1s 1;
  transform-origin: center;
  transform-style: preserve-3d;
  backface-visibility: visible;
}
.ct-brand:hover .ct-brand-logo,
.ct-brand:focus-visible .ct-brand-logo {
  /* A second keyframe name restarts the spin on every hover. */
  animation: ctLogoSpinYAgain 0.9s linear 1;
}
@media (prefers-reduced-motion: reduce) {
  .ct-brand-logo,
  .ct-brand:hover .ct-brand-logo,
  .ct-brand:focus-visible .ct-brand-logo {
    animation: none;
  }
}
.ct-brand {
  perspective: 800px;
  transition: transform 0.2s;
}
.ct-brand:hover {
  transform: scale(1.05);
}
@keyframes ctLogoSpinY {
  from {
    transform: rotateY(0deg);
  }
  to {
    transform: rotateY(360deg);
  }
}
@keyframes ctLogoSpinYAgain {
  from {
    transform: rotateY(0deg);
  }
  to {
    transform: rotateY(360deg);
  }
}

/* ═══════════════════ Login (Green Trust branded, eudr-x-style) ═══════════════════ */

/* The sign-in page holds still (the owner, 2026-11-09: "the card moves").
   What moved it: the page was min-height 100vh and scrolled. On a phone 100vh
   is the screen with the browser's bars hidden, so the page always had a bar's
   height to scroll: the card could be dragged, sat below the middle, and
   login.js scrolled it to the top on every change of view. On a computer a
   view taller than the window brought in the page's scrollbar, which nudged
   the card sideways.
   Now, as on the EUDR platform's sign-in (style.css .auth-container): one
   layer fixed to the screen that never scrolls, the page under it locked,
   the card in the exact middle (grid place-items). Every view fits a phone of
   360 x 640 as it is (auth.css, phones). The company sign-up form, taller than
   any phone, scrolls inside the card while the card's frame stays put. */
html:has(.ct-login-wrap),
html:has(.ct-login-wrap) body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
.ct-login-wrap {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  padding: var(--space-6);
  overflow: hidden;
  /* The fallback for when the background video's files are absent
     (spec-chemtrust §6.7): the brand gradient, still (it used to pan, and a
     moving ground makes a still card look as if it drifts). */
  background:
    radial-gradient(1200px 600px at 15% -10%, rgb(var(--cyan-rgb) / 0.16), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgb(var(--cyan-rgb) / 0.2), transparent 55%),
    linear-gradient(135deg, var(--storm-deep) 0%, var(--brand-storm) 38%, var(--storm-lift-2) 62%, var(--brand-storm) 100%);
}
/* Full-bleed background loop (eudr-x / SafetyTrust login pattern;
   templates/_bg_video.html, clip in static/media/CREDITS.md). When its files
   are absent no <video> renders and the gradient above shows instead.
   object-position leans right so the cyan flask stays in frame when a narrow
   screen crops the sides. */
.ct-login-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 65% 50%;
  z-index: 0;
  pointer-events: none;
  /* A chemical plant at blue hour (Pexels 17469001). Slightly quieter
     colour so the warm site lights sit with the deep-green palette; the
     green scrim above does the rest. Applies to the poster frame too. */
  filter: saturate(0.85);
}
.ct-login-scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  /* The gradient fallback's scrim: lets the animated Storm gradient read
     through while the white card keeps its own contrast. The video gets its
     own, lighter wash (.ct-login-wrap--video below). */
  background: linear-gradient(180deg, rgb(var(--storm-rgb) / 0.32), rgb(var(--storm-rgb) / 0.48));
}
/* With the clip, the sign-in page stays light (SafetyTrust decision 18):
   - a pale base, so the page never flashes Storm before the poster paints,
     and no panning gradient left animating behind an opaque video;
   - a light Storm wash instead of the gradient scrim. It deepens a little
     behind the card and toward the bottom: enough to lift the white card off
     the pale frame (with the card's own shadow and hairline, auth.css), and
     light enough that the video stays alive. All text and links sit on the
     card's solid white, so their contrast does not depend on the frame. */
.ct-login-wrap--video {
  background: var(--storm-05);
}
.ct-login-wrap--video .ct-login-scrim {
  background:
    radial-gradient(ellipse 55% 65% at 50% 50%, rgb(var(--storm-rgb) / 0.16), transparent 75%),
    linear-gradient(180deg, rgb(var(--cyan-rgb) / 0.10) 0%, rgb(var(--storm-rgb) / 0.30) 100%);
}
/* The card itself (.ct-auth, the EUDR sign-in/sign-up port) is auth.css. */
@media (max-width: 768px), (max-height: 520px) and (orientation: landscape) {
  .ct-login-wrap {
    padding: 12px; /* EUDR's phone gutter */
  }
}
.ct-login-logo-wrap {
  position: relative;
  display: inline-flex;
  justify-content: center;
  margin-bottom: var(--space-2);
  overflow: hidden;
}
.ct-login-logo {
  display: block;
}
/* EUDR's login-logo shine (style.css .login-logo-wrap::after): a skewed
   light band sweeps across, masked to the logo's own shape, three times and
   then the logo holds still (it used to sweep forever). */
.ct-login-logo-wrap::after {
  content: "";
  position: absolute;
  top: -30%;
  left: -70%;
  width: 50%;
  height: 160%;
  background: linear-gradient(75deg, transparent 0%, var(--brand-white) 48%, transparent 100%);
  transform: translate(-170%, -10%) skewX(-12deg);
  animation: ctLoginLogoShine 4.2s ease-in-out 3;
  pointer-events: none;
  mix-blend-mode: screen;
  -webkit-mask-image: url("/static/images/login-logo.png");
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: 100% 100%;
  mask-image: url("/static/images/login-logo.png");
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: 100% 100%;
  opacity: 0.95;
}
@keyframes ctLoginLogoShine {
  0%,
  55% {
    transform: translate(-170%, -10%) skewX(-12deg);
    opacity: 0;
  }
  60% {
    opacity: 1;
  }
  100% {
    transform: translate(240%, 12%) skewX(-12deg);
    opacity: 0;
  }
}
