/* Showroom sign-in: black sign-in page with the API dashboard's showcase (Bavest API
   calls feeding a drawn, brand-free security page). No customer name anywhere.
   Motion: transform and opacity only (stroke-dashoffset for the flow pulse). */

:root {
  --bg: #000;
  --panel: #070708;
  --line: #1c1c1f;
  --line-2: #2a2a2e;
  --ink: #f4f4f5;
  --ink-2: #a1a1aa;
  --ink-3: #71717a;
  --field: #0c0c0e;
  --accent: #78ddff; /* Bavest cyan, the dashboard's primary button */
  --accent-line: #3cc3ef;
  --danger: #fb7185;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page { display: grid; min-height: 100svh; }
@media (min-width: 1024px) { .page { grid-template-columns: minmax(420px, 1fr) minmax(0, 1.15fr); } }

/* ---------- Sign-in side ---------- */

.side { display: flex; flex-direction: column; gap: 24px; padding: 24px 16px; }
@media (min-width: 640px) { .side { padding: 32px 40px; } }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top img { display: block; height: auto; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 999px;
  color: var(--ink-2); font-size: 12px; white-space: nowrap;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgb(120 221 255 / 0.15); }

.center { flex: 1; display: flex; align-items: center; justify-content: center; }
.form { width: 100%; max-width: 360px; display: grid; gap: 16px; }
.intro h1 { margin: 0 0 6px; font-size: 24px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }
.intro p { margin: 0; color: var(--ink-2); }

.field { display: grid; gap: 6px; }
.label { font-size: 13px; font-weight: 550; color: var(--ink); }
input {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--field); color: var(--ink);
  font: inherit; font-size: 14px;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}
