/*
 * Sign-in page layout and brand panel (Clientlo palette). Loaded after app.css
 * and scoped to .si-shell so no other page changes. Fonts are self-hosted
 * (fonts.css); nothing here contacts a third-party host.
 */
.si-shell {
  --si-ink: #0b1b33;
  --si-mute: #475569;
  --si-blue: #2563eb;
  --si-blue-hover: #1d4ed8;
  --si-soft: #eaf0ff;
  font-family: Manrope, Inter, system-ui, sans-serif;
  color: var(--si-ink);
  display: grid;
  grid-template-columns: 40% 60%;
  min-height: 100vh;
  min-height: 100dvh;
}
body:has(.si-shell) {
  background: #fff;
}

/* Left: form */
.si-shell main.si-form {
  max-width: none;
  margin: 0;
  padding: 48px 32px;
  background: #fff;
  align-content: center;
  justify-items: center;
  gap: 18px;
}
.si-form > * {
  width: 100%;
  max-width: 380px;
}
.si-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.si-logo img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}
.si-logo .wordmark {
  font-size: 22px;
}
.si-shell .card {
  background: none;
  border: 0;
  padding: 0;
  border-radius: 0;
  gap: 18px;
}
.si-shell h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 6px;
}
.si-shell .sub {
  font-size: 14.5px;
  color: var(--si-mute);
}
.si-shell .fine {
  color: var(--si-mute);
  font-size: 13px;
}
.si-shell label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--si-ink);
  margin-bottom: 6px;
}
.si-shell input[type='email'],
.si-shell input[type='password'],
.si-shell input[type='text'] {
  font-family: inherit;
  font-size: 15px;
  padding: 11px 13px;
  border: 1px solid #94a3b8;
  border-radius: 10px;
  color: var(--si-ink);
}
.si-shell input.code {
  font-family: var(--mono);
}
.si-shell input:focus-visible {
  border-color: var(--si-blue);
  box-shadow: 0 0 0 3px #bfd3ff;
  outline: 2px solid transparent;
}
.si-shell .btn {
  position: relative;
  background: var(--si-blue);
  border-color: var(--si-blue);
  color: #fff;
  border-radius: 10px;
  padding: 12px 18px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  transition: background-color 0.15s;
}
.si-shell .btn:hover:not(:disabled) {
  background: var(--si-blue-hover);
  border-color: var(--si-blue-hover);
}
.si-shell .btn.secondary {
  background: #fff;
  color: var(--si-ink);
  border-color: #94a3b8;
}
.si-shell .btn.secondary:hover:not(:disabled) {
  background: var(--si-soft);
  border-color: var(--si-blue);
}
.si-shell .btn:disabled {
  background: #e2e8f0;
  border-color: #e2e8f0;
  color: #475569;
}
.si-shell .btn:focus-visible,
.si-shell .link:focus-visible,
.si-dot:focus-visible {
  outline: 2px solid var(--si-blue);
  outline-offset: 3px;
}
.si-shell .btn.is-loading {
  color: transparent;
}
.si-shell .btn.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: si-spin 0.7s linear infinite;
}
.si-shell .link {
  color: var(--si-blue);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 4px;
}
.si-shell .link:hover {
  color: var(--si-blue-hover);
  text-decoration: underline;
}
.si-shell .error {
  background: #fde8ea;
  color: #c22636;
  border: 1px solid #f6c4c9;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 14px;
}
.si-shell .error::before {
  content: '! ';
  font-weight: 800;
}
.si-shell .notice {
  border-radius: 10px;
}

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

.si-welcome {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--si-soft);
}
.si-hello {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.si-welcome .link {
  justify-self: start;
  font-size: 13.5px;
}

/* Right: brand panel */
.si-brand {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(60% 55% at 78% 8%, rgba(96, 165, 250, 0.28), transparent 70%),
    radial-gradient(45% 45% at 10% 100%, rgba(37, 99, 235, 0.22), transparent 70%),
    radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1.5px) 0 0 / 28px 28px,
    #0b1b33;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 64px;
}
.si-brand-top .wordmark {
  font-size: 26px;
  color: #fff;
}
.si-tagline {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  font-weight: 600;
}
.si-band-mark {
  display: none;
}
.si-showcase {
  width: 100%;
  max-width: 600px;
  margin-block: auto;
}
.si-scenes {
  min-height: 460px;
}
.si-scene[data-active] {
  animation: si-in 0.5s ease both;
}
.si-scene h2 {
  margin: 28px 0 10px;
  font-size: 34px;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.si-scene > p {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.8);
  max-width: 44ch;
}

