/*
 * Login page — hand-written CSS reproducing shadcn's "login-03" block
 * (https://ui.shadcn.com/view/new-york-v4/login-03). Served as-is from public/,
 * independent of the admin's Vite build. Colour tokens mirror the admin's (dark-only)
 * theme so the two screens match.
 */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --card-foreground: oklch(0.985 0 0);
  --primary: oklch(0.922 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.556 0 0);
  --radius: 0.625rem;
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
}

/* Reset (the subset of Tailwind's preflight the page relies on) */
*,
::before,
::after {
  box-sizing: border-box;
  border: 0 solid var(--border);
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100svh;
  background-color: var(--background);
  color: var(--foreground);
  font-size: 1rem;
}

a {
  color: inherit;
  text-decoration: inherit;
}

button,
input {
  font: inherit;
  color: inherit;
  background-color: transparent;
  border-radius: 0;
}

button {
  cursor: pointer;
  appearance: button;
}

svg {
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}

/* Page */
.login-page {
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background-color: var(--muted);
  padding: 1.5rem;
}

@media (min-width: 768px) {
  .login-page {
    padding: 2.5rem;
  }
}

.login-page__inner {
  display: flex;
  width: 100%;
  max-width: 24rem;
  flex-direction: column;
  gap: 1.5rem;
}

/* Brand */
.login-brand {
  display: flex;
  align-items: center;
  align-self: center;
  gap: 0.5rem;
  font-weight: 500;
}

.login-brand__logo {
  display: flex;
  width: 1.5rem;
  height: 1.5rem;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 2px);
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.login-brand__logo svg {
  width: 1rem;
  height: 1rem;
}

/* Card */
.login-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background-color: var(--card);
  color: var(--card-foreground);
  box-shadow: var(--shadow-sm);
}

.login-card__header {
  display: grid;
  gap: 0.5rem;
  padding: 0 1.5rem;
  text-align: center;
}

.login-card__title {
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
}

.login-card__description {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--muted-foreground);
}

.login-card__content {
  padding: 0 1.5rem;
}

/* Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-field__row {
  display: flex;
  align-items: center;
}

.login-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.375;
  font-weight: 500;
}

.login-input {
  display: block;
  width: 100%;
  height: 2.25rem;
  min-width: 0;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 2px);
  background-color: color-mix(in oklab, var(--input) 30%, transparent);
  box-shadow: var(--shadow-xs);
  font-size: 0.875rem;
  line-height: 1.25rem;
  outline: none;
  transition:
    color 150ms,
    box-shadow 150ms;
}

.login-input::placeholder {
  color: var(--muted-foreground);
}

.login-input:focus-visible {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
}

.login-input:user-invalid {
  border-color: var(--destructive);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--destructive) 20%, transparent);
}

.login-link {
  margin-left: auto;
  font-size: 0.875rem;
  line-height: 1.25rem;
  text-underline-offset: 4px;
}

.login-link:hover {
  text-decoration: underline;
}

/* Buttons */
.login-button {
  display: inline-flex;
  width: 100%;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  white-space: nowrap;
  outline: none;
  transition:
    color 150ms,
    background-color 150ms,
    box-shadow 150ms;
}

.login-button svg {
  width: 1rem;
  height: 1rem;
}

.login-button:focus-visible {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
}

/* Buttons carry the admin's faint top-to-bottom sheen laid over the fill colour: the light
   primary fill darkens at the bottom, the translucent outline fill lightens at the top. */
.login-button--primary {
  background-color: var(--primary);
  background-image: linear-gradient(to bottom, rgb(255 255 255 / 60%), rgb(0 0 0 / 20%));
  color: var(--primary-foreground);
  box-shadow: var(--shadow-xs);
}

.login-button--primary:hover {
  background-color: color-mix(in oklab, var(--primary) 90%, transparent);
}

.login-button--outline {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--input);
  background-color: color-mix(in oklab, var(--input) 30%, transparent);
  background-image: linear-gradient(to bottom, rgb(255 255 255 / 5%), transparent);
  box-shadow: var(--shadow-xs);
}

.login-button--outline:hover {
  background-color: color-mix(in oklab, var(--input) 50%, transparent);
  color: var(--foreground);
}

/* "Or continue with" separator */
.login-separator {
  position: relative;
  height: 1.25rem;
  margin: -0.5rem 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
  text-align: center;
}

.login-separator::before {
  content: '';
  position: absolute;
  inset: 0;
  top: 50%;
  height: 1px;
  background-color: var(--border);
}

.login-separator__label {
  position: relative;
  display: inline-block;
  padding: 0 0.5rem;
  background-color: var(--card);
  color: var(--muted-foreground);
}

/* Muted helper text */
.login-note {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted-foreground);
  text-align: center;
}

.login-note--footer {
  padding: 0 1.5rem;
}

.login-note a {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.login-note a:hover {
  color: var(--primary);
}

/* Authentication error */
.login-alert {
  padding: 0.75rem 1rem;
  border: 1px solid color-mix(in oklab, var(--destructive) 50%, transparent);
  border-radius: var(--radius);
  background-color: color-mix(in oklab, var(--destructive) 10%, transparent);
  color: var(--destructive);
  font-size: 0.875rem;
  line-height: 1.25rem;
}
