/* Only the FLOW logo and constellation mesh are branded. UI inherits app tokens. */
.app .welcome {
  background: var(--bg-panel);
}

.welcome .welcome-bg {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  background: var(--bg-panel);
}

.welcome .welcome-hero {
  gap: 0;
  padding: 64px 24px 48px;
}

/* Frost the constellation while keeping the foreground content legible. */
.welcome .welcome-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 390px);
  padding: 48px 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 42%),
    color-mix(in srgb, var(--bg-panel-2) 38%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 40%, rgba(255, 255, 255, 0.14));
  border-radius: 16px;
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.7);
  backdrop-filter: blur(18px) saturate(1.7);
}

.welcome .recents {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 42%),
    color-mix(in srgb, var(--bg-panel-2) 38%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.7);
  backdrop-filter: blur(18px) saturate(1.7);
}

.welcome .recents::after {
  background: linear-gradient(
    to left,
    color-mix(in srgb, var(--bg-panel-2) 60%, transparent),
    transparent
  );
}

@media (prefers-reduced-transparency: reduce) {
  .welcome .welcome-intro,
  .welcome .recents {
    background: var(--bg-panel-2);
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .welcome .recents::after {
    background: linear-gradient(to left, var(--bg-panel-2), transparent);
  }
}

.welcome .welcome-logo {
  /* Logo and grid remain the only website-branded elements. */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: clamp(28px, 3.5vw, 38px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.welcome-logo img {
  display: block;
  width: clamp(120px, 17vw, 174px);
  height: auto;
}

@media (max-width: 480px) {
  .welcome .actions {
    width: min(100%, 280px);
  }
}

/* The account sign-in. The card mirrors the website's login
   (flow-astro global.css .account-auth-*) in its dark theme: near-black canvas
   with a dot grid, raised dark card, mono uppercase labels and a lime keycap
   submit. The app is dark, so the intro stays dark whatever the OS theme says.
   The sign-in keeps the system face. Only the chat intro loads Haffer
   (public/haffer.woff2, declared in agentChat.css). */

.client-auth-panel {
  --client-ink: #f4f4f1;
  --client-gray: #a3a39d;
  --client-line: rgba(255, 255, 255, 0.14);
  --client-accent: #bafe50;
  --client-black: #0a0a0a;
  --client-raised: rgba(20, 20, 20, 0.72);
  --client-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, monospace;
  width: 100%;
  display: flex;
  flex-direction: column;
  margin-top: 24px;
  color: var(--client-ink);
}

.client-signed-in {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.client-rail-empty {
  margin: 0 0 10px 31px;
  color: var(--text-dim);
  font-size: 12px;
}

/* Domains read from the start; local file paths keep their separate tail-first truncation. */
.recent-path.recent-domain {
  direction: ltr;
}

/* The rail mounts after sign-in and rises from the bottom edge. */
.welcome .recents--rise {
  animation: client-rail-rise 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes client-rail-rise {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .welcome .recents--rise {
    animation: none;
  }
}

.client-welcome-status {
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.45;
}

.client-welcome-status {
  text-align: center;
}

.client-auth-panel .client-welcome-status {
  margin-top: 12px;
}

.client-auth-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--client-line);
  border-radius: 16px;
  background: var(--client-raised);
  color: var(--client-ink);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.client-auth-google:hover:not(:disabled) {
  transform: translateY(-1px);
}

.client-auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0 22px;
  color: var(--client-gray);
  font-family: var(--client-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.client-auth-divider::before,
.client-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--client-line);
}

/* Uppercase mono turns the Spanish "o" into a zero. */
.client-auth-divider span {
  font-family: inherit;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.client-auth-form {
  display: grid;
  gap: 15px;
  margin: 0;
}

.client-auth-field {
  display: grid;
  gap: 7px;
}

.client-auth-field > span:first-child {
  font-family: var(--client-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--client-gray);
}

.client-auth-control {
  position: relative;
  display: block;
}

.client-auth-icon {
  position: absolute;
  inset-block: 0;
  left: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  color: var(--client-ink);
  pointer-events: none;
}

.client-auth-icon::before {
  content: '';
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: color-mix(in srgb, #fff 8%, transparent);
}

.client-auth-control:focus-within .client-auth-icon::before {
  background: color-mix(in srgb, #fff 14%, transparent);
}

.client-auth-icon::after {
  content: '';
  position: absolute;
  top: 12px;
  right: 0;
  bottom: 12px;
  width: 1px;
  background: var(--client-line);
}

.client-auth-icon svg {
  position: relative;
  z-index: 1;
}

.client-auth-control:has([aria-invalid='true']) .client-auth-icon {
  color: #ff6b6b;
}

.client-auth-control input {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  padding: 14px 16px 14px 58px;
  border: 1px solid var(--client-line);
  border-radius: 16px;
  background: var(--client-raised);
  color: var(--client-ink);
  font: inherit;
  font-size: 16px;
}

.client-auth-control input:hover {
  border-color: rgba(255, 255, 255, 0.28);
}

.client-auth-control input:focus {
  outline: none;
  border-color: var(--client-accent);
}

.client-auth-submit {
  width: 100%;
  min-height: 52px;
  margin-top: 6px;
  border: 2px solid var(--client-accent);
  border-radius: 16px;
  background: var(--client-accent);
  color: var(--client-black);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow:
    0 3px 0 rgba(186, 254, 80, 0.45),
    0 6px 14px -6px rgba(0, 0, 0, 0.6);
  transition:
    transform 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease;
}

.client-auth-submit:hover:not(:disabled),
.client-auth-submit:focus-visible {
  background: #cdff7d;
  box-shadow:
    0 4px 0 rgba(186, 254, 80, 0.45),
    0 9px 18px -6px rgba(0, 0, 0, 0.6);
}

.client-auth-submit:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 0 0 rgba(186, 254, 80, 0.45);
}

.client-auth-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--client-line);
}

button.client-auth-link,
button.client-auth-link:hover:not(:disabled) {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--client-ink);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}

button.client-auth-link:hover:not(:disabled) {
  color: var(--client-accent);
}

.client-auth-panel button:disabled {
  opacity: 0.55;
  cursor: default;
}

.client-auth-panel button:focus-visible {
  outline: 2px solid var(--client-ink);
  outline-offset: 2px;
}

.client-welcome-error {
  margin: 0;
  color: #ff6b6b;
  font-size: 14px;
  line-height: 1.45;
}

/* Keep the action the same size as its neighbouring project cards, with one compact label. */
.local-project-card {
  flex: 0 0 190px;
  width: 190px;
}

button.local-project-add {
  display: block;
  width: 100%;
  background: transparent;
  text-align: left;
  color: var(--text);
  font: inherit;
}

.local-project-add .recent-thumb {
  border-style: dashed;
}

.local-project-add .recent-name {
  display: block;
}

.local-project-add:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.local-project-card > .client-welcome-error {
  padding: 4px 6px;
  font-size: 12px;
}

.welcome .actions.local-project-options {
  align-items: stretch;
  width: 100%;
  gap: 8px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--client-line, rgba(255, 255, 255, 0.14));
}

.welcome .actions.local-project-options button {
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-weight: 500;
  transition:
    background 160ms ease-out,
    border-color 160ms ease-out;
}

.welcome .actions.local-project-options button:hover:not(:disabled) {
  border-color: rgba(186, 254, 80, 0.55);
  background: rgba(186, 254, 80, 0.08);
  color: var(--text);
}

.welcome .actions.local-project-options button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* The static front door supplies only the desktop app's layout foundations and page sizing.
   welcomeBrand.css and clientWelcome.css remain the source for its branded card and controls. */
:root {
  color-scheme: dark;
  --bg-panel: #111111;
  --bg-panel-2: #1a1a1a;
  --border: rgb(255 255 255 / 8%);
  --text: #f5f5f5;
  --text-dim: #999999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg-panel);
  color: var(--text);
}
[hidden] {
  display: none !important;
}
.welcome {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  overflow: clip;
}
.welcome > .welcome-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.welcome .welcome-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  padding: 40px 24px;
}
.welcome .welcome-intro {
  flex-shrink: 0;
}
.client-auth-icon svg {
  width: 18px;
  height: 18px;
}
.client-auth-panel a.client-auth-link {
  color: var(--client-ink);
  font-size: 14px;
  text-decoration: none;
}
.client-auth-panel a.client-auth-link:hover {
  color: var(--client-accent);
}
.client-auth-panel a:focus-visible,
.client-auth-panel summary:focus-visible {
  outline: 2px solid var(--client-accent);
  outline-offset: 4px;
  border-radius: 4px;
}
.client-auth-panel #status:empty {
  display: none;
}
.client-auth-panel #status {
  margin-top: 16px;
}
.client-auth-panel #dev {
  margin-top: 20px;
  padding: 10px;
  color: var(--client-gray);
  background: var(--client-raised);
  border: 1px solid var(--client-line);
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}
@media (max-width: 480px) {
  .welcome .welcome-hero {
    padding: 20px 16px;
  }
  .welcome .welcome-intro {
    padding: 32px 24px;
  }
}
