/* Tokens: always light. */
:root {
  color-scheme: light;
  --bg: #eef2f7;
  --sheet: #ffffff;
  --ink: #1e3a5f;
  --text: #0f172a;
  --mute: #64748b;
  --line: #e2e8f0;
  --accent: #2563eb;
  --gold: #e2ab1e;
  --error: #b91c1c;
  --error-bg: #fef2f2;
}

/* Base. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 24px;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

/* Logo: centered intro, then docked top-left. */
.hub-logo {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(78vw, 420px);
  transform: translate(-50%, -50%);
  margin: 0;
  z-index: 2;
  animation: hub-dock .8s cubic-bezier(.65, 0, .35, 1) 5.2s both;
}

.hub-logo svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
  color: var(--ink);
}

@keyframes hub-dock {
  to {
    top: 24px;
    left: 24px;
    width: 150px;
    transform: translate(0, 0);
  }
}

@media (max-width: 600px) {
  @keyframes hub-dock {
    to {
      top: 16px;
      left: 16px;
      width: 120px;
      transform: translate(0, 0);
    }
  }
}

/* Background mark. */
.hub-bgmark {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(94vw, 86vh);
  height: auto;
  transform: translate(-50%, -50%);
  z-index: 0;
  pointer-events: none;
  animation: hub-bgin 1.2s ease-out 5.7s both;
}

.hub-bgmark .t,
.hub-bgmark .b {
  transform-box: fill-box;
  transform-origin: center;
}

.hub-bgmark .t {
  fill: var(--ink);
  fill-opacity: .06;
  animation: hub-breathe-t 7s ease-in-out 6.9s infinite;
}

.hub-bgmark .b {
  fill: var(--gold);
  fill-opacity: .2;
  animation: hub-breathe-b 7s ease-in-out 6.9s infinite;
}

@keyframes hub-bgin {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes hub-breathe-t {
  0%, 100% { transform: none; }
  50% { transform: translateY(-1.6px); }
}

@keyframes hub-breathe-b {
  0%, 100% { transform: none; }
  50% { transform: translateY(1.6px); }
}

/* Sheet form. */
main.hub {
  position: relative;
  z-index: 1;
  align-self: center;
  justify-self: center;
  width: 100%;
  max-width: 400px;
}

.hub-form {
  display: grid;
  gap: 18px;
  background: var(--sheet);
  border: 1px solid #e3e8ef;
  border-radius: 4px;
  padding: 40px 36px 34px;
  box-shadow: 0 30px 60px -30px rgba(15, 23, 42, .35),
    0 2px 6px rgba(15, 23, 42, .05);
}

/* Removed by the script after playback to avoid replaying the intro delay. */
.hub-form.hub-intro {
  animation: hub-rise .6s ease-out 5.7s both;
}

.hub-choose {
  animation: hub-rise .35s ease-out both;
}

.hub-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.02em;
  margin: 0 0 6px;
  color: var(--ink);
}

.hub-form label {
  font-size: 13px;
  font-weight: 500;
  color: var(--mute);
  display: block;
  margin-bottom: 6px;
}

.hub-form input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: #fff;
  border: 1px solid #d5dce6;
  border-radius: 4px;
  outline: none;
  transition: border-color .15s;
}

.hub-form input:focus {
  border-color: var(--ink);
}

.hub-form button {
  width: 100%;
  height: 46px;
  margin-top: 8px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--ink);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  transition: background .15s, transform .15s;
}

.hub-form button:hover {
  background: #17304f;
}

.hub-form button:active {
  transform: translateY(1px);
}

.hub-form button:disabled {
  opacity: .6;
  cursor: default;
  transform: none;
}

.hub-form button:focus-visible,
.hub-forgot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Business chooser: shares the sheet styling. */
.hub-choose-hint {
  margin: -8px 0 2px;
  font-size: 14px;
  color: var(--mute);
}

.hub-tiles {
  display: grid;
  gap: 10px;
}

.hub-form .hub-link.hub-manage {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
}

.hub-form .hub-link.hub-manage:hover {
  text-decoration: underline;
}

.hub-form .hub-tile {
  width: 100%;
  height: auto;
  margin: 0;
  display: grid;
  gap: 3px;
  text-align: left;
  padding: 14px 16px;
  background: #fff;
  color: var(--text);
  border: 1px solid #d5dce6;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 400;
  transition: border-color .15s, box-shadow .15s;
}

.hub-form .hub-tile:hover {
  background: #fff;
  border-color: var(--ink);
  box-shadow: inset 3px 0 0 var(--gold);
}

.hub-tile-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.hub-tile-desc {
  font-size: 13px;
  color: var(--mute);
}

.hub-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--mute);
  margin-top: 2px;
}

.hub-remember input {
  width: auto;
  height: auto;
  accent-color: var(--ink);
}

