/* ============================================================
   JobCycle entry theme — the ONE source of the site's dark look
   for the entry screens (owner decision 15, 2026-11-27).

   SOURCE (edit only this file):
     toolroom-turbo/apps/marketing-jobcycle/entry-theme/entry-theme.css
   Read by:
     - the marketing site: the cinematic home (tokens) and the
       sign-up screens /sign-up, /sign-up/confirm (tokens + .entry-*)
     - identity's static pages /login and /set-password, through the
       GENERATED copy toolroom-platform-services/apps/identity/src/
       features/login/public/theme/entry-theme.css (with the fonts
       and the logo next to it).
   After an edit run (from the site folder):
       node entry-theme/sync-entry-theme.mjs          (writes the copy)
       node entry-theme/sync-entry-theme.mjs --check  (fails on drift;
                                                       also run by npm test)
   Never edit the copy in identity by hand.

   Entry screens follow the marketing site, NOT Design Standard v1.1
   (decision 15): weights 700/800 on titles and the gradient button
   stay here on purpose. Fonts: Nunito Sans + IBM Plex Mono, self-hosted
   (site: app/fonts/fonts.css; identity: theme/fonts/fonts.css).
   ============================================================ */

/* ---------- 1. tokens (cinematic home + entry screens) ---------- */
:where(.cine, .entry) {
  --void: #06080f;
  --navy: #0a0e1a;
  --panel: #0e1424;
  --line: rgba(140, 170, 255, 0.14);
  --text: #eef2ff;
  --text-dim: #9aa3b8;
  --cyan: #4cc9f0;
  --blue: #2e86de;
  --amber: #ffb020;
  --red: #ff4d4d;
  --green: #00e096;
  --font-display: "Nunito Sans", system-ui, sans-serif;
  --font-body: "Nunito Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

/* ---------- 2. page ---------- */
/* identity puts .entry on <body>; the site renders .entry-page inside it */
body.entry,
body:has(.entry-page) {
  margin: 0;
  background: #06080f;
  background-image: none;
}

.entry {
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.entry *,
.entry *::before,
.entry *::after {
  box-sizing: border-box;
}

.entry ::selection {
  background: rgba(76, 201, 240, 0.35);
}

.entry-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(
      900px 600px at 70% 20%,
      rgba(46, 134, 222, 0.12),
      transparent 60%
    ),
    linear-gradient(rgba(140, 170, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 170, 255, 0.045) 1px, transparent 1px),
    var(--void);
  background-size:
    100% 100%,
    56px 56px,
    56px 56px,
    100% 100%;
}

.entry-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 48px);
}

.entry-brand {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
}

.entry-brand img {
  height: 30px;
  width: auto;
  display: block;
}

.entry-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px clamp(16px, 4vw, 48px) 56px;
}

.entry-card {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(30px, 5vw, 80px);
  align-items: center;
  animation: entry-in 0.6s cubic-bezier(0.22, 0.8, 0.28, 1);
}

.entry-card--single {
  width: min(600px, 100%);
  grid-template-columns: minmax(0, 1fr);
}

@keyframes entry-in {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 3. brand copy (left column) ---------- */
.entry-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 18px;
}

.entry-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
}

.entry-copy h1 .dim,
.entry .dim {
  color: var(--text-dim);
}

.entry-copy p {
  margin: 18px 0 0;
  color: var(--text-dim);
  max-width: 420px;
  line-height: 1.6;
}

.entry-copy ul {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.entry-copy li {
  color: var(--text-dim);
  font-size: 0.95rem;
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.entry-copy li::before {
  content: "→";
  color: var(--cyan);
}

/* ---------- 4. glass panel (right column) ---------- */
.entry-panel {
  background: linear-gradient(
    170deg,
    rgba(18, 26, 48, 0.85),
    rgba(10, 14, 26, 0.95)
  );
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(22px, 3vw, 40px);
  backdrop-filter: blur(8px);
}

.entry-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 8px;
}

.entry-title:focus {
  outline: none;
}

.entry-subtitle {
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0 0 24px;
}

/* ---------- 5. form ---------- */
.entry-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}

.entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.entry-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.entry-field label,
.entry-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.entry-input,
.entry-field input {
  width: 100%;
  min-width: 0;
  background: rgba(6, 8, 15, 0.6);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 16px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.5;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition:
    border-color 0.25s,
    box-shadow 0.25s;
}

.entry-field input::placeholder {
  color: rgba(154, 163, 184, 0.55);
}

.entry-field input:focus {
  border-color: rgba(76, 201, 240, 0.6);
  box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.12);
}

.entry-field input[aria-invalid="true"] {
  border-color: rgba(255, 77, 77, 0.7);
}

.entry-field input:disabled,
.entry-field input[readonly] {
  opacity: 0.7;
}

/* input + something on its right (address suffix, show-password button) */
.entry-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.entry-input-group input {
  flex: 1;
}

.entry-suffix {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.entry-error {
  color: var(--red);
  font-size: 0.8rem;
  line-height: 1.4;
  margin: 0;
}

.entry-error:empty {
  display: none;
}

.entry-hint {
  color: var(--text-dim);
  font-size: 0.8rem;
  line-height: 1.45;
  margin: 0;
}

.entry-hint--ok {
  color: var(--green);
}

.entry-hint--bad {
  color: var(--red);
}

/* the server's password rule, shown under the field */
.entry-rules {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.entry-rules li {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.entry-rules li::before {
  content: "○";
  flex: 0 0 auto;
  font-size: 0.75rem;
}

.entry-rules li[data-ok="true"] {
  color: var(--text);
}

.entry-rules li[data-ok="true"]::before {
  content: "✓";
  color: var(--green);
}

/* consent checkbox */
.entry-check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-dim);
  cursor: pointer;
}

.entry-check input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--cyan);
  cursor: pointer;
}

.entry-check input:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.entry-check input[aria-invalid="true"] {
  outline: 2px solid rgba(255, 77, 77, 0.7);
  outline-offset: 2px;
}

.entry-version {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* ---------- 6. buttons and links ---------- */
.entry-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 22px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s,
    opacity 0.25s;
}

.entry-btn--primary {
  color: #041018;
  background: linear-gradient(120deg, var(--cyan), var(--blue));
  box-shadow:
    0 0 0 1px rgba(76, 201, 240, 0.4),
    0 12px 40px -12px rgba(46, 134, 222, 0.8);
}

.entry-btn--primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(76, 201, 240, 0.7),
    0 18px 50px -12px rgba(76, 201, 240, 0.9);
}

.entry-btn--ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line);
}

.entry-btn--ghost:hover:not(:disabled) {
  border-color: rgba(76, 201, 240, 0.5);
  transform: translateY(-2px);
}

.entry-btn:disabled {
  opacity: 0.65;
  cursor: default;
  transform: none;
}

.entry-btn:focus-visible,
.entry-link:focus-visible,
.entry-brand:focus-visible,
.entry a:focus-visible,
.entry-choice:focus-visible,
.entry-lang button:focus-visible,
.entry-toggle:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.entry-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

/* a button that looks like a link (forgot password, back, show password) */
.entry-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--cyan);
  cursor: pointer;
  text-decoration: none;
  border-radius: 4px;
}

.entry-link:hover {
  text-decoration: underline;
}

.entry-link--end {
  align-self: flex-end;
}

.entry-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.entry-back:hover {
  color: var(--cyan);
  text-decoration: none;
}

.entry-toggle {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 10px 12px;
  cursor: pointer;
}

.entry-toggle:hover {
  color: var(--cyan);
  border-color: rgba(76, 201, 240, 0.5);
}

/* text links only: a link styled as a button keeps the button's own colour
   (otherwise a primary link shows cyan text on the cyan button) */
.entry a:not(.entry-btn) {
  color: var(--cyan);
}

.entry-note {
  color: var(--text-dim);
  font-size: 0.84rem;
  text-align: center;
  margin: 8px 0 0;
}

.entry-note a {
  font-weight: 600;
  text-decoration: none;
}

.entry-note a:hover {
  text-decoration: underline;
}

/* list of choices (workspace picker on login) */
.entry-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  margin: 18px 0;
  padding: 2px;
}

