/* AI Flow — quiet premium auth shell (sign-in / sign-up / register / forgot).
 * Polishes New API AuthLayout only. No split-panel. No SoftGrid story dump.
 * Scope: html.af-auth-shell + .relative.grid.h-svh.max-w-none
 */

html.af-auth-shell .relative.grid.h-svh.max-w-none,
.relative.grid.h-svh.max-w-none {
  --af-blue: #2563eb;
  --af-purple: #7c3aed;
  --af-violet: #8b5cf6;
  --af-ink: #0f172a;
  --af-muted: #64748b;
  --af-line: rgba(148, 163, 184, 0.28);
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(980px 520px at 12% -8%, rgba(124, 58, 237, 0.14), transparent 58%),
    radial-gradient(820px 460px at 92% 8%, rgba(37, 99, 235, 0.10), transparent 52%),
    radial-gradient(640px 380px at 70% 100%, rgba(139, 92, 246, 0.08), transparent 55%),
    linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
}

html.dark.af-auth-shell .relative.grid.h-svh.max-w-none,
html.af-auth-shell.dark .relative.grid.h-svh.max-w-none,
html.dark .relative.grid.h-svh.max-w-none,
.dark .relative.grid.h-svh.max-w-none {
  background:
    radial-gradient(980px 520px at 12% -8%, rgba(124, 58, 237, 0.22), transparent 58%),
    radial-gradient(820px 460px at 92% 8%, rgba(37, 99, 235, 0.14), transparent 52%),
    linear-gradient(180deg, #0b1220 0%, #111827 100%) !important;
}

html.af-auth-shell .relative.grid.h-svh.max-w-none > a.absolute,
.relative.grid.h-svh.max-w-none > a.absolute {
  top: 1.15rem !important;
  left: 1.15rem !important;
  padding: 0.4rem 0.75rem 0.4rem 0.4rem !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.78) !important;
  border: 1px solid var(--af-line) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  flex-wrap: wrap;
  max-width: 14rem;
  row-gap: 0.1rem;
}

html.dark.af-auth-shell .relative.grid.h-svh.max-w-none > a.absolute,
html.dark .relative.grid.h-svh.max-w-none > a.absolute,
.dark .relative.grid.h-svh.max-w-none > a.absolute {
  background: rgba(17, 24, 39, 0.72) !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
}

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

html.af-auth-shell .relative.grid.h-svh.max-w-none > a.absolute::after,
.relative.grid.h-svh.max-w-none > a.absolute::after {
  content: "Flow your AI." !important;
  flex: 1 0 100%;
  margin: 0 0 0 2.35rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--af-muted);
  line-height: 1.2;
  display: block;
}

@media (max-width: 639px) {
  html.af-auth-shell .relative.grid.h-svh.max-w-none > a.absolute::after,
  .relative.grid.h-svh.max-w-none > a.absolute::after {
    margin-left: 2.2rem;
  }
}

html.af-auth-shell .relative.grid.h-svh.max-w-none > .container,
.relative.grid.h-svh.max-w-none > .container {
  position: relative;
  z-index: 1;
}

html.af-auth-shell .relative.grid.h-svh.max-w-none > .container > div,
.relative.grid.h-svh.max-w-none > .container > div {
  padding: 1.85rem 1.55rem !important;
  border-radius: 1.15rem !important;
  border: 1px solid var(--af-line) !important;
  background: rgba(255, 255, 255, 0.88) !important;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 22px 56px rgba(15, 23, 42, 0.08) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

html.dark.af-auth-shell .relative.grid.h-svh.max-w-none > .container > div,
html.dark .relative.grid.h-svh.max-w-none > .container > div,
.dark .relative.grid.h-svh.max-w-none > .container > div {
  background: rgba(17, 24, 39, 0.82) !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.38) !important;
}

@media (min-width: 640px) {
  html.af-auth-shell .relative.grid.h-svh.max-w-none > .container > div,
  .relative.grid.h-svh.max-w-none > .container > div {
    padding: 2.15rem 2.05rem !important;
  }
}

html.af-auth-shell .relative.grid.h-svh.max-w-none h2,
.relative.grid.h-svh.max-w-none h2 {
  letter-spacing: -0.025em;
  color: var(--af-ink) !important;
}

html.dark.af-auth-shell .relative.grid.h-svh.max-w-none h2,
html.dark .relative.grid.h-svh.max-w-none h2,
.dark .relative.grid.h-svh.max-w-none h2 {
  color: #f8fafc !important;
}

html.af-auth-shell .relative.grid.h-svh.max-w-none a[href="/sign-up"],
html.af-auth-shell .relative.grid.h-svh.max-w-none a[href="/sign-in"],
html.af-auth-shell .relative.grid.h-svh.max-w-none a[href="/register"],
html.af-auth-shell .relative.grid.h-svh.max-w-none a[href="/login"],
.relative.grid.h-svh.max-w-none a[href="/sign-up"],
.relative.grid.h-svh.max-w-none a[href="/sign-in"],
.relative.grid.h-svh.max-w-none a[href="/register"],
.relative.grid.h-svh.max-w-none a[href="/login"] {
  color: var(--af-purple) !important;
  text-underline-offset: 3px;
}

html.af-auth-shell .relative.grid.h-svh.max-w-none a[href="/forgot-password"],
.relative.grid.h-svh.max-w-none a[href="/forgot-password"] {
  color: var(--af-muted) !important;
}

html.af-auth-shell .relative.grid.h-svh.max-w-none a[href="/forgot-password"]:hover,
.relative.grid.h-svh.max-w-none a[href="/forgot-password"]:hover {
  color: var(--af-purple) !important;
}

html.af-auth-shell .relative.grid.h-svh.max-w-none input,
.relative.grid.h-svh.max-w-none input {
  border-radius: 0.7rem !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

html.af-auth-shell .relative.grid.h-svh.max-w-none input:focus-visible,
html.af-auth-shell .relative.grid.h-svh.max-w-none input:focus,
.relative.grid.h-svh.max-w-none input:focus-visible,
.relative.grid.h-svh.max-w-none input:focus {
  border-color: rgba(124, 58, 237, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.14) !important;
  outline: none;
}

/* Primary submit — violet→indigo (beats utility bg-sky / bg-primary) */
html.af-auth-shell .relative.grid.h-svh.max-w-none button[type="submit"],
.relative.grid.h-svh.max-w-none button[type="submit"] {
  border-radius: 0.75rem !important;
  background-color: #7c3aed !important;
  background-image: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%) !important;
  border-color: transparent !important;
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.26) !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em;
  color: #fff !important;
}

html.af-auth-shell .relative.grid.h-svh.max-w-none button[type="submit"]:hover,
.relative.grid.h-svh.max-w-none button[type="submit"]:hover {
  filter: brightness(1.04);
}

html.af-auth-shell .relative.grid.h-svh.max-w-none button[type="submit"]:disabled,
.relative.grid.h-svh.max-w-none button[type="submit"]:disabled {
  filter: none;
  opacity: 0.7;
  box-shadow: none !important;
}

html.af-auth-shell .relative.grid.h-svh.max-w-none button[type="button"],
.relative.grid.h-svh.max-w-none button[type="button"] {
  border-radius: 0.7rem !important;
}

html.af-auth-shell .relative.grid.h-svh.max-w-none form.grid,
.relative.grid.h-svh.max-w-none form.grid {
  gap: 1rem;
}
