:root {
  --lilla:       #7c3aed;
  --lilla-dark:  #6d28d9;
  --lilla-light: rgba(124, 58, 237, 0.08);
  --danger:      #c42b2b;
  --ok:          #0d8a5a;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  background: var(--lilla);   /* sfondo lilla */
  line-height: 1.45;
}

/* ── Pagina centrata ───────────────────────────────────────────────── */
.auth-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

/* ── Card bianca centrale ─────────────────────────────────────────── */
.auth-card {
  width: 100%;
  max-width: 380px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  overflow: hidden;
  padding-bottom: 1.75rem;
}

/* ── Logo ─────────────────────────────────────────────────────────── */
.auth-logo {
  margin: 1.75rem 1.5rem 1.25rem;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--lilla);
  text-align: center;
}

/* ── Tab Accedi / Registrati ──────────────────────────────────────── */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 1.5rem 1.25rem;
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 999px;
  padding: 3px;
  gap: 3px;
}

.auth-tab {
  border: 0;
  background: transparent;
  color: var(--lilla);
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.5rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  opacity: 0.55;
}

.auth-tab.is-active {
  background: var(--lilla);
  color: #ffffff;
  opacity: 1;
}

.auth-tab:hover:not(.is-active) {
  opacity: 0.85;
  background: var(--lilla-light);
}

.auth-tab:focus-visible {
  outline: 2px solid var(--lilla);
  outline-offset: 2px;
}

/* ── Pannelli form ────────────────────────────────────────────────── */
.auth-panels { padding: 0 1.5rem; }

.auth-panel[hidden] { display: none !important; }

/* ── Campi ────────────────────────────────────────────────────────── */
.auth-field { margin-bottom: 1rem; }

.auth-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--lilla);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.auth-field input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1.5px solid rgba(124, 58, 237, 0.25);
  background: #fff;
  color: var(--lilla);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-field input::placeholder { color: rgba(124, 58, 237, 0.35); }

.auth-field input:focus {
  outline: none;
  border-color: var(--lilla);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

/* ── Pulsante: bianco di default → lilla al hover/click ──────────── */
.auth-submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--lilla);
  border-radius: 8px;
  background: #ffffff;
  color: var(--lilla);
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.auth-submit:hover,
.auth-submit:active {
  background: var(--lilla);
  color: #ffffff;
}

.auth-submit:focus-visible {
  outline: 2px solid var(--lilla);
  outline-offset: 2px;
}

/* ── Messaggi ─────────────────────────────────────────────────────── */
.auth-message {
  margin-top: 0.85rem;
  font-size: 0.875rem;
  min-height: 1.25em;
  text-align: center;
}

.auth-message--error { color: var(--danger); }
.auth-message--ok    { color: var(--ok); }
