/* Auth pages — layout/visual language mirrored from Paperclip Auth.tsx */

:root {
  color-scheme: light;
  --radius: 0.5rem;
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --text-micro: 11px;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --background: oklch(0.145 0 0);
    --foreground: oklch(0.985 0 0);
    --muted: oklch(0.269 0 0);
    --muted-foreground: oklch(0.708 0 0);
    --border: oklch(1 0 0 / 10%);
    --input: oklch(1 0 0 / 15%);
    --ring: oklch(0.556 0 0);
    --primary: oklch(0.922 0 0);
    --primary-foreground: oklch(0.205 0 0);
    --destructive: oklch(0.704 0.191 22.216);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

.auth-shell {
  position: fixed;
  inset: 0;
  display: flex;
  overflow: hidden;
  background: var(--background);
}

.auth-form-pane {
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* Match Paperclip: no classic OS scrollbar chrome between panes */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.auth-form-pane::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

@media (min-width: 768px) {
  .auth-form-pane { width: 50%; }
}

.auth-form-inner {
  width: 100%;
  max-width: 28rem;
  margin: auto;
  padding: 3rem 2rem;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 2rem;
  text-decoration: none;
  color: inherit;
}

.auth-brand-mark {
  width: 1.125rem;
  height: 1.075rem;
  color: var(--foreground);
  flex-shrink: 0;
  display: block;
}

.auth-brand-name {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.auth-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.auth-desc {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

.auth-form {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-field label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.auth-field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 0.8);
  background: transparent;
  color: var(--foreground);
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-size: 0.875rem;
  outline: none;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.auth-field input::placeholder {
  color: color-mix(in oklch, var(--muted-foreground) 50%, transparent);
}

.auth-field input:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 1px var(--ring);
}

.auth-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: end;
}

.auth-code-btn {
  height: 2.375rem;
  padding: 0 0.85rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 0.8);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.auth-code-btn:hover:not(:disabled) {
  background: var(--muted);
}

.auth-code-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Paperclip LanguageSwitcher segmented: muted track, raised selected pill */
.auth-tabs {
  display: inline-flex;
  align-items: center;
  width: 100%;
  gap: 0;
  padding: 0.125rem;
  border: 0;
  border-radius: calc(var(--radius) * 1.4);
  background: color-mix(in oklch, var(--muted) 70%, transparent);
}

.auth-tabs button {
  flex: 1;
  border: 0;
  border-radius: calc(var(--radius) * 0.8);
  background: transparent;
  color: var(--muted-foreground);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.375rem 0.625rem;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.auth-tabs button:hover:not(.active) {
  color: var(--foreground);
}

.auth-tabs button.active {
  background: var(--background);
  color: var(--foreground);
  box-shadow: 0 1px 2px oklch(0 0 0 / 8%);
}

.auth-error {
  margin: 0;
  min-height: 1rem;
  font-size: 0.75rem;
  color: var(--destructive);
}

.auth-dev {
  margin: -0.35rem 0 0;
  font-size: 0.75rem;
  color: oklch(0.55 0.12 145);
}

.auth-submit {
  width: 100%;
  height: 2.5rem;
  border: 0;
  border-radius: calc(var(--radius) * 0.8);
  background: var(--primary);
  color: var(--primary-foreground);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.auth-submit:hover:not(:disabled) {
  opacity: 0.92;
}

.auth-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-switch {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.auth-switch button,
.auth-switch a {
  font: inherit;
  font-weight: 500;
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.auth-back {
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.auth-back a {
  color: inherit;
  text-decoration: none;
}

.auth-back a:hover {
  color: var(--foreground);
}

.auth-art-pane {
  display: none;
  width: 50%;
  overflow: hidden;
  border-left: 1px solid var(--border);
  background: color-mix(in oklch, var(--muted) 35%, var(--background));
}

@media (min-width: 768px) {
  .auth-art-pane { display: block; }
}

.auth-art-pane pre {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  user-select: none;
  line-height: 1;
  font-size: var(--text-micro);
  font-family: var(--font-mono);
  color: color-mix(in oklch, var(--muted-foreground) 60%, transparent);
}