.hub-form .hub-link {
  width: auto;
  height: auto;
  margin: 0;
  justify-self: center;
  padding: 4px 2px;
  background: transparent;
  color: var(--mute);
  font-size: 13px;
  font-weight: 500;
  border: 0;
  border-radius: 0;
}

.hub-form .hub-link:hover {
  background: transparent;
  color: var(--ink);
  text-decoration: underline;
}

.hub-error {
  margin: 0;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--error);
  background: var(--error-bg);
  border-radius: 8px;
}

.hub-forgot {
  justify-self: center;
  font-size: 13px;
  color: var(--mute);
  text-decoration: none;
  margin-top: 2px;
}

.hub-forgot:hover {
  color: var(--accent);
  text-decoration: underline;
}

@keyframes hub-rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Footer. */
footer.hub-foot {
  position: fixed;
  left: 24px;
  bottom: 18px;
  margin: 0;
  font-size: 12px;
  color: var(--mute);
  z-index: 1;
}

/* Approved logo animation: verbatim. */
.hub-logo .top,.hub-logo .base,.hub-logo .glyph{transform-box:fill-box;transform-origin:center}
.hub-logo .top,.hub-logo .base,.hub-logo .glyph{fill-opacity:0;stroke:currentColor;stroke-linejoin:round;stroke-linecap:round;stroke-dasharray:100;stroke-dashoffset:100}
.hub-logo .top{stroke-width:1.6;animation:hub-draw 1.4s ease-in-out .3s both,hub-fill .7s ease-out 1.7s both}
.hub-logo .base{stroke:#e2ab1e;stroke-width:1.6;animation:hub-draw 1.1s ease-in-out .7s both,hub-fill .7s ease-out 1.9s both}
.hub-logo .glyph{stroke-width:.9;transform:translateX(var(--dx));animation:hub-move .9s cubic-bezier(.2,.8,.2,1) both,hub-draw .9s ease-in-out both,hub-fill .5s ease-out both}
.hub-logo .glyph:nth-child(1){animation-delay:1.70s,1.70s,2.55s}
.hub-logo .glyph:nth-child(2){animation-delay:2.00s,2.00s,2.85s}
.hub-logo .glyph:nth-child(3){animation-delay:2.30s,2.30s,3.15s}
.hub-logo .glyph:nth-child(4){animation-delay:2.60s,2.60s,3.45s}
.hub-logo .glyph:nth-child(5){animation-delay:2.90s,2.90s,3.75s}
.hub-logo .glyph:nth-child(6){animation-delay:3.20s,3.20s,4.05s}
.hub-logo .glyph:nth-child(7){animation-delay:3.50s,3.50s,4.35s}
@keyframes hub-move{from{transform:translateX(var(--dx))}to{transform:none}}
@keyframes hub-draw{to{stroke-dashoffset:0}}
@keyframes hub-fill{from{fill-opacity:0;stroke-opacity:1}to{fill-opacity:1;stroke-opacity:0}}

/* Return visits: shortened intro. */
.hub-seen .hub-logo {
  top: 24px;
  left: 24px;
  width: 150px;
  transform: none;
  animation: hub-fadein .5s ease-out both;
}

.hub-seen .hub-logo .top,
.hub-seen .hub-logo .base,
.hub-seen .hub-logo .glyph {
  animation: none;
  fill-opacity: 1;
  stroke: none;
  transform: none;
}

.hub-seen .hub-form.hub-intro {
  animation-delay: .25s;
}

.hub-seen .hub-bgmark {
  animation-delay: .1s;
  animation-duration: .8s;
}

.hub-seen .hub-bgmark .t,
.hub-seen .hub-bgmark .b {
  animation-delay: 1s;
}

@keyframes hub-fadein {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Reduced motion: fully drawn, docked, visible, and still. */
@media (prefers-reduced-motion: reduce) {
  .hub-logo,
  .hub-seen .hub-logo {
    animation: none;
    top: 24px;
    left: 24px;
    width: 150px;
    transform: none;
  }

  .hub-logo .top,
  .hub-logo .base,
  .hub-logo .glyph,
  .hub-seen .hub-logo .top,
  .hub-seen .hub-logo .base,
  .hub-seen .hub-logo .glyph {
    animation: none;
    fill-opacity: 1;
    stroke: none;
    transform: none;
  }

  .hub-form,
  .hub-form.hub-intro,
  .hub-seen .hub-form.hub-intro,
  .hub-choose {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .hub-bgmark,
  .hub-seen .hub-bgmark {
    animation: none;
    opacity: 1;
  }

  .hub-bgmark .t,
  .hub-bgmark .b,
  .hub-seen .hub-bgmark .t,
  .hub-seen .hub-bgmark .b {
    animation: none;
    transform: none;
  }
}