input.mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0.01em; }
input::placeholder { color: #45454c; }
input:hover { border-color: #3a3a40; }
input:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px rgb(60 195 239 / 0.2); }
.form[data-state="error"] input { border-color: rgb(251 113 133 / 0.55); }

.secret { position: relative; display: block; }
.secret input { padding-right: 64px; }
.reveal {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  height: 28px; padding: 0 10px; border: 0; border-radius: 6px;
  background: transparent; color: var(--ink-2); font: inherit; font-size: 12px; cursor: pointer;
}
.reveal:hover { background: #18181b; color: var(--ink); }
.reveal:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 1px; }

.message { min-height: 0; margin: -4px 0 0; color: var(--danger); font-size: 13px; }
.message:empty { display: none; }

.submit {
  position: relative; height: 40px; border: 0; border-radius: 8px;
  background: var(--accent); color: #0a0a0a;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 150ms;
}
.submit:hover { background: #8fe3ff; }
.submit:active { transform: scale(0.98); }
.submit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.submit[aria-busy="true"] span { opacity: 0.55; }

.fine { margin: 4px 0 0; color: var(--ink-3); font-size: 12px; }
.foot { display: flex; flex-wrap: wrap; gap: 6px; color: var(--ink-3); font-size: 12px; }
.sep { color: #3f3f46; }

/* ---------- Illustration side ---------- */

.art {
  display: none;
  position: relative;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background:
    radial-gradient(60% 50% at 50% 45%, rgb(60 195 239 / 0.07), transparent 70%),
    radial-gradient(circle at 1px 1px, rgb(255 255 255 / 0.06) 1px, transparent 0) 0 0 / 22px 22px,
    var(--panel);
}
@media (min-width: 1024px) { .art { display: flex; align-items: center; justify-content: center; padding: 48px; } }

.showcase {
  --cycle: 10.4s; /* four flows, one every 2.6 s */
  width: 100%; max-width: 640px; min-width: 0;
  display: flex; flex-direction: column; gap: 14px;
  container-type: inline-size;
}

.stage { --gutter: clamp(18px, 5.5cqw, 34px); --band: 64px; position: relative; padding: var(--band) var(--gutter); }

.code {
  position: absolute; inset: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  overflow: hidden; opacity: 0.5;
  font-family: var(--mono); font-size: 10.5px; line-height: 1.65;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 91%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 91%, transparent 100%);
}
.codeColumn { min-width: 0; overflow: hidden; }
.codeBlock { margin: 0; padding-bottom: 1.65em; white-space: pre; font: inherit; }
.t-method { color: var(--accent); font-weight: 600; }
.t-path { color: var(--ink); }
.t-status, .t-punct, .t-plain { color: var(--ink-3); }
.t-key { color: var(--ink-2); }
.t-string { color: #a5b4c3; }
.t-number { color: var(--accent); }

.tag {
  position: absolute; z-index: 2;
  max-width: calc(50% - var(--gutter) - 6px);
  padding: 4px 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  border: 1px solid var(--line-2); border-radius: 6px;
  background: #0e0e10; color: var(--ink);
  font-family: var(--mono); font-size: 10px; line-height: 1.4;
}
.tag b { color: var(--accent); font-weight: 600; }
.tag .q { color: var(--ink-3); }
.tag::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: rgb(60 195 239 / 0.1); box-shadow: inset 0 0 0 1px rgb(60 195 239 / 0.6); opacity: 0;
}
.tag-top-left { top: 20px; left: var(--gutter); }
.tag-top-right { top: 20px; right: var(--gutter); }
.tag-bottom-left { bottom: 20px; left: var(--gutter); }
.tag-bottom-right { bottom: 20px; right: var(--gutter); }

.mockFrame {
  position: relative; z-index: 1; overflow: hidden; border-radius: 10px;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1), 0 24px 60px -20px rgb(0 0 0 / 0.9), 0 0 80px -30px rgb(60 195 239 / 0.35);
}

.flows { position: absolute; top: 0; left: 0; z-index: 3; overflow: visible; pointer-events: none; }
.flowBase { stroke: var(--ink-3); stroke-width: 1; opacity: 0.35; }
.flowPulse { stroke: var(--accent-line); stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: 14 200; stroke-dashoffset: 14; opacity: 0; }
.flowEnd { fill: #0e0e10; stroke: var(--accent-line); stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: center; }

/* ---------- The mockup stays light, like a screenshot ---------- */

.mock {
  --m-surface: #fff; --m-canvas: #f5f6f7; --m-line: #e6e8eb; --m-line-2: #d4d8dc;
  --m-ink: #1d262c; --m-ink-2: #56626a; --m-ink-3: #7d878d;
  --m-accent: #78ddff; --m-accent-line: #3cc3ef; --m-accent-ink: #0e7490; --m-accent-soft: #e1f6fd; --m-pos: #13803f;
  background: var(--m-canvas); color: var(--m-ink);
  font-size: 11px; line-height: 1.35; text-align: left; font-variant-numeric: tabular-nums;
}
.mockBar { display: flex; align-items: center; gap: 10px; height: 30px; padding: 0 12px; border-bottom: 1px solid var(--m-line); background: var(--m-surface); }
.mockMenu { width: 12px; height: 9px; border-block: 1.5px solid var(--m-ink-2); background: linear-gradient(var(--m-ink-2), var(--m-ink-2)) center / 100% 1.5px no-repeat; }
.mockCrumb { color: var(--m-ink-3); font-size: 10px; white-space: nowrap; }
.mockCrumb i { margin: 0 3px; color: var(--m-line-2); font-style: normal; }
.mockSearch { width: 128px; margin-left: auto; padding: 3px 10px; border: 1px solid var(--m-line); border-radius: 999px; color: var(--m-ink-3); font-size: 9.5px; white-space: nowrap; }
.mockAvatar { flex: none; width: 18px; height: 18px; border: 1px solid var(--m-line); border-radius: 50%; background: var(--m-canvas); }

.mockHead { padding: 12px 14px 10px; background: var(--m-surface); }
.ident { display: flex; align-items: center; gap: 10px; }
.logo { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 7px; background: #1d262c; color: #9be15d; font-weight: 800; font-size: 14px; }
.identText { min-width: 0; }
.name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.ids { overflow: hidden; color: var(--m-ink-3); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.watch { flex: none; margin-left: auto; padding: 3px 8px; border: 1px solid var(--m-line-2); border-radius: 6px; color: var(--m-ink-2); font-size: 10px; }
.quoteRow { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 14px; margin-top: 10px; }
.quote { display: flex; align-items: baseline; gap: 10px; }
.price { font-size: 24px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.1; }
.currency { margin-left: 3px; color: var(--m-ink-2); font-size: 11px; font-weight: 600; }
.change { color: var(--m-pos); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.change b { margin-left: 4px; }
.quoteMeta { display: flex; flex-direction: column; gap: 2px; color: var(--m-ink-3); font-size: 9.5px; white-space: nowrap; }
.badge { width: fit-content; padding: 0 4px; border: 1px solid var(--m-line-2); border-radius: 3px; color: var(--m-ink-2); font-size: 8px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.actions { display: flex; gap: 6px; margin-left: auto; }
.buy, .sell { padding: 4px 12px; border: 1px solid var(--m-accent); border-radius: 6px; font-size: 10.5px; font-weight: 600; }
.buy { background: var(--m-accent); color: #171717; }
.sell { background: var(--m-surface); color: var(--m-accent-ink); }

.tabs { display: flex; gap: 16px; overflow: hidden; padding: 0 14px; border-bottom: 1px solid var(--m-line); background: var(--m-surface); color: var(--m-ink-2); font-size: 11px; white-space: nowrap; }
.tabs span { padding: 7px 0; }
.tabActive { color: var(--m-ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--m-accent); }

.mockBody { display: grid; gap: 8px; padding: 10px; }
.card { min-width: 0; padding: 9px 11px; border: 1px solid var(--m-line); border-radius: 8px; background: var(--m-surface); }
.cardHead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cardTitle { font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.cardMeta { color: var(--m-ink-3); font-size: 9.5px; white-space: nowrap; }
.chips { display: flex; gap: 2px; }
.chips span { padding: 1px 6px; border-radius: 4px; color: var(--m-ink-3); font-size: 9.5px; }
.chips .chipActive { background: var(--m-accent-soft); color: var(--m-accent-ink); font-weight: 600; }

.chart { position: relative; height: 84px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.grid { stroke: var(--m-line); stroke-width: 1; }
.prevClose { stroke: var(--m-ink-3); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0.7; }
.chartLine { fill: none; stroke: var(--m-accent-line); stroke-width: 1.5; stroke-linejoin: round; }
.prevLabel { position: absolute; left: 4px; padding: 0 3px; transform: translateY(-125%); background: rgb(255 255 255 / 0.85); color: var(--m-ink-3); font-size: 8.5px; }
.axis { display: flex; justify-content: space-between; margin-top: 4px; color: var(--m-ink-3); font-size: 8.5px; }

.cardRow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kv { margin: 0; }
.kv div { display: flex; justify-content: space-between; gap: 8px; padding: 3.5px 0; border-top: 1px solid var(--m-line); }
.kv div:first-child { border-top: 0; }
.kv dt { overflow: hidden; color: var(--m-ink-2); white-space: nowrap; text-overflow: ellipsis; }
.kv dd { margin: 0; font-weight: 600; white-space: nowrap; }
.pos { color: var(--m-pos); }
.consensus { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rating { color: var(--m-pos); font-size: 14px; font-weight: 700; }
.ratingScore { color: var(--m-ink-3); font-size: 9.5px; white-space: nowrap; }
.ratingBar { display: flex; gap: 1.5px; height: 6px; margin: 6px 0 4px; overflow: hidden; border-radius: 3px; }
.ratingBar span { flex-basis: 0; }
.r5 { background: #13803f; flex-grow: 31; }
.r4 { background: #6cb48b; flex-grow: 22; }
.r3 { background: #c9ced2; flex-grow: 4; }
.r2 { background: #e8a3ac; flex-grow: 1; }
.ratingCounts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; margin-bottom: 4px; color: var(--m-ink-3); font-size: 8px; text-align: center; }
.ratingCounts span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ratingCounts b { display: block; color: var(--m-ink); font-size: 10px; font-weight: 600; }

/* A field a flow feeds: a soft cyan wash while it is lit. */
.field-lit { position: relative; isolation: isolate; display: inline-block; }
.field-lit::after {
  content: ""; position: absolute; inset: -3px -6px; z-index: -1; border-radius: 5px;
  background: var(--m-accent-soft); box-shadow: inset 0 0 0 1px rgb(60 195 239 / 0.7); opacity: 0;
}
.chartPoint { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--m-accent-line); box-shadow: 0 0 0 2px var(--m-surface); }
.chartPoint::after { inset: -7px; border-radius: 50%; }

/* Each flow lights up in turn, one every 2.6 s. */
[data-tag="price"], [data-field="price"], [data-flow="price"] { --delay: 0.8s; }
[data-tag="chart"], [data-field="chart"], [data-flow="chart"] { --delay: 3.4s; }
[data-tag="pe"], [data-field="pe"], [data-flow="pe"] { --delay: 6s; }
[data-tag="rating"], [data-field="rating"], [data-flow="rating"] { --delay: 8.6s; }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .form, .top, .foot { animation: enter 320ms var(--ease-out) both; }
  .form { animation-delay: 40ms; }
  .mockFrame { animation: enter 300ms var(--ease-out) 60ms both; }
  .part { animation: enterPart 260ms var(--ease-out) both; animation-delay: calc(140ms + var(--i, 0) * 50ms); }
  .part-1 { --i: 1; } .part-2 { --i: 2; } .part-3 { --i: 3; }
  .code { animation: fadeIn 280ms var(--ease-out) 100ms both; }
  .tag { animation: fadeIn 260ms var(--ease-out) 380ms both; }
  .flows { animation: fadeIn 260ms var(--ease-out) 420ms both; }

  .codeScroll { animation: scroll 84s linear infinite; will-change: transform; }
  .codeColumn:nth-child(2) .codeScroll { animation-duration: 104s; animation-delay: -40s; }

  .tag::after { animation: tagLit var(--cycle) var(--ease-in-out) var(--delay) infinite both; }
  .flowBase { animation: baseLit var(--cycle) var(--ease-in-out) var(--delay) infinite both; }
  .flowPulse { animation: pulse var(--cycle) var(--ease-in-out) var(--delay) infinite both; }
  .flowEnd { animation: endLit var(--cycle) var(--ease-in-out) var(--delay) infinite both; }
  .field-lit::after { animation: fieldLit var(--cycle) var(--ease-in-out) var(--delay) infinite both; }

  .showcase[data-motion="paused"] .codeScroll,
  .showcase[data-motion="paused"] .tag::after,
  .showcase[data-motion="paused"] .flows *,
  .showcase[data-motion="paused"] .field-lit::after { animation-play-state: paused; }
}

@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
@keyframes enterPart { from { opacity: 0; transform: translateY(4px); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes scroll { to { transform: translate3d(0, -50%, 0); } }
@keyframes tagLit { 0% { opacity: 0; } 3%, 22% { opacity: 1; } 29%, 100% { opacity: 0; } }
@keyframes baseLit { 0% { opacity: 0.35; } 3%, 22% { opacity: 0.9; } 29%, 100% { opacity: 0.35; } }
@keyframes pulse {
  0% { stroke-dashoffset: 14; opacity: 0; }
  1% { stroke-dashoffset: 14; opacity: 1; }
  13% { stroke-dashoffset: -100; opacity: 1; }
  14%, 100% { stroke-dashoffset: -100; opacity: 0; }
}
@keyframes endLit {
  0%, 11.5% { opacity: 0; transform: scale(0.6); }
  14.5%, 22% { opacity: 1; transform: scale(1); }
  29%, 100% { opacity: 0; transform: scale(1); }
}
@keyframes fieldLit { 0%, 11.5% { opacity: 0; } 15%, 23% { opacity: 1; } 30%, 100% { opacity: 0; } }

@container (max-width: 520px) {
  .mockSearch, .tag .q { display: none; }
  .tabs span:nth-child(n + 5) { display: none; }
}
@container (max-width: 440px) {
  .ratingCounts, .watch, .mockCrumb, .cardMeta { display: none; }
  .code { grid-template-columns: 1fr; }
  .codeColumn:nth-child(2) { display: none; }
}
@media (max-height: 760px) { .stage { --band: 56px; } .ratingCounts { display: none; } }
