
.card [hidden] { display: none !important; }
.card .auth-link {
  display: inline-block;
  width: auto;
  align-self: flex-start;
  padding: 10px 0;
  margin: 4px 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--pt-accent);
  font: inherit;
  font-size: .9rem;
  text-decoration: underline;
  cursor: pointer;
}
.auth-message { color: var(--text-2); font-size: .9rem; line-height: 1.5; overflow-wrap: anywhere; }

:root {
  /* BusinessOS UI tokens (Phase 1) */
  --pt-accent: #21c5ff;
  --bg-page: #0b1220;
  --bg-surface: #0b1220;
  --bg-card: #0b1220;
  --bg-modal: #0f1117;
  --border-subtle: rgba(148,163,184,.22);
  --text-1: #f8fafc;
  --text-2: #e5e7eb;
  --muted: rgba(148,163,184,.78);
  --r-card: 12px;
  --r-input: 10px;
  --r-btn: 10px;
  --r-modal: 12px;
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --shadow-card: 0 8px 24px rgba(2,6,23,.55);
  --shadow-modal: 0 24px 60px rgba(2,6,23,.60);
  --shadow-active: 0 0 0 3px rgba(33,197,255,.22);
  --input-h: 44px;
  --btn-h: 44px;
  --focus-ring: 0 0 0 3px rgba(33,197,255,.22);

  --radius:12px;
  --space:16px;
  --max:420px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 36px 16px 160px; /* optical center: shift stack slightly up */
  background:
      radial-gradient(80rem 60rem at 15% 10%, #0b3a78 0%, rgba(11,58,120,0.42) 32%, rgba(15,23,42,0.62) 58%),
      radial-gradient(70rem 50rem at 92% 115%, #0a5b7a 0%, rgba(10,91,122,0.35) 30%, rgba(15,23,42,0.75) 62%),
      #0b1220;
    background-attachment: fixed;
    color: #0b1220;
}

/* Logo placeholder */
.logo-banner {
  width: min(90vw, var(--max));
  height: 64px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid rgba(148,163,184,.12);
  border-radius: 10px;
  overflow: hidden;
  opacity: .75;
}
.logo-banner img { max-height: 100%; max-width: 100%; object-fit: contain; display: none; }
.logo-banner.loaded { opacity: 1; border-color: transparent; }

.subtitle {
  width: min(90vw, var(--max));
  text-align: center;
  color: rgba(147,197,253,.85);
  font-weight: 600;
  letter-spacing: .2px;  margin: 6px 0 0;
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  text-shadow: 0 1px 0 rgba(0,0,0,.08);
}

.card {
  padding-bottom: calc(var(--space) * 2.8);
  display: flex;
  flex-direction: column;
  width: min(90vw, var(--max));
  background: #0b1220;
  color: #e5e7eb;
  border: 1px solid rgba(148,163,184,.22);
  border-radius: 10px;
  padding: calc(var(--space) * 2.4);
  box-shadow:
    0 8px 24px rgba(2,6,23,.55),
    0 1px 0 rgba(255,255,255,.03) inset;
}
h1 {
  margin: 4px 0 6px;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: .2px;
  color: #f8fafc;
}

label { display:block; margin: 14px 0 6px; font-weight: 600; }
/* Password controls retain their layout when visibility changes the input type. */
input[type="email"], input.password-input {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  font-size: 16px; outline: none; background-clip: padding-box; -webkit-appearance:none;
  background: rgba(15,23,42,.65);
  color: #e5e7eb;
  border: 1px solid rgba(148,163,184,.20);
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
input:focus {
  background: rgba(30,41,59,.86);
  border-color: rgba(147,197,253,.55);
  box-shadow: 0 0 0 2px rgba(147,197,253,.18);
}
input::placeholder { color: rgba(148,163,184,.72); }

.actions { display:flex; justify-content:flex-end; margin-top: 6px; }
.actions a { font-size:.85rem; color:#8fb7ff; text-decoration:none; opacity:.9; }
.actions a:hover { opacity:1; text-decoration:underline; }

.row { display:flex; align-items:center; justify-content:flex-start; gap: 10px; margin-top: 16px; }
button {
  width: 100%;
  margin-top: 16px;
  appearance: none;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 10px;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  background: #245fe0; /* intelligent blue, slightly calmer than pure #2563eb */
  color: #ffffff;
  box-shadow:
    0 10px 22px rgba(2,6,23,.45),
    0 1px 0 rgba(255,255,255,.06) inset;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .12s ease;
}

button:hover {
  background: #1f56cf;
  border-color: rgba(148,163,184,.24);
}

button:active {
  transform: translateY(1px);
  box-shadow:
    0 6px 16px rgba(2,6,23,.50),
    0 1px 0 rgba(255,255,255,.05) inset;
}

button:focus-visible {
  outline: none;
  box-shadow:
    0 10px 22px rgba(2,6,23,.45),
    0 1px 0 rgba(255,255,255,.06) inset,
    0 0 0 3px rgba(147,197,253,.22);
  border-color: rgba(147,197,253,.45);
}

button:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}


.error { margin-top: 10px; color: #b91c1c; display:none; }
.error:not(:empty) { display: block; }

#loginForm button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Same compact ring pattern as the OPS status-loading indicator. */
.login-spinner {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 2px solid rgba(241,245,249,0.20);
  border-top-color: currentColor;
  border-radius: 999px;
  animation: login-spin 0.75s linear infinite;
}

.login-spinner[hidden] { display: none; }

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

@media (prefers-reduced-motion: reduce) {
  .login-spinner { animation: none; }
}

/* Eye toggle inside the password field */
.pw { position: relative; }
.pw input { padding-right: 44px; }
.toggle {
  position:absolute; right:8px; top:50%; transform: translateY(-50%);
  width: 28px; height: 28px;
  background: transparent; border: none;
  cursor: pointer; padding: 0; line-height: 0;
  display: grid; place-items: center;
  color: #9fb6ff;
}
.toggle:hover { opacity: .95; transform: translateY(-50%) scale(1.03); }
.toggle svg { width: 18px; height: 18px; stroke: currentColor; }

.visually-hidden { position: absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* Edge/IE native reveal/clear verbergen */
input::-ms-reveal, input::-ms-clear { display: none; }

/* Autofill fixes */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px rgba(15,23,42,0.75) inset !important;
  -webkit-text-fill-color: #e5e7eb !important;
  caret-color: #e5e7eb !important;
  transition: background-color 9999s ease-in-out 0s !important;
  border: 1px solid rgba(148,163,184,0.2) !important;
}
input:-moz-autofill {
  box-shadow: 0 0 0 1000px rgba(15,23,42,0.75) inset !important;
  -moz-text-fill-color: #e5e7eb !important;
  caret-color: #e5e7eb !important;
  border: 1px solid rgba(148,163,184,0.2) !important;
}

/* Forced colors */
@media (forced-colors: active) {
  input[type="email"], input.password-input {
    forced-color-adjust: none;
    background: Canvas !important;
    color: CanvasText !important;
    border-color: GrayText !important;
  }
  .card, .toggle { forced-color-adjust: none; }
}

/* iOS/Safari */
html { -webkit-text-size-adjust: 100%; }
input, button { -webkit-appearance: none; appearance: none; }



/* ==== Fix: Eye alignment inside password field ==== */
.pw { position: relative; }
.pw input {
  padding-right: 52px;
  height: 44px;
  line-height: 1.2;
}
.toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  display: grid;
  place-items: center;
  color: #a7c0ff;
  z-index: 2;
}
.toggle:hover { opacity: .95; transform: translateY(-50%) scale(1.04); }
.toggle svg { width: 18px; height: 18px; stroke: currentColor; }

.row label { gap: 12px; }
/* ==== End fixes ==== */


/* === LeadOS login: stabilization overrides (keeps existing design intact) === */

/* 1) Ensure the logo actually shows (older versions hid it) */
.logo-banner img,
.logo-banner .logo-wordmark{
  display: block !important;
  height: 32px;
  width: auto;
  max-width: 240px;
}

/* 2) Remove placeholder-box styling from the logo area */
.logo-banner{
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  opacity: 1 !important;
  min-height: 44px; /* keeps layout stable */
  display: flex !important;
  align-items: center;
  justify-content: center;
}

/* 3) Optical centering (slightly above true center) */
body{
  min-height: 100svh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 48px 16px 96px !important; /* more bottom padding => optical lift */
}

/* Wrap stack so logo height doesn't distort perceived centering */
.login-stack{
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transform: translateY(-26px);
}

/* On shorter screens, reduce the lift to avoid clipping */
@media (max-height: 760px){
  .login-stack{ transform: translateY(-8px); }
  body{ padding: 32px 16px 64px !important; }
}


/* Inline SVG support (if logo is embedded as <svg class="logo-wordmark">) */
svg.logo-wordmark{
  color: #b6c3d6;
}


/* === Login page: card header zone + footer === */

.card-head{
  width: 100%;
  margin: 2px 0 14px;
}

.tenant{
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 12px;
  background: rgba(15,23,42,.40);
  border: 1px solid rgba(148,163,184,.14);
}

.tenant-logo{
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(148,163,184,.12);
  border: 1px solid rgba(148,163,184,.18);
  color: #e5e7eb;
  font-weight: 800;
  letter-spacing: .4px;
  flex: 0 0 auto;
}

.tenant-logo-text{
  font-size: 0.9rem;
  line-height: 1;
}

.tenant-meta{
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tenant-name{
  font-weight: 700;
  color: #f8fafc;
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tenant-welcome{
  font-weight: 600;
  color: rgba(147,197,253,.88);
  font-size: 0.92rem;
}

/* Support link under primary CTA */
.support{
  margin-top: 28px;
  display: flex;
  justify-content: center;
}
.support a{
  font-size: .84rem;
  color: rgba(203,213,225,.82);
  text-decoration: none;
}
.support a:hover{
  color: rgba(226,232,240,.92);
  text-decoration: underline;
}

/* Footer under the card */
.login-footer{
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  width: min(90vw, 520px);
  margin-top: 14px;
  text-align: center;
  font-size: .78rem;
  color: rgba(148,163,184,.78);
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}
.login-footer .sep{ opacity: .6; }

/* Platform welcome above tenant brand */
.platform-welcome{
  width: 100%;
  text-align: left;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: .2px;
  font-size: 1.05rem;
  margin: 2px 0 10px;
}

/* === Customer brand row (Binance-like) === */
.brand-row{
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 16px;

  margin-bottom: 22px;

  margin-bottom: 48px; /* strong separation brand -> action */
}

.brand-mark{
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: .82rem;
  letter-spacing: .4px;
  color: #0b1220;
  background: rgba(147,197,253,.95);
  box-shadow: 0 6px 14px rgba(2,6,23,.35);
}

.brand-name{
  font-weight: 800;
  letter-spacing: .2px;
  color: #f8fafc;
  font-size: 1.02rem;
}

/* Slightly tighter top title spacing now that brand row exists */
.card h1{
  margin-top: 0;
}

/* === Card inner gradient & glow (Binance-style depth) === */
.card{
  position: relative;
  overflow: hidden;
}

/* Top-left soft glow (subtle) */
.card::before{
  content: "";
  position: absolute;
  top: -150px;
  left: -150px;
  width: 320px;
  height: 320px;
  background: radial-gradient(
    circle,
    rgba(147,197,253,0.10) 0%,
    rgba(147,197,253,0.06) 28%,
    rgba(147,197,253,0.025) 48%,
    rgba(147,197,253,0.0) 68%
  );
  pointer-events: none;
}

/* Bottom-right micro-glow (very subtle) */
.card::after{
  content: "";
  position: absolute;
  bottom: -220px;
  right: -220px;
  width: 380px;
  height: 380px;
  background: radial-gradient(
    circle,
    rgba(59,130,246,0.06) 0%,
    rgba(59,130,246,0.03) 34%,
    rgba(59,130,246,0.012) 54%,
    rgba(59,130,246,0.0) 74%
  );
  pointer-events: none;
}


.footer-links{
  display: inline-flex;
  gap: 6px;
  margin-left: 6px;
}
.footer-links a{
  color: rgba(148,163,184,.85);
  text-decoration: none;
}
.footer-links a:hover{
  color: rgba(226,232,240,.95);
  text-decoration: underline;
}


.footer-brand{
  color: rgba(148,163,184,.85);
  font-size: .78rem;
  text-decoration: none;
  transition: color .15s ease;
}
.footer-brand:hover{
  color: rgba(226,232,240,.95);
  text-decoration: underline;
}


/* Subtle welcome above the card (kept quiet on purpose) */
.login-welcome{
  text-align: center;
  font-size: 1.05rem;              /* was te klein */
  color: rgba(226,232,240,.9);     /* dichter bij card-tekst */
  letter-spacing: .2px;
  margin-bottom: 26px;             /* iets meer lucht */
  user-select: none;
}



/* === Footer link color hard override (fix browser defaults) === */
.login-footer a,
.login-footer a:link,
.login-footer a:visited{
  color: rgba(148,163,184,.85);
  font-size: .78rem;
  text-decoration: none;
}

.login-footer a:hover{
  color: rgba(226,232,240,.95);
  text-decoration: underline;
}

.login-footer a:active{
  color: rgba(226,232,240,.95);
}


/* === Card footer (inside login card) === */
.card-footer{
  margin-top: auto;
  padding-top: 28px;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(148,163,184,.7);
}


/* ==================================================
   STEP 2 — Mobile safe-area & app-feel fixes
   ================================================== */

/* Ensure background fills entire viewport incl. iOS safe-area */
html, body {
  background-color: #0b1220;
}

/* Prevent iOS overscroll white flash */
body {
  overscroll-behavior: none;
}

/* Safe-area padding handling (iOS) */
@supports (padding: env(safe-area-inset-top)) {
  body {
    padding-top: calc(48px + env(safe-area-inset-top)) !important;
    padding-bottom: calc(96px + env(safe-area-inset-bottom)) !important;
  }
}

/* Mobile-specific card positioning */
@media (max-width: 520px) {
  .login-stack {
    transform: translateY(-12px);
  }

  .card {
    border-radius: 14px;
  }

  .card-footer {
    padding-top: 32px;
    font-size: 0.72rem;
  }
}


/* ==================================================
   STEP 3 — Mobile finesse & tappability
   ================================================== */

@media (max-width: 520px) {

  /* Bigger primary action for thumbs */
  button[type="submit"]{
    padding: 14px 16px;
    font-size: 16.5px;
    margin-top: 20px;
  }

  /* Slightly calmer eye icon contrast on mobile */
  .toggle{
    color: rgba(159,182,255,.85);
  }

  /* Improve vertical rhythm inside the card */
  .card form{
    margin-bottom: 6px;
  }

  .card-footer{
    padding-top: 36px;
  }
}

/* ==================================================
   Phase 4 - BusinessOS premium minimal baseline (login)
   Minimal overrides; keep layout/functionality intact
   ================================================== */
body{
  background:
    radial-gradient(72rem 52rem at 14% 8%, rgba(33,197,255,0.06), transparent 62%),
    radial-gradient(60rem 44rem at 88% 108%, rgba(33,197,255,0.04), transparent 66%),
    var(--bg-page) !important;
  color: var(--text-1);
}

.card{
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--r-card) !important;
  box-shadow: var(--shadow-card) !important;
}

.card::before,
.card::after{
  content: none !important;
}

input[type="email"],
input.password-input{
  height: var(--input-h);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-input);
  color: var(--text-1);
}

input[type="email"]:focus,
input.password-input:focus{
  background: rgba(255,255,255,0.04);
  border-color: var(--pt-accent);
  box-shadow: var(--focus-ring);
  outline: none;
}

input::placeholder{
  color: rgba(231,233,238,0.50);
}

button[type="submit"]{
  height: var(--btn-h);
  min-height: var(--btn-h);
  padding: 0 14px;
  border-radius: var(--r-btn);
  border: 1px solid rgba(33,197,255,0.28);
  background: rgba(33,197,255,0.14);
  color: var(--text-1);
  box-shadow: none;
}

button[type="submit"]:hover{
  background: rgba(33,197,255,0.18);
  border-color: rgba(33,197,255,0.38);
}

button[type="submit"]:focus-visible{
  outline: none;
  border-color: var(--pt-accent);
  box-shadow: var(--focus-ring);
}

.brand-mark{
  background: rgba(33,197,255,0.14);
  border: 1px solid rgba(33,197,255,0.24);
  color: var(--text-1);
  box-shadow: none;
}

.brand-name{
  color: var(--text-1);
}

.card-footer{
  color: var(--muted);
}

.login-brand{
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 32px;
}

.brand-slot{
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 56px;
}

.brand-wordmark{
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-weight: 800;
  letter-spacing: .2px;
  font-size: 32px;
  line-height: 1;
}

.brand-wordmark .brand-perra{
  color: var(--text-1);
}

.brand-wordmark .brand-tech{
  color: var(--pt-accent);
  font-style: italic;
  font-weight: inherit;
}

.brand-logo{
  display: block;
  max-height: 56px;
  max-width: 220px;
  width: auto;
  height: auto;
  object-fit: contain;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.brand-logo[hidden]{
  display: none !important;
}

/* ==================================================
   Phase 2 - Tokenized core controls/cards (minimal diff)
   ================================================== */
.card{
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--r-card) !important;
  box-shadow: var(--shadow-card) !important;
}

input[type="email"],
input.password-input{
  height: var(--input-h);
  border-radius: var(--r-input);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-1);
}

input[type="email"]:focus,
input.password-input:focus,
.pw input:focus{
  background: var(--bg-card);
  border-color: var(--pt-accent);
  box-shadow: var(--focus-ring);
  outline: none;
}

input::placeholder{
  color: var(--muted);
}

button,
button[type="submit"]{
  min-height: var(--btn-h);
  border-radius: var(--r-btn);
}

button[type="submit"]{
  border: 1px solid color-mix(in srgb, var(--pt-accent) 22%, rgba(255,255,255,0.14));
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--pt-accent) 18%, rgba(255,255,255,0.04)) 0%,
      color-mix(in srgb, var(--pt-accent) 12%, rgba(15,23,42,0.18)) 100%
    );
  color: var(--text-1);
  font-weight: 600;
  box-shadow:
    0 8px 18px rgba(2,6,23,.28),
    0 1px 0 rgba(255,255,255,.07) inset;
}

button[type="submit"]:hover{
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--pt-accent) 21%, rgba(255,255,255,0.05)) 0%,
      color-mix(in srgb, var(--pt-accent) 14%, rgba(15,23,42,0.2)) 100%
    );
  border-color: color-mix(in srgb, var(--pt-accent) 28%, rgba(255,255,255,0.18));
  box-shadow:
    0 12px 24px rgba(2,6,23,.34),
    0 1px 0 rgba(255,255,255,.09) inset;
}

button[type="submit"]:active{
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--pt-accent) 16%, rgba(255,255,255,0.03)) 0%,
      color-mix(in srgb, var(--pt-accent) 12%, rgba(15,23,42,0.22)) 100%
    );
}

button:focus-visible,
button[type="submit"]:focus-visible{
  outline: none;
  border-color: var(--pt-accent);
  box-shadow:
    0 10px 22px rgba(2,6,23,.45),
    0 1px 0 rgba(255,255,255,.06) inset,
    var(--focus-ring);
}
