:root {
  --auth-bg: #08070a;
  --auth-panel: rgba(17, 14, 19, .88);
  --auth-line: rgba(255, 255, 255, .14);
  --auth-line-strong: rgba(255, 255, 255, .24);
  --auth-ink: #fff;
  --auth-muted: rgba(255, 255, 255, .58);
  --auth-soft: rgba(255, 255, 255, .08);
  --auth-red: #c11d40;
  --auth-bordeaux: #8d0d29;
  --auth-ok: #3ddc97;
  --auth-font: "Inter", "Helvetica Neue", Arial, sans-serif;
  --auth-display: "Space Grotesk", Inter, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--auth-bg); }
body.auth-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  color: var(--auth-ink);
  background:
    radial-gradient(circle at 50% 45%, rgba(193, 29, 64, .14), transparent 34%),
    radial-gradient(circle at 15% 20%, rgba(141, 13, 41, .18), transparent 28%),
    var(--auth-bg);
  font-family: var(--auth-font);
}

.auth-dots,
.auth-vignette,
.auth-soften,
.auth-ecosystem { position: fixed; inset: 0; pointer-events: none; }
.auth-dots { z-index: 0; width: 100%; height: 100%; opacity: .9; }
.auth-vignette { z-index: 1; background: radial-gradient(circle at center, transparent 24%, rgba(0, 0, 0, .72) 100%); }
.auth-soften { z-index: 2; backdrop-filter: blur(.2px); }
.auth-ecosystem { z-index: 2; overflow: hidden; }

.auth-ecosystem img {
  position: absolute;
  width: auto;
  max-width: 180px;
  max-height: 42px;
  object-fit: contain;
  opacity: 0;
  filter: grayscale(1) brightness(2.8);
  transition: opacity .7s ease;
}
.auth-ecosystem img.visible { opacity: .32; }

.auth-stage {
  position: relative;
  z-index: 5;
  width: 100%;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.auth-card,
.auth-form {
  width: min(100%, 430px);
  padding: 34px 36px 30px;
  border: 1px solid var(--auth-line);
  border-radius: 24px;
  background: var(--auth-panel);
  box-shadow: 0 36px 90px -38px rgba(0, 0, 0, .95);
  backdrop-filter: blur(22px);
  animation: auth-enter .55s cubic-bezier(.2, .8, .2, 1) both;
}

.auth-register-card { width: min(100%, 470px); }

.auth-brand { margin-bottom: 28px; text-align: center; }
.auth-brand .mark {
  position: relative;
  width: 72px;
  height: 72px;
  display: inline-grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--auth-bordeaux), var(--auth-red));
  box-shadow: 0 0 0 8px rgba(193, 29, 64, .08), 0 0 54px rgba(193, 29, 64, .38);
}
.auth-brand .mark::before,
.auth-brand .mark::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(193, 29, 64, .3);
  border-radius: 50%;
  animation: auth-pulse 2.8s ease-out infinite;
}
.auth-brand .mark::after { animation-delay: 1.4s; }
.auth-brand .mark img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.auth-brand h1 { margin: 0; font: 400 30px/1 var(--auth-display); letter-spacing: -.04em; }
.auth-brand h1 b { color: var(--auth-red); font-weight: 700; }
.auth-brand p { margin: 8px 0 0; color: var(--auth-muted); font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }

.auth-errors,
.auth-status {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(224, 68, 106, .35);
  border-radius: 12px;
  color: #ffc3d0;
  background: rgba(193, 29, 64, .12);
  font-size: 12.5px;
  line-height: 1.5;
}
.auth-status { color: #aaf3d2; border-color: rgba(61, 220, 151, .3); background: rgba(61, 220, 151, .09); }
.auth-errors ul { margin: 5px 0 0; padding-left: 18px; }

.auth-field { margin-bottom: 17px; }
.auth-field-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.auth-field label {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, .72);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.auth-field-top label { margin-bottom: 0; }
.auth-field a,
.auth-link { color: rgba(255, 255, 255, .6); font-size: 11.5px; text-decoration: none; }
.auth-field a:hover,
.auth-link:hover { color: #fff; }

.auth-input-wrap { position: relative; }
.auth-input-wrap > i {
  position: absolute;
  top: 50%;
  left: 15px;
  z-index: 2;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, .35);
}
.auth-input-wrap input,
.auth-field input,
.auth-field select {
  width: 100%;
  height: 48px;
  padding: 0 46px;
  border: 1px solid var(--auth-line);
  border-radius: 13px;
  outline: none;
  color: #fff;
  background: rgba(255, 255, 255, .055);
  font: 400 14px var(--auth-font);
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.auth-field > input { padding: 0 15px; }
.auth-input-wrap input::placeholder,
.auth-field input::placeholder { color: rgba(255, 255, 255, .28); }
.auth-input-wrap input:focus,
.auth-field input:focus,
.auth-field select:focus {
  border-color: rgba(193, 29, 64, .9);
  background: rgba(255, 255, 255, .075);
  box-shadow: 0 0 0 4px rgba(193, 29, 64, .12);
}
.auth-input-wrap .auth-eye {
  position: absolute;
  top: 50%;
  right: 9px;
  width: 34px;
  height: 34px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 9px;
  color: rgba(255, 255, 255, .42);
  background: transparent;
}
.auth-eye:hover { color: #fff; background: var(--auth-soft); }

:where(a, button, input, select):focus-visible {
  outline: 3px solid rgba(255, 107, 138, .72);
  outline-offset: 3px;
}

.auth-help { margin: 8px 2px 0; color: var(--auth-muted); font-size: 11.5px; line-height: 1.45; }
.auth-help.warning { color: #ffcf6b; }
.auth-help.success { color: var(--auth-ok); }
.auth-invalid { margin-top: 7px; color: #ff8faa; font-size: 11.5px; }

.auth-remember { display: flex; align-items: center; gap: 10px; margin: 4px 0 20px; color: var(--auth-muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
.auth-remember input { accent-color: var(--auth-red); }

.auth-button,
.auth-ghost {
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(120deg, var(--auth-bordeaux), var(--auth-red));
  box-shadow: 0 18px 34px -20px rgba(193, 29, 64, .95);
  font: 600 13.5px var(--auth-font);
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s, box-shadow .18s;
}
.auth-button:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 22px 40px -20px rgba(193, 29, 64, 1); }
.auth-button:disabled { cursor: wait; opacity: .65; transform: none; }
.auth-ghost { color: #fff; background: var(--auth-soft); border: 1px solid var(--auth-line-strong); box-shadow: none; }
.auth-ghost:hover { color: #fff; background: rgba(255, 255, 255, .12); border-color: rgba(193, 29, 64, .7); }

.auth-separator { position: relative; margin: 20px 0; color: rgba(255, 255, 255, .35); text-align: center; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.auth-separator::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--auth-line); }
.auth-separator span { position: relative; padding: 0 12px; background: #100d12; }
.auth-foot { margin: 22px 0 0; color: rgba(255, 255, 255, .28); font-size: 10.5px; text-align: center; }

.auth-steps { display: flex; align-items: center; justify-content: center; margin: 0 0 26px; }
.auth-step { display: flex; align-items: center; gap: 7px; color: var(--auth-muted); font-size: 11.5px; }
.auth-step i { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--auth-line-strong); border-radius: 50%; font-style: normal; }
.auth-step.active { color: #fff; }
.auth-step.active i { color: #fff; border-color: var(--auth-red); background: var(--auth-red); }
.auth-step-line { width: 42px; height: 1px; margin: 0 10px; background: var(--auth-line); }
.auth-back { width: 100%; display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 13px; padding: 8px; border: 0; color: var(--auth-muted); background: transparent; font: 12px var(--auth-font); text-decoration: none; }
.auth-back:hover { color: #fff; }
.auth-legal { margin: 18px 0 0; color: rgba(255, 255, 255, .35); font-size: 10.5px; line-height: 1.5; text-align: center; }
.auth-legal a { color: rgba(255, 255, 255, .58); }

.password-bars { display: flex; gap: 5px; margin: 9px 2px 0; }
.password-bars i { height: 3px; flex: 1; border-radius: 99px; background: rgba(255, 255, 255, .12); }

@keyframes auth-enter { from { opacity: 0; transform: translateY(18px) scale(.985); } }
@keyframes auth-pulse { 0% { transform: scale(.94); opacity: .7; } 100% { transform: scale(1.28); opacity: 0; } }

@media (max-width: 560px) {
  .auth-stage { padding: 18px 12px; align-items: start; }
  .auth-card, .auth-form { margin: auto 0; padding: 28px 22px 24px; border-radius: 20px; }
  .auth-ecosystem { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card, .auth-form, .auth-brand .mark::before, .auth-brand .mark::after { animation: none; }
}

/* Compatibility for the remaining guest forms. */
.auth-header { text-align: center; }
.auth-header h1 { font: 600 26px var(--auth-display); }
.auth-header p { color: var(--auth-muted); }
.auth-body .form-label { color: rgba(255,255,255,.72); }
.auth-body .form-control { color: #fff; background: rgba(255,255,255,.055); border-color: var(--auth-line); }
.auth-body .form-control:focus { color: #fff; background: rgba(255,255,255,.075); border-color: var(--auth-red); box-shadow: 0 0 0 4px rgba(193,29,64,.12); }
.auth-body .btn { min-height: 44px; border-radius: 999px; }

/* Login approvato: trasposizione fedele di update_UI/login.html. */
html:has(body.login-page) {
  height: 100%;
  background: #000;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

body.login-page {
  position: fixed;
  inset: 0;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  color: #fff;
  background: radial-gradient(120% 90% at 50% 45%, #0f0b0c 0%, #060506 40%, #000 100%);
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  --wine-900: #170509;
  --wine-800: #25090f;
  --wine-700: #3a0d18;
  --wine-600: #5a1224;
  --crimson: #a4102f;
  --crimson-lt: #d42a4f;
  --pink: #ff6b8a;
  --ink: #fff;
  --ink-70: rgba(255,255,255,.70);
  --ink-45: rgba(255,255,255,.45);
  --ink-22: rgba(255,255,255,.22);
}

.login-page #dots { position: fixed; inset: 0; z-index: auto; width: 100%; height: 100%; display: block; opacity: 1; }
.login-page .vignette {
  position: fixed;
  inset: 0;
  z-index: auto;
  pointer-events: none;
  background: radial-gradient(120% 100% at 50% 50%, rgba(0,0,0,0) 40%, rgba(0,0,0,.75) 100%);
}
.login-page .soften {
  position: fixed;
  left: 50%;
  top: 50%;
  inset: auto;
  z-index: 1;
  width: min(760px,94vw);
  height: min(760px,94vh);
  transform: translate(-50%,-50%);
  backdrop-filter: blur(6px) brightness(.84);
  -webkit-backdrop-filter: blur(6px) brightness(.84);
  -webkit-mask-image: radial-gradient(closest-side, #000 42%, rgba(0,0,0,.55) 66%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 42%, rgba(0,0,0,.55) 66%, transparent 100%);
  pointer-events: none;
}
.login-page .eco-labels { position: fixed; inset: 0; z-index: 1; overflow: visible; pointer-events: none; }
.login-page .eco-item {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  will-change: transform, opacity;
  transition: opacity 1.6s ease-in-out;
}
.login-page .eco-item img { position: static; display: block; max-width: none; max-height: none; opacity: 1; filter: none; transition: none; }

.login-page .stage {
  position: relative;
  z-index: auto;
  width: auto;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
}
.login-page .card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 390px;
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  box-shadow: none;
  animation: login-rise .8s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes login-rise { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }

.login-page .brand { display: flex; flex-direction: column; align-items: center; margin-bottom: 26px; text-align: center; }
.login-page .mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  padding: 0;
  margin-bottom: 14px;
  color: #fff;
  background: transparent;
  border-radius: 50%;
  filter: drop-shadow(0 0 16px rgba(212,42,79,.55));
  animation: login-breathe 4.5s ease-in-out infinite;
}
.login-page .mark img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  box-shadow: 0 0 0 1px rgba(255,255,255,.16), 0 0 22px -6px rgba(212,42,79,.9);
}
.login-page .mark::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,0,0,.75) 0%, rgba(212,42,79,.28) 45%, rgba(212,42,79,0) 72%);
}
@keyframes login-breathe { 0%,100% { filter: drop-shadow(0 0 14px rgba(212,42,79,.40)); } 50% { filter: drop-shadow(0 0 26px rgba(255,107,138,.70)); } }
.login-page .brand h1 { margin: 0; font-family: "Space Grotesk", Inter, sans-serif; font-size: 34px; font-weight: 400; letter-spacing: -.03em; line-height: 1; }
.login-page .brand h1 b { color: #c11d40; font-weight: 700; }
.login-page .brand p { margin: 10px 0 0; color: rgba(255,255,255,.38); font-size: 9.5px; font-weight: 500; letter-spacing: .32em; text-transform: uppercase; }

.login-page .field { margin-bottom: 18px; }
.login-page .field-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; padding: 0 18px; }
.login-page label { color: rgba(255,255,255,.5); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.login-page .field-top a { color: var(--pink); font-size: 11.5px; text-decoration: none; opacity: .85; transition: opacity .2s; }
.login-page .field-top a:hover { opacity: 1; text-decoration: underline; }
.login-page .input-wrap { position: relative; display: flex; align-items: center; }
.login-page .input-wrap svg.lead { position: absolute; left: 18px; width: 15px; height: 15px; color: var(--ink-45); pointer-events: none; transition: color .25s; }
.login-page input[type=email],
.login-page input[type=password],
.login-page input[type=text] {
  width: 100%;
  height: 50px;
  padding: 0 46px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 999px;
  outline: none;
  color: var(--ink);
  background: rgba(255,255,255,.055);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: inherit;
  font-size: 14.5px;
  transition: border-color .25s, background .25s, box-shadow .25s;
}
.login-page input::placeholder { color: rgba(255,255,255,.30); }
.login-page input:focus { background: rgba(255,255,255,.07); border-color: rgba(212,42,79,.85); box-shadow: 0 0 0 4px rgba(164,16,47,.22), 0 0 24px -6px rgba(255,107,138,.5); }
.login-page .input-wrap:focus-within svg.lead { color: var(--pink); }
.login-page .eye {
  position: absolute;
  right: 7px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: var(--ink-45);
  background: transparent;
  cursor: pointer;
  transition: color .2s, background .2s;
}
.login-page .eye:hover { color: var(--ink); background: rgba(255,255,255,.10); }
.login-page .remember { display: flex; align-items: center; gap: 10px; margin: 2px 0 22px; padding: 0 18px; cursor: pointer; user-select: none; }
.login-page .remember input { position: absolute; opacity: 0; pointer-events: none; }
.login-page .box { width: 18px; height: 18px; border: 1px solid rgba(255,255,255,.22); border-radius: 6px; flex: none; display: grid; place-items: center; background: rgba(255,255,255,.05); transition: .2s; }
.login-page .box svg { width: 11px; height: 11px; color: #fff; opacity: 0; transform: scale(.6); transition: .18s; }
.login-page .remember input:checked + .box { border-color: transparent; background: linear-gradient(140deg,var(--crimson),var(--crimson-lt)); }
.login-page .remember input:checked + .box svg { opacity: 1; transform: none; }
.login-page .remember span { color: var(--ink-70); font-size: 13px; }
.login-page .btn {
  position: relative;
  width: 100%;
  height: 50px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(120deg,#8d0d29 0%,#c11d40 48%,#e04468 100%);
  box-shadow: 0 16px 34px -18px rgba(212,42,79,.9), inset 0 1px 0 rgba(255,255,255,.22);
  font-family: "Space Grotesk",Inter,sans-serif;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .25s;
}
.login-page .btn:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 20px 38px -12px rgba(212,42,79,.95), inset 0 1px 0 rgba(255,255,255,.3); }
.login-page .btn:active { transform: translateY(0); }
.login-page .btn::after { content: ""; position: absolute; top: 0; left: -40%; width: 35%; height: 100%; background: linear-gradient(100deg,transparent,rgba(255,255,255,.32),transparent); transform: skewX(-18deg); animation: login-sheen 4.5s ease-in-out infinite; }
@keyframes login-sheen { 0%,62% { left: -40%; } 82%,100% { left: 130%; } }
.login-page .sep { display: flex; align-items: center; gap: 12px; max-width: 220px; margin: 18px auto 14px; }
.login-page .sep::before, .login-page .sep::after { content: ""; height: 1px; flex: 1; background: linear-gradient(90deg,transparent,rgba(255,255,255,.22),transparent); }
.login-page .sep span { color: var(--ink-45); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.login-page .ghost { width: 100%; height: 48px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; color: #fff; background: rgba(255,255,255,.055); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-family: "Space Grotesk",Inter,sans-serif; font-size: 14px; font-weight: 600; text-decoration: none; transition: background .22s, border-color .22s, transform .18s cubic-bezier(.2,.8,.2,1); }
.login-page .ghost:hover { color: #fff; background: rgba(255,255,255,.10); border-color: rgba(255,107,138,.55); transform: translateY(-1px); }
.login-page .ghost .ico { width: 15px; height: 15px; color: var(--pink); flex: none; }
.login-page .ghost .arrow { width: 14px; height: 14px; color: rgba(255,255,255,.55); transition: transform .22s, color .22s; }
.login-page .ghost:hover .arrow { color: #fff; transform: translateX(3px); }
.login-page .foot { margin: 9px 0 0; color: rgba(255,255,255,.32); font-size: 11.5px; text-align: center; }
.login-page .auth-errors, .login-page .auth-status { margin: 0 8px 18px; border-radius: 16px; }

@media (max-width: 1150px) { .login-page .eco-labels { display: none; } }
@media (max-width: 420px) {
  .login-page .card { padding: 30px 22px 24px; border-radius: 18px; }
  .login-page .brand h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .login-page .btn::after, .login-page .card, .login-page .mark { animation: none; }
}
