/* Chakra AI sign-in. The dashboard theme's palette (deep navy, the logo's #00E9FB -> #0090F0
   gradient) in the Chakra License Hub's layout. Dark only, like the dashboard. */
:root {
  --canvas: #050b18;
  --panel: #07101f;
  --panel-2: #0b1729;
  --panel-3: #0f1f36;
  --line: rgba(150, 205, 255, 0.08);
  --line-strong: rgba(150, 205, 255, 0.16);
  --ink: #e8f5ff;
  --ink-2: #a6bcd2;
  --ink-3: #6a829e;
  --accent: #00c2f6;
  --accent-hi: #00e9fb;
  --accent-lo: #0090f0;
  --accent-ink: #02101c;
  --critical: #ff6b7a;
  --ok: #34d399;
  --radius: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--canvas);
  color: var(--ink);
  font: 400 14px/1.55 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
::selection { background: rgba(0, 194, 246, 0.35); }

.shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 1024px) {
  .shell { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
}

/* ---- the story, wide screens only ------------------------------------------------------- */
.story {
  display: none;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 56px;
  background: var(--panel);
  border-right: 1px solid var(--line);
}
@media (min-width: 1024px) { .story { display: flex; } }
@media (min-width: 1280px) { .story { padding: 64px; } }

.story-grid {
  position: absolute; inset: 0; z-index: -1; opacity: 0.4;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
                    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
}
.story-glow { position: absolute; z-index: -1; border-radius: 50%; }
.story-glow-a { top: -160px; left: -130px; width: 560px; height: 560px; background: rgba(0, 233, 251, 0.12); filter: blur(130px); }
.story-glow-b { bottom: -190px; right: -120px; width: 620px; height: 620px; background: rgba(0, 144, 240, 0.16); filter: blur(140px); }

.story-logo { height: 44px; width: auto; align-self: flex-start; }

.story-body { max-width: 520px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px; border-radius: 999px;
  border: 1px solid rgba(0, 194, 246, 0.25); background: rgba(0, 194, 246, 0.06);
  color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.story h2 {
  margin: 24px 0 0; font-size: 42px; line-height: 1.08; font-weight: 600; letter-spacing: -0.02em; color: var(--ink);
}
@media (min-width: 1280px) { .story h2 { font-size: 46px; } }
.grad {
  background: linear-gradient(90deg, var(--accent-hi), var(--accent-lo));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.features { list-style: none; margin: 40px 0 0; padding: 0; display: grid; gap: 16px; }
.features li { display: flex; align-items: center; gap: 16px; font-size: 14px; font-weight: 500; }
.feature-icon {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  border-radius: var(--radius); background: rgba(15, 31, 54, 0.8); border: 1px solid var(--line-strong);
  color: var(--accent); font-size: 17px;
}
.story-foot { margin: 0; font-size: 12px; color: var(--ink-3); }

/* ---- the form ---------------------------------------------------------------------------- */
.panel {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 16px 72px;
}
@media (min-width: 640px) { .panel { padding: 48px 40px 72px; } }
.panel-glow {
  position: absolute; z-index: -1; top: -130px; left: 50%; transform: translateX(-50%);
  width: 520px; max-width: 140vw; height: 520px; border-radius: 50%;
  background: rgba(0, 194, 246, 0.10); filter: blur(120px);
}
@media (min-width: 1024px) { .panel-glow { display: none; } }

.card { width: 100%; max-width: 400px; }

.step h1 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -0.015em; }
.lead { margin: 8px 0 28px; color: var(--ink-2); }
.lead strong { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }

.alert {
  display: flex; gap: 10px; align-items: flex-start;
  margin: -8px 0 22px; padding: 12px 14px; border-radius: var(--radius);
  background: rgba(255, 107, 122, 0.1); border: 1px solid rgba(255, 107, 122, 0.3);
  color: var(--critical); font-size: 13px;
}
.alert a { color: inherit; font-weight: 600; }

label { display: block; margin: 0 0 8px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field { position: relative; margin-bottom: 20px; }
.field-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 16px; color: var(--ink-3); pointer-events: none; }
.field input {
  width: 100%; height: 44px; padding: 0 12px 0 40px;
  border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: rgba(11, 23, 41, 0.8); color: var(--ink); font: inherit; font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input::placeholder { color: var(--ink-3); }
.field input:focus { outline: none; border-color: rgba(0, 194, 246, 0.6); box-shadow: 0 0 0 4px rgba(0, 194, 246, 0.1); }
.field input[type="password"], .field input.has-reveal { padding-right: 44px; }
.reveal {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-3); cursor: pointer; font-size: 16px;
}
.reveal:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.reveal:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.reveal .eye-off, .reveal[aria-pressed="true"] .eye { display: none; }
.reveal[aria-pressed="true"] .eye-off { display: block; }

.primary {
  position: relative; width: 100%; height: 44px; margin-top: 4px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--radius); cursor: pointer;
  background: linear-gradient(90deg, var(--accent-hi), var(--accent-lo));
  color: var(--accent-ink); font: inherit; font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 30px -8px rgba(0, 194, 246, 0.7);
  transition: filter 0.15s, opacity 0.15s;
}
.primary:hover { filter: brightness(1.08); }
.primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.primary .arrow { font-size: 16px; transition: transform 0.15s; }
.primary:hover .arrow { transform: translateX(2px); }
.primary .spinner { display: none; }
.primary.busy { opacity: 0.7; pointer-events: none; }
.primary.busy .arrow { display: none; }
.primary.busy .spinner {
  display: block; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(2, 16, 28, 0.25); border-top-color: var(--accent-ink);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.back {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 24px; padding: 0;
  border: 0; background: none; color: var(--ink-3); font: inherit; font-size: 13px; cursor: pointer;
}
.back:hover { color: var(--ink); }
.back svg { font-size: 15px; }

.step-icon {
  width: 48px; height: 48px; margin-bottom: 20px; display: grid; place-items: center;
  border-radius: 14px; background: rgba(0, 194, 246, 0.08); border: 1px solid rgba(0, 194, 246, 0.25);
  color: var(--accent); font-size: 22px;
}
.step-icon.ok { background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.3); color: var(--ok); }
.step-done { text-align: left; }

.otp { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; }
.otp input {
  width: 100%; min-width: 0; height: 54px; flex: 1;
  border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: rgba(11, 23, 41, 0.8); color: var(--ink);
  font: 600 22px/1 "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.otp input:focus { outline: none; border-color: rgba(0, 194, 246, 0.6); box-shadow: 0 0 0 4px rgba(0, 194, 246, 0.1); }
.otp.bad input { border-color: rgba(255, 107, 122, 0.55); }
.otp-gap { width: 6px; flex: none; }

.resend { margin: 18px 0 0; font-size: 13px; color: var(--ink-3); }
.resend button {
  padding: 0; border: 0; background: none; font: inherit; color: var(--accent); cursor: pointer; font-weight: 500;
}
.resend button:disabled { color: var(--ink-3); cursor: default; }

.note {
  display: flex; gap: 8px; align-items: flex-start;
  margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--ink-3);
}
.note svg { flex: none; margin-top: 2px; font-size: 14px; color: var(--ink-2); }
.note code { font-family: "JetBrains Mono", ui-monospace, monospace; color: var(--ink-2); }

.copyright { position: absolute; bottom: 24px; left: 0; right: 0; margin: 0; text-align: center; font-size: 11px; color: var(--ink-3); }
.noscript { text-align: center; color: var(--ink-2); }

/* plain notices (bad link, not set up) */
body.plain { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.notice { max-width: 420px; text-align: center; }
.notice h1 { margin: 18px 0 8px; font-size: 22px; }
.notice p { margin: 0 0 24px; color: var(--ink-2); }
.btn {
  display: inline-block; padding: 10px 18px; border-radius: var(--radius);
  background: linear-gradient(90deg, var(--accent-hi), var(--accent-lo)); color: var(--accent-ink);
  font-weight: 600; text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation-duration: 0s !important; }
}
