/*
 * Pagine pubbliche di accesso (login, registrazione, password, conferma, sblocco).
 * Palette e tipografia di https://alloggiati.pro/ — foglio autonomo, senza Bootstrap.
 */

@font-face {
  font-family: "Manrope Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(https://cdn.jsdelivr.net/fontsource/fonts/manrope:vf@latest/latin-wght-normal.woff2) format("woff2-variations");
}

:root {
  --ink: #202320;
  --muted: #555b55;
  --paper: #fff;
  --soft: #f5f6f3;
  --line: #dde1da;
  --field-line: #929a90;
  --blue: #004b93;
  --blue-soft: #eaf2fa;
  --blue-pale: #d6e5f4;
  --yellow: #f7d84a;
  --yellow-dark: #eac831;
  --yellow-ink: #4e451a;
  --danger: #a02723;
  --font: "Manrope Variable", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
p,
ol,
ul,
fieldset {
  margin: 0;
  padding: 0;
}

fieldset {
  border: 0;
  min-width: 0;
}

button,
input {
  font: inherit;
  color: inherit;
}

a {
  color: var(--blue);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

/* ---------- Struttura ---------- */

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.auth-main {
  display: flex;
  flex-direction: column;
  padding: 28px 24px 24px;
}

.auth-top,
.auth-body,
.auth-foot {
  width: 100%;
  max-width: 420px;
  margin-inline: auto;
}

.auth-brand {
  display: inline-flex;
  /* il file SVG ha un margine interno a sinistra: lo allinea alla colonna del testo */
  margin-left: -21px;
  border-radius: 4px;
}

.auth-brand img {
  display: block;
  width: 150px;
  height: auto;
}

.auth-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 40px;
}

.auth-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
}

.auth-foot a {
  color: var(--muted);
  font-weight: 550;
  text-decoration: none;
}

.auth-foot a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* ---------- Testi ---------- */

.auth-title {
  font-size: clamp(2rem, 6vw, 2.5rem);
  font-weight: 750;
  line-height: 1.12;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.auth-lead {
  margin-top: 10px;
  color: var(--muted);
  max-width: 44ch;
}

.auth-form {
  margin-top: 30px;
}

/* ---------- Avvisi ---------- */

.alert {
  margin: 24px 0 0;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  font-size: 0.92rem;
  font-weight: 550;
  line-height: 1.5;
}

.alert-success {
  border-color: #b0cdea;
  background: var(--blue-soft);
  color: #17232e;
}

.alert-danger {
  border-color: #e3b9b7;
  background: #fbf0ef;
  color: var(--danger);
}

.alert-offer {
  border-color: var(--yellow-dark);
  background: #fdf6d2;
  color: var(--yellow-ink);
}

.auth-form .alert {
  margin: 0 0 20px;
}

/* ---------- Campi ---------- */

.mb-3,
.auth-field {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 700;
}

.form-label abbr {
  display: none;
}

.form-control {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 11px 13px;
  border: 1px solid var(--field-line);
  border-radius: 6px;
  background: var(--paper);
  font-size: 1rem;
  line-height: 1.5;
  caret-color: var(--ink);
  transition: border-color 0.15s;
}

.form-control::placeholder {
  color: #959b92;
}

.form-control:hover {
  border-color: var(--ink);
}

.form-control:focus {
  border-color: var(--ink);
}

.form-control.is-invalid,
.was-validated .form-control:invalid {
  border-color: var(--danger);
  box-shadow: inset 0 0 0 1px var(--danger);
}

.form-text,
.invalid-feedback {
  display: block;
  margin-top: 6px;
  font-size: 0.84rem;
  line-height: 1.45;
}

.form-text {
  color: var(--muted);
}

.invalid-feedback {
  color: var(--danger);
  font-weight: 650;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-check-input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--blue);
}

.form-check-label {
  font-size: 0.92rem;
  font-weight: 550;
}

.auth-suggestion {
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 6px;
  background: #fdf6d2;
  color: var(--yellow-ink);
  font-size: 0.88rem;
}

.auth-suggestion a {
  color: inherit;
}

.auth-suggestion a + a {
  margin-left: 10px;
  font-weight: 550;
}

/* ---------- Pulsanti ---------- */

.auth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  margin-top: 6px;
  padding: 14px 25px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 750;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s, transform 0.18s;
}

.auth-button:hover {
  background: var(--yellow-dark);
  transform: translateY(-2px);
}

.auth-button:active {
  transform: translateY(0);
}

/* ---------- Link sotto il modulo ---------- */

.auth-switch {
  margin-top: 26px;
  color: var(--muted);
  font-size: 0.95rem;
}

.auth-links {
  display: grid;
  gap: 8px;
  margin-top: 26px;
  list-style: none;
  font-size: 0.92rem;
}

.auth-switch + .auth-links {
  margin-top: 14px;
}

.auth-links a {
  color: var(--muted);
  font-weight: 550;
}

.auth-links a:hover {
  color: var(--blue);
}

.auth-legal {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.82rem;
}

.auth-legal a {
  color: inherit;
  font-weight: 550;
}

/* ---------- Pannello blu ---------- */

.auth-aside {
  display: none;
}

@media (min-width: 960px) {
  .auth-shell {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .auth-main {
    padding: 36px 48px 28px;
  }

  .auth-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    padding: 64px clamp(48px, 6vw, 96px);
    background: var(--blue);
    color: #fff;
  }

  .auth-aside-inner {
    position: relative;
    max-width: 480px;
  }

  .auth-roof {
    position: absolute;
    right: -12%;
    bottom: -8%;
    width: 78%;
    height: auto;
    color: #fff;
    opacity: 0.07;
    pointer-events: none;
  }

  .auth-aside h2 {
    font-size: clamp(2.3rem, 3.6vw, 3.3rem);
    font-weight: 750;
    line-height: 1.1;
    letter-spacing: -0.04em;
    text-wrap: balance;
  }

  .auth-steps {
    display: grid;
    gap: 26px;
    margin-top: 52px;
    list-style: none;
    counter-reset: step;
  }

  .auth-steps li {
    position: relative;
    padding-left: 58px;
    counter-increment: step;
  }

  .auth-steps li::before {
    content: counter(step);
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--yellow);
    color: var(--ink);
    font-weight: 750;
  }

  .auth-steps strong {
    display: block;
    font-size: 1.08rem;
    font-weight: 750;
    line-height: 1.35;
  }

  .auth-steps span {
    display: block;
    margin-top: 3px;
    color: var(--blue-pale);
    font-size: 0.95rem;
    line-height: 1.55;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-button,
  .form-control {
    transition: none;
  }

  .auth-button:hover {
    transform: none;
  }
}
