*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-page);
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--fg);
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--bd);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px var(--shadow-40);
}

.brand {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-steel);
  margin-bottom: 0.5rem;
}

.card h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--fg-strong);
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--bg-inset);
  border: 1px solid var(--bd);
  border-radius: 7px;
  color: var(--fg-strong);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 0.35rem;
}

input[type="email"] {
  margin-bottom: 0.35rem;
}

input[type="password"] {
  margin-bottom: 0.25rem;
}

/* Verification code input — big, monospace, centered */
input#code {
  font-size: 2rem;
  font-family: 'Courier New', Courier, monospace;
  letter-spacing: 0.4em;
  text-align: center;
  padding: 1rem 0.5rem;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
}

input:focus { border-color: steelblue; }
input.invalid { border-color: #f87171; }

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper input {
  flex: 1;
  padding-right: 2.5rem;
}

.eye-btn {
  position: absolute;
  right: 0.6rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--fg-subtle);
  padding: 0.2rem;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.eye-btn:hover { color: var(--fg-muted); }

.eye-btn svg {
  width: 18px;
  height: 18px;
}

.field-error {
  font-size: 0.8rem;
  color: var(--fg-red);
  min-height: 1.1em;
  margin-bottom: 0.85rem;
}

button[type="submit"] {
  width: 100%;
  padding: 0.75rem;
  background: steelblue;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 0.25rem;
}

button[type="submit"]:hover { background: #386890; }
button[type="submit"]:disabled { background: skyblue; opacity: 0.6; cursor: not-allowed; }

.login-link {
  font-size: 0.85rem;
  color: var(--fg-muted);
  text-align: center;
}

.login-link a {
  color: var(--fg-steel);
  text-decoration: none;
  font-weight: 600;
}

.login-link a:hover { text-decoration: underline; }

#error-msg {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--fg-red);
  min-height: 1.2em;
  text-align: center;
}

.lang-switcher {
    margin-top: 15px;
    background: var(--bg-panel);
    color: var(--fg-muted);
    border-radius: 6px;
    border: 1px solid var(--bd-faint);
    padding: 0.4rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: border-color 0.2s, color 0.2s;
}

.lang-switcher:hover { border-color: steelblue; color: var(--fg-strong); }

.lang-switcher-paragraph {
  text-align: center;
}

.info-msg {
  font-size: 0.88rem;
  color: var(--fg-muted);
  margin-bottom: 0.75rem;
}

.btn-secondary {
  width: 100%;
  padding: 0.65rem;
  border: 1px solid var(--bd);
  border-radius: 0.5rem;
  background: transparent;
  color: var(--fg-muted);
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: border-color 0.2s, color 0.2s;
}
.btn-secondary:hover { border-color: steelblue; color: var(--fg); }

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  color: var(--fg-muted);
  font-size: 0.85rem;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--bg-raised);
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  background: #ffffff;
  color: #1f2937;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 0.2s, background 0.2s;
  margin-bottom: 0.5rem;
  box-shadow: 0 1px 3px var(--shadow-25);
}
.btn-google:hover {
  background: #f3f4f6;
  box-shadow: 0 2px 6px var(--shadow-35);
}

.pw-strength-track {
  width: 100%;
  height: 6px;
  background: var(--bg-raised);
  border-radius: 3px;
  margin-bottom: 4px;
  margin-top: -6px;          /* pulls it closer to the password input */
  overflow: hidden;
}

.pw-strength-fill {
  height: 100%;
  width: 0%;
  background: var(--bg-raised);
  border-radius: 3px;
  transition: width 0.3s ease, background 0.3s ease;
}

.pw-strength-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  min-height: 1.1em;
  margin-bottom: 4px;
}

.pw-strength-issues {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--fg-amber);            /* amber warnings */
  min-height: 1em;
  margin-bottom: 0.5rem;
}

.pw-strength-issues span {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 4px;
  padding: 1px 6px;
}
/* ── Focus visibility ────────────────────────────────────────────────────────
   The rules above remove the native outline from inputs and selects and often
   replace it with a colour change only, which is invisible to anyone who
   cannot distinguish the two colours and disappears entirely in forced-colours
   mode. Keyboard users need to be able to see where they are. */
:focus-visible {
  outline: 3px solid #38bdf8;
  outline-offset: 2px;
  border-radius: 3px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #38bdf8;
  outline-offset: 2px;
}

/* Honour the OS-level preference: pulses, spins and smooth scrolling are
   decorative, and for some people they are a migraine or a vestibular episode. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Consent checkboxes ──────────────────────────────────────────────────────
   Shown with the verification code and gating the same button. Deliberately NOT
   styled like the field labels above, which are uppercase, letter-spaced and
   0.8rem: that treatment reads as a field name, and this is a sentence somebody
   is agreeing to. It has to be readable at normal weight and normal case.

   align-items:flex-start so a label that wraps to two lines keeps its box
   against the first line rather than floating to the middle, and the box is
   given a fixed flex basis so a long translation cannot squeeze it. */
.consent-block {
  margin-bottom: 1.25rem;
}

label.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 0.6rem;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--fg-soft);
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.45;
  cursor: pointer;
}

label.consent-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin: 0.12rem 0 0 0;
  accent-color: var(--fg-steel);
  cursor: pointer;
}

/* The link is the point of the sentence, so it must not look like the rest of
   it. underline rather than colour alone: colour alone is invisible to a
   reader who cannot distinguish it from the surrounding text. */
label.consent-row a {
  color: var(--fg-steel-soft);
  text-decoration: underline;
}
label.consent-row a:hover { color: var(--fg-strong); }
