/* ==========================================================================
   Pickscan · Veeqo auth — gateway screen components
   --------------------------------------------------------------------------
   Server-rendered (Thymeleaf) auth wizard chrome + card. Loads on top of the
   canonical tokens in styles.css. No framework, minimal JS.
   Dual-accent rule observed: the dark brand band uses the YELLOW accent;
   every accent on the light card surface is RED.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  background: var(--ps-paper);
  color: var(--ps-ink);
  font-family: var(--ps-font-body);
  font-size: var(--ps-ui-size);
  line-height: var(--ps-ui-lh);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* --- App chrome: ink brand band + white nav band ----------------------- */
.ps-chrome { background: var(--ps-white); }

.ps-brandband {
  background: var(--ps-ink);
  color: var(--ps-white);
  height: 46px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.ps-brandband .ps-wordmark { font-size: 22px; }
.ps-brandband__for {
  font-family: var(--ps-font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  padding-left: 18px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.ps-navband {
  background: var(--ps-white);
  height: 54px;
  padding: 0 28px;
  border-bottom: 1px solid var(--ps-line);
  display: flex;
  align-items: center;
}
.ps-navband__label {
  font-family: var(--ps-font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ps-ink-3);
}

/* --- Centered gateway stage -------------------------------------------- */
.ps-gate {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

/* --- Auth card --------------------------------------------------------- */
.ps-authcard {
  background: var(--ps-white);
  border: 1px solid var(--ps-line);
  border-radius: var(--ps-radius);
  width: 100%;
  max-width: 480px;
  padding: 44px 44px 40px;
}

/* --- Step indicator (2 of 3) ------------------------------------------- */
.ps-steps {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.ps-steps__track { display: flex; gap: 5px; flex: 1; }
.ps-steps__seg {
  height: 4px;
  flex: 1;
  background: var(--ps-line);
}
.ps-steps__seg--done { background: var(--ps-ink-3); }
.ps-steps__seg--active { background: var(--ps-ink); }
.ps-steps__label {
  font-family: var(--ps-font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ps-ink-3);
  white-space: nowrap;
}

/* --- Card copy --------------------------------------------------------- */
.ps-authcard__eyebrow {
  font-family: var(--ps-font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ps-ink-3);
  margin: 0 0 12px;
}
.ps-authcard__title {
  font-family: var(--ps-font-display);
  font-weight: 800;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--ps-ink);
}
.ps-authcard__lead {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ps-ink-2);
  margin: 0 0 24px;
}

/* --- Permission list --------------------------------------------------- */
.ps-perms {
  list-style: none;
  margin: 0 0 28px;
  padding: 20px;
  background: var(--ps-paper);
  border: 1px solid var(--ps-line);
}
.ps-perms__head {
  font-family: var(--ps-font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ps-ink-3);
  margin: 0 0 14px;
}
.ps-perm {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: start;
  padding: 9px 0;
  border-top: 1px solid var(--ps-line);
}
.ps-perm__scope {
  font-family: var(--ps-font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 7px;
  text-align: center;
  background: var(--ps-tag-slate-bg);
  color: var(--ps-tag-slate-fg);
  margin-top: 1px;
}
.ps-perm__scope--write { background: var(--ps-ink); color: var(--ps-white); }
.ps-perm__text { font-size: 14px; line-height: 1.45; color: var(--ps-ink-2); }
.ps-perm__text b { color: var(--ps-ink); font-weight: 600; }

/* --- Primary CTA (ink) ------------------------------------------------- */
.ps-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  border: 1px solid var(--ps-ink);
  border-radius: var(--ps-radius);
  background: var(--ps-ink);
  color: var(--ps-white);
  font-family: var(--ps-font-body);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--ps-dur-fast, 0.12s) var(--ps-ease, ease),
              color var(--ps-dur-fast, 0.12s) var(--ps-ease, ease);
}
.ps-btn:hover { background: var(--ps-ink-2); border-color: var(--ps-ink-2); }
.ps-btn__arrow { font-size: 17px; line-height: 1; }

.ps-btn--ghost {
  background: var(--ps-white);
  color: var(--ps-ink);
  border-color: var(--ps-line);
  height: 44px;
  font-size: 14px;
}
.ps-btn--ghost:hover { background: var(--ps-paper); border-color: var(--ps-line); }

/* --- Reassurance / support lines --------------------------------------- */
.ps-reassure {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--ps-ink-3);
}
.ps-reassure svg { flex-shrink: 0; }
.ps-support {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--ps-ink-3);
  text-align: center;
}
.ps-support a { color: var(--ps-ink); text-decoration: underline; text-underline-offset: 2px; }

/* --- Redirecting state -------------------------------------------------- */
.ps-view--redirecting { display: none; text-align: center; padding: 16px 0 8px; }
.ps-authcard[data-state="redirecting"] .ps-view--connect { display: none; }
.ps-authcard[data-state="redirecting"] .ps-view--redirecting { display: block; }

.ps-spinner {
  width: 44px;
  height: 44px;
  margin: 8px auto 22px;
  border: 3px solid var(--ps-line);
  border-top-color: var(--ps-ink);
  border-radius: 50%;
  animation: ps-spin 0.7s linear infinite;
}
@keyframes ps-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .ps-spinner { animation-duration: 2.2s; }
}
.ps-redirect__title {
  font-family: var(--ps-font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.ps-redirect__sub { font-size: 14px; color: var(--ps-ink-3); margin: 0; }

/* --- Error accent (RED — light surface, allowed) ----------------------- */
.ps-error__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 22px;
  background: var(--ps-error-bg);
  color: var(--ps-status-error);
}
.ps-authcard--error { border-top: 3px solid var(--ps-red); }
.ps-authcard--error .ps-authcard__eyebrow { color: var(--ps-error-fg); }