.entry-choice {
  width: 100%;
  padding: 13px 16px;
  background: rgba(6, 8, 15, 0.6);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.25s,
    color 0.25s,
    box-shadow 0.25s;
}

.entry-choice:hover:not(:disabled) {
  border-color: rgba(76, 201, 240, 0.6);
  color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.1);
}

.entry-choice:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ---------- 7. loading ---------- */
.entry-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: entry-spin 0.8s linear infinite;
  flex: 0 0 auto;
}

.entry-spinner--large {
  width: 40px;
  height: 40px;
  border-width: 3px;
  color: var(--cyan);
}

@keyframes entry-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- 8. messages ---------- */
.entry-alert {
  margin: 4px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--red);
  background: rgba(255, 77, 77, 0.08);
  border: 1px solid rgba(255, 77, 77, 0.35);
}

.entry-alert:empty {
  display: none;
}

.entry-alert--info {
  color: var(--text);
  background: rgba(76, 201, 240, 0.07);
  border-color: rgba(76, 201, 240, 0.3);
}

.entry-alert--warn {
  color: var(--amber);
  background: rgba(255, 176, 32, 0.07);
  border-color: rgba(255, 176, 32, 0.32);
}

.entry-alert p {
  margin: 0;
}

.entry-alert p + p {
  margin-top: 6px;
}

/* big state (check your e-mail, ready, failed) */
.entry-state {
  text-align: center;
  padding: 8px 0 4px;
}

.entry-state-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  border: 1px solid var(--line);
  background: rgba(76, 201, 240, 0.08);
  color: var(--cyan);
}

.entry-state-icon--ok {
  color: var(--green);
  background: rgba(0, 224, 150, 0.08);
  border-color: rgba(0, 224, 150, 0.35);
}

.entry-state-icon--bad {
  color: var(--red);
  background: rgba(255, 77, 77, 0.08);
  border-color: rgba(255, 77, 77, 0.35);
}

.entry-state .entry-subtitle {
  margin-bottom: 18px;
  overflow-wrap: anywhere;
}

/* preparation steps on the waiting screen */
.entry-steps {
  list-style: none;
  margin: 4px 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.entry-steps li {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--text-dim);
  font-size: 0.92rem;
}

.entry-steps li::before {
  content: "";
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid var(--line);
}

.entry-steps li[data-state="active"] {
  color: var(--text);
}

.entry-steps li[data-state="active"]::before {
  background: var(--amber);
  border-color: var(--amber);
  animation: entry-breathe 1.8s ease-in-out infinite;
}

.entry-steps li[data-state="done"] {
  color: var(--text);
}

.entry-steps li[data-state="done"]::before {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 8px rgba(0, 224, 150, 0.6);
}

@keyframes entry-breathe {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

/* ---------- 9. language switch ---------- */
.entry-lang {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(6, 8, 15, 0.6);
}

.entry-lang button {
  background: none;
  border: none;
  border-radius: 999px;
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  cursor: pointer;
}

.entry-lang button:hover {
  color: var(--text);
}

.entry-lang button[aria-pressed="true"] {
  color: #041018;
  background: var(--cyan);
}

/* ---------- 10. helpers ---------- */
.entry-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.entry [hidden] {
  display: none !important;
}

/* ---------- 11. responsive ---------- */
@media (max-width: 900px) {
  .entry-main {
    align-items: flex-start;
  }

  .entry-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .entry-copy p {
    max-width: none;
  }

  .entry-copy ul {
    display: none;
  }

  .entry-copy h1 {
    font-size: 1.9rem;
  }
}

@media (max-width: 520px) {
  .entry-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .entry-copy h1 {
    font-size: 1.6rem;
  }

  .entry-panel {
    border-radius: 18px;
  }

  .entry-input-group--wrap {
    flex-wrap: wrap;
  }
}

/* touch screens: 16px inputs so iOS does not zoom on focus (the pages keep
   pinch-zoom for people who need it) */
@media (pointer: coarse) {
  .entry-field input {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .entry-card,
  .entry-steps li[data-state="active"]::before,
  .entry-spinner {
    animation: none;
  }

  .entry-btn,
  .entry-btn:hover {
    transition: none;
    transform: none;
  }
}