/* Scene 1: three floating chat cards in CSS 3D */
.si-stage {
  position: relative;
  height: 300px;
  perspective: 1100px;
}
.si-deck {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(10deg) rotateY(-16deg);
  animation: si-sway 12s ease-in-out infinite alternate;
}
.si-card {
  --d: 0s;
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff;
  color: #0b1b33;
  box-shadow:
    0 24px 48px -12px rgba(2, 8, 23, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.5);
  font-size: 15px;
  opacity: 0;
  animation: si-card-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) var(--d) forwards;
}
.si-card p {
  margin: 2px 0 0;
  line-height: 1.35;
}
.si-card b {
  font-size: 13px;
  color: #475569;
}
.si-card.c1 {
  --x: 0px;
  --y: 8px;
  --z: 30px;
  left: 0;
  top: 0;
  width: 310px;
}
.si-card.c2 {
  --x: 0px;
  --y: 0px;
  --z: 90px;
  --d: 1.1s;
  left: 150px;
  top: 112px;
  gap: 8px;
  flex-wrap: wrap;
}
.si-card.c3 {
  --x: 0px;
  --y: 0px;
  --z: 60px;
  --d: 2.4s;
  left: 250px;
  top: 196px;
  width: 310px;
  flex-direction: column;
  align-items: flex-start;
  background: #2563eb;
  color: #fff;
}
.si-card.c3 p {
  margin: 0;
  font-weight: 600;
}
.av {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #eaf0ff;
  color: #1d4ed8;
  font-weight: 800;
}
.chip {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.chip.own {
  background: #eaf0ff;
  color: #1d4ed8;
}
.chip.clock {
  background: #fde8ea;
  color: #c22636;
}
.chip.done {
  background: #dcfce7;
  color: #166534;
}
@property --m {
  syntax: '<integer>';
  initial-value: 40;
  inherits: false;
}
.count {
  font-style: normal;
  --m: 40;
  counter-reset: m var(--m);
  animation: si-count 6s linear 1.2s forwards;
}
.count::before {
  content: counter(m);
}
@keyframes si-count {
  from {
    --m: 40;
  }
  to {
    --m: 12;
  }
}
@keyframes si-card-in {
  from {
    opacity: 0;
    transform: translate3d(0, 28px, calc(var(--z) - 80px));
  }
  to {
    opacity: 1;
    transform: translate3d(var(--x), var(--y), var(--z));
  }
}
@keyframes si-sway {
  from {
    transform: rotateX(10deg) rotateY(-16deg) translateY(0);
  }
  to {
    transform: rotateX(4deg) rotateY(12deg) translateY(-10px);
  }
}

/* Scene 2: phone, flowing messages, three people */
.si-flow {
  display: block;
  width: 100%;
  height: auto;
  max-height: 300px;
}
.si-dash {
  animation: si-dash 1s linear infinite;
}
.si-bub {
  offset-rotate: 0deg;
  offset-distance: 0%;
  opacity: 0;
  animation: si-travel 3.2s ease-in-out var(--d) infinite;
}
@keyframes si-dash {
  to {
    stroke-dashoffset: -22;
  }
}
@keyframes si-travel {
  0% {
    offset-distance: 0%;
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  88% {
    opacity: 1;
  }
  100% {
    offset-distance: 100%;
    opacity: 0;
  }
}

/* Per-bubble path and delay (kept out of inline style attributes: the CSP forbids them) */
.si-bub.p1 {
  offset-path: path('M126 140C230 140 270 67 380 67');
}
.si-bub.p1.m0 {
  --d: 0s;
}
.si-bub.p1.m1 {
  --d: 1.6s;
}
.si-bub.p2 {
  offset-path: path('M126 140C230 140 270 152 380 152');
}
.si-bub.p2.m0 {
  --d: 0.5s;
}
.si-bub.p2.m1 {
  --d: 2.1s;
}
.si-bub.p3 {
  offset-path: path('M126 140C230 140 270 237 380 237');
}
.si-bub.p3.m0 {
  --d: 1s;
}
.si-bub.p3.m1 {
  --d: 2.6s;
}
body:not([data-step='s-password']) .si-welcome {
  display: none;
}

/* Scene 3: the five built features, one at a time */
.si-feats {
  display: grid;
  min-height: 340px;
  align-content: center;
}
.si-feat {
  display: none;
  align-items: flex-start;
  gap: 22px;
}
.si-feat[data-active] {
  display: flex;
  animation: si-in 0.45s ease both;
}
.si-feat h3 {
  margin: 4px 0 10px;
  font-size: 34px;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.si-feat p {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.8);
  max-width: 44ch;
}
.si-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(96, 165, 250, 0.16);
  border: 1px solid rgba(96, 165, 250, 0.35);
}
.si-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: #60a5fa;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.si-dots {
  display: flex;
  gap: 2px;
  margin-top: 8px;
}
.si-dot {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.si-dot::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transition:
    width 0.25s,
    background-color 0.25s;
}
.si-dot[aria-current='true']::before {
  width: 24px;
  border-radius: 4px;
  background: #60a5fa;
}
.si-brand .si-dot:focus-visible {
  outline-color: #fff;
}

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

/* Hidden tab: the script sets data-halt and every animation stops. */
.si-showcase[data-halt] *,
.si-showcase[data-halt] {
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
  .si-showcase *,
  .si-shell .btn.is-loading::after {
    animation: none !important;
  }
  .si-shell .btn.is-loading::after {
    border-top-color: rgba(255, 255, 255, 0.45);
  }
  .si-dot::before {
    transition: none;
  }
  .si-deck {
    transform: rotateX(8deg) rotateY(-10deg);
  }
  .si-card {
    opacity: 1;
    transform: translate3d(var(--x), var(--y), var(--z));
  }
  .count::before {
    content: '40';
  }
  /* Without rotation, show every feature at once. */
  .si-feats {
    min-height: 0;
    gap: 18px;
  }
  .si-feat {
    display: flex;
  }
  .si-feat h3 {
    font-size: 20px;
    margin-bottom: 4px;
  }
  .si-feat p {
    font-size: 15px;
  }
  .si-feat .si-icon {
    width: 44px;
    height: 44px;
  }
}

/* Phones: navy band on top, form below */
@media (max-width: 767px) {
  .si-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .si-brand {
    order: -1;
    padding: 20px 16px;
    justify-content: flex-start;
  }
  .si-brand-top {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 12px;
  }
  .si-band-mark {
    display: block;
    grid-row: span 2;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28);
  }
  .si-brand-top .wordmark {
    font-size: 22px;
  }
  .si-tagline {
    margin: 0;
    font-size: 14px;
  }
  .si-showcase,
  .si-logo {
    display: none;
  }
  .si-shell main.si-form {
    padding: 28px 16px 40px;
    align-content: start;
  }
}
