/* Pagina di accesso di ChessLens (servita dal server, pubblica).
   Stessi token di src/index.css e DESIGN.md: grafite + una sola ambra per il pulsante. */

@font-face {
  font-family: 'Schibsted Grotesk Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url(/login-fonts/schibsted-grotesk-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Schibsted Grotesk Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url(/login-fonts/schibsted-grotesk-latin-wght-normal.woff2) format('woff2-variations');
  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: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #1b1d22;
  --text: #2a2d34;
  --muted: #4f5562;
  --border: #dfe2e8;
  /* Bordo dei campi: almeno 3:1 sullo sfondo (WCAG 1.4.11). */
  --field-border: #7d8492;
  --accent: #f5a524;
  --accent-hover: #ffb83f;
  --accent-ink: #1b1d22;
  --focus: #8a5200;
  --warn: #8a5200;
  --warn-bg: #fff4de;
  --font: 'Schibsted Grotesk Variable', ui-sans-serif, system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #16181d;
    --surface: #1e2128;
    --ink: #f2f4f7;
    --text: #e3e6eb;
    --muted: #a3a9b5;
    --border: #2c3039;
    --field-border: #6a7180;
    --focus: #f5a524;
    --warn: #f7b955;
    --warn-bg: #2a2418;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  caret-color: var(--accent);
  accent-color: var(--accent);
}

::selection {
  background: rgb(245 165 36 / 0.35);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

/* Testata: solo il marchio, come l'header del sito. */
.top {
  display: flex;
  align-items: center;
  height: 64px;
  padding-inline: var(--gutter);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.brand__mark {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

/* In scuro la tessera grafite del marchio sparirebbe nello sfondo: filetto da 1px. */
@media (prefers-color-scheme: dark) {
  .brand__mark {
    box-shadow: 0 0 0 1px var(--border);
  }
}

.brand__name {
  font-weight: 750;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

/* Colonna del form: niente card, il contenuto sta direttamente sulla pagina. */
.login {
  width: min(100% - 2 * var(--gutter), 400px);
  margin-inline: auto;
  padding-block: clamp(40px, 11vh, 112px) 56px;
}

h1 {
  margin: 0;
  color: var(--ink);
  /* Headline di DESIGN.md. */
  font-size: clamp(1.75rem, 2.8vw, 2.5rem);
  font-weight: 740;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.lead {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 40ch;
  text-wrap: pretty;
}

/* Avviso d'errore (stesso stile degli avvisi dell'app). */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 24px 0 0;
  padding: 10px 12px;
  background: var(--warn-bg);
  border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
  border-radius: 10px;
  color: var(--ink);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.icon {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  fill: none;
  stroke: var(--warn);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.field {
  display: grid;
  gap: 6px;
}

label {
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 550;
  line-height: 1.4;
}

input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--field-border);
  border-radius: 10px;
  color: var(--ink);
  font: inherit;
  font-size: 1.0625rem;
  transition: border-color 160ms var(--ease-out);
}

input:hover {
  border-color: var(--muted);
}

input:focus-visible {
  outline-offset: 2px;
  border-color: var(--ink);
}

/* Il riempimento automatico del browser non cambia i colori del campo. */
input:autofill {
  box-shadow: 0 0 0 100px var(--surface) inset;
  -webkit-text-fill-color: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  margin-top: 6px;
  padding: 0 20px;
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: 10px;
  box-shadow: 0 6px 16px -8px rgb(185 110 0 / 0.7);
  color: var(--accent-ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition:
    background-color 160ms var(--ease-out),
    transform 160ms var(--ease-out);
}

.btn:hover {
  background: var(--accent-hover);
}

.btn:active {
  transform: translateY(1px);
}

.note {
  margin: 32px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
  text-wrap: pretty;
}

@media (prefers-reduced-motion: reduce) {
  input,
  .btn {
    transition: none;
  }

  .btn:active {
    transform: none;
  }
}
