/* AI Flow auth pages — purple light accent */
html.af-auth {
  --af-purple: #7c3aed;
  --af-purple-soft: rgba(124, 58, 237, 0.12);
  --af-purple-mid: rgba(124, 58, 237, 0.22);
  --af-ink: #0f172a;
  --af-muted: #64748b;
}

html.af-auth body {
  min-height: 100vh;
}

html.af-auth .relative.grid.h-svh {
  position: relative;
  min-height: 100svh;
  display: grid !important;
  grid-template-columns: 1fr;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(124, 58, 237, 0.18), transparent 55%),
    radial-gradient(900px 500px at 95% 10%, rgba(37, 99, 235, 0.12), transparent 50%),
    radial-gradient(700px 420px at 70% 100%, rgba(124, 58, 237, 0.10), transparent 55%),
    linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

html.dark.af-auth .relative.grid.h-svh,
html.af-auth.dark .relative.grid.h-svh {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(124, 58, 237, 0.28), transparent 55%),
    radial-gradient(900px 500px at 95% 10%, rgba(37, 99, 235, 0.16), transparent 50%),
    linear-gradient(180deg, #0b1220 0%, #111827 100%);
}

html.af-auth .af-auth-panel {
  display: none;
}

@media (min-width: 960px) {
  html.af-auth .relative.grid.h-svh {
    grid-template-columns: minmax(280px, 0.95fr) minmax(420px, 1.05fr);
    align-items: stretch;
  }

  html.af-auth .af-auth-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.75rem 2.5rem;
    color: #fff;
    background:
      linear-gradient(155deg, rgba(124, 58, 237, 0.96) 0%, rgba(79, 70, 229, 0.92) 48%, rgba(37, 99, 235, 0.88) 100%);
    position: relative;
    overflow: hidden;
  }

  html.af-auth .af-auth-panel::before {
    content: "";
    position: absolute;
    inset: auto -20% -30% auto;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.22), transparent 65%);
    pointer-events: none;
  }

  html.af-auth .af-auth-panel::after {
    content: "";
    position: absolute;
    top: -80px;
    left: -60px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.16), transparent 70%);
    pointer-events: none;
  }

  html.af-auth .af-auth-panel .af-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  html.af-auth .af-auth-panel .af-brand img {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,0.18);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  }

  html.af-auth .af-auth-panel .af-brand span {
    font-size: 1.125rem;
    font-weight: 650;
    letter-spacing: -0.02em;
  }

  html.af-auth .af-auth-panel .af-copy {
    position: relative;
    z-index: 1;
    max-width: 26rem;
  }

  html.af-auth .af-auth-panel .af-eyebrow {
    margin: 0 0 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.82;
  }

  html.af-auth .af-auth-panel h2 {
    margin: 0 0 0.85rem;
    font-size: clamp(1.6rem, 2.2vw, 2.05rem);
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.03em;
  }

  html.af-auth .af-auth-panel p {
    margin: 0;
    font-size: 0.975rem;
    line-height: 1.65;
    opacity: 0.9;
  }

  html.af-auth .af-auth-panel .af-chips {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
  }

  html.af-auth .af-auth-panel .af-chips span {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.22);
  }

  html.af-auth .af-auth-panel .af-foot {
    position: relative;
    z-index: 1;
    font-size: 0.8rem;
    opacity: 0.78;
  }

  /* hide duplicate top-left logo on desktop split layout */
  html.af-auth .relative.grid.h-svh > a.absolute {
    display: none !important;
  }

  html.af-auth .relative.grid.h-svh > .container {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: none !important;
    padding: 2.5rem 2rem !important;
    margin: 0 !important;
  }
}

html.af-auth .relative.grid.h-svh > .container > div {
  width: 100%;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
  padding: 1.75rem 1.5rem !important;
  border-radius: 1.1rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.86);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 18px 48px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(10px);
}

html.dark.af-auth .relative.grid.h-svh > .container > div,
html.af-auth.dark .relative.grid.h-svh > .container > div {
  background: rgba(17, 24, 39, 0.78);
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

@media (min-width: 640px) {
  html.af-auth .relative.grid.h-svh > .container > div {
    padding: 2rem 2rem !important;
  }
}

html.af-auth .relative.grid.h-svh > a.absolute {
  top: 1.1rem !important;
  left: 1.1rem !important;
  padding: 0.35rem 0.6rem 0.35rem 0.35rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(148, 163, 184, 0.25);
  backdrop-filter: blur(8px);
}

html.dark.af-auth .relative.grid.h-svh > a.absolute,
html.af-auth.dark .relative.grid.h-svh > a.absolute {
  background: rgba(17, 24, 39, 0.7);
}

html.af-auth .relative.grid.h-svh > a.absolute img {
  border-radius: 10px !important;
}

html.af-auth h2 {
  letter-spacing: -0.02em;
}

html.af-auth button[type="submit"] {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%) !important;
  border-color: transparent !important;
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.28);
}

html.af-auth button[type="submit"]:hover {
  filter: brightness(1.05);
}

html.af-auth input:focus-visible,
html.af-auth input:focus {
  border-color: rgba(124, 58, 237, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15) !important;
}

html.af-auth a[href="/sign-up"],
html.af-auth a[href="/sign-in"] {
  color: var(--af-purple);
}

html.af-auth .af-auth-panel a.af-brand {
  color: inherit;
  text-decoration: none;
}
html.af-auth .af-auth-panel a.af-brand:hover {
  opacity: 0.92;
}
html.af-auth .af-auth-panel .af-foot {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
html.af-auth .af-auth-panel a.af-home {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  color: #fff;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
}
html.af-auth .af-auth-panel a.af-home:hover {
  background: rgba(255,255,255,0.22);
  text-decoration: none;
}

/* mobile: keep top logo as home, make it clearer */
@media (max-width: 959px) {
  html.af-auth .relative.grid.h-svh > a.absolute::after {
    content: "主页";
    margin-left: 0.15rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: inherit;
  }
}