/* Pagine di accesso e registrazione di VolleyHub (login, join, completa-eta, recupero password).
   Stessa direzione visiva sportiva dell'app React e della landing:
   superfici nero neutro (#0a0a0a, #171717, #222222), linea #262626,
   testi #e5e5e5 e #a3a3a3, accento lime #ccff00 con testo #0a0a0a.
   Font locali (Inter Variable e Barlow Condensed), zero CDN esterni. */

@font-face {
  font-family: "Inter Variable";
  src: url('/static/fonts/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url('/static/fonts/barlow-condensed-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url('/static/fonts/barlow-condensed-latin-800-normal.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}

:root {
  --surface-0: #0a0a0a;
  --surface-1: #171717;
  --surface-2: #222222;
  --line: #262626;
  --ink: #e5e5e5;
  --ink-muted: #a3a3a3;
  --lime: #ccff00;
  --on-lime: #0a0a0a;
  --warning: #fb923c;
  --danger: #fb7185;
  --success: #34d399;
  --radius-control: 8px;
  --radius-card: 12px;
  --font-sport: "Barlow Condensed", system-ui, sans-serif;
  --font-sans: "Inter Variable", system-ui, -apple-system, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--surface-0);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--lime);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

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

/* Barra superiore essenziale: un solo marchio VolleyHub sopra la scheda */
.auth-header {
  border-bottom: 1px solid var(--line);
  background-color: var(--surface-0);
}

.auth-header-inner {
  width: min(560px, 100% - 32px);
  margin-inline: auto;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--font-sport);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.auth-brand:hover {
  text-decoration: none;
}
.auth-brand img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: block;
}
.auth-brand span {
  color: var(--lime);
}

.auth-header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  background-color: var(--surface-1);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}
.auth-nav-link:hover {
  background-color: var(--surface-2);
  text-decoration: none;
}

/* Contenitore e scheda */
.auth-main {
  flex: 1;
  width: min(460px, 100% - 32px);
  margin: 28px auto 48px;
}
.auth-main.auth-main-wide {
  width: min(540px, 100% - 32px);
}

.auth-card {
  background-color: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 24px 20px;
}

@media (min-width: 480px) {
  .auth-card {
    padding: 28px 26px;
  }
}

.auth-title {
  font-family: var(--font-sport);
  font-weight: 700;
  font-size: 1.875rem;
  line-height: 1.05;
  color: var(--ink);
  margin: 0;
}

.auth-subtitle {
  margin: 6px 0 0;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

/* Badge squadra (logo o monogramma iniziale in font-sport) */
.team-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 18px;
  background-color: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
}

.team-badge-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-control);
  object-fit: cover;
  background-color: var(--surface-0);
  flex-shrink: 0;
}

.team-badge-monogram {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-control);
  background-color: var(--surface-0);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sport);
  font-weight: 800;
  font-size: 1.375rem;
  color: var(--lime);
  flex-shrink: 0;
}

.team-badge-meta {
  min-width: 0;
  flex: 1;
}

.team-badge-label {
  display: block;
  font-family: var(--font-sport);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-muted);
  line-height: 1.1;
}

.team-badge-name {
  display: block;
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* Riquadro account corrente su /join */
.account-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  margin-top: 16px;
  background-color: var(--surface-0);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  font-size: 0.875rem;
}
.account-pill-label {
  color: var(--ink-muted);
  font-size: 0.8125rem;
}
.account-pill-user {
  color: var(--ink);
  font-weight: 600;
}
.account-pill-handle {
  color: var(--ink-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8125rem;
}

/* Avvisi / Flash */
.auth-alert {
  margin-top: 16px;
  padding: 11px 13px;
  border-radius: var(--radius-control);
  border: 1px solid var(--line);
  background-color: var(--surface-2);
  color: var(--ink);
  font-size: 0.875rem;
  line-height: 1.45;
}
.auth-alert-danger {
  border-color: rgba(251, 113, 133, 0.45);
  background-color: rgba(251, 113, 133, 0.1);
  color: var(--danger);
}
.auth-alert-warning {
  border-color: rgba(251, 146, 60, 0.45);
  background-color: rgba(251, 146, 60, 0.1);
  color: var(--warning);
}
.auth-alert-success {
  border-color: rgba(52, 211, 153, 0.45);
  background-color: rgba(52, 211, 153, 0.1);
  color: var(--success);
}
.auth-alert-info {
  border-color: var(--line);
  background-color: var(--surface-2);
  color: var(--ink);
}

/* Sezioni e Campi */
.auth-form {
  margin-top: 20px;
}

.section-label {
  font-family: var(--font-sport);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 22px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.field {
  margin-bottom: 14px;
}

.field-row {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}
@media (min-width: 480px) {
  .field-row-2 {
    grid-template-columns: 1fr 1fr;
  }
  .field-row-7-5 {
    grid-template-columns: 7fr 5fr;
  }
}
.field-row .field {
  margin-bottom: 0;
}

.field-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.field-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-muted);
  margin-bottom: 6px;
}
.field-label-row .field-label {
  margin-bottom: 0;
}

.field-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-muted);
}
.field-link:hover {
  color: var(--ink);
}

.field-input,
.field-select,
.field-textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  background-color: var(--surface-0);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.4;
}
.field-input::placeholder,
.field-textarea::placeholder {
  color: var(--ink-muted);
  opacity: 0.7;
}
.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  border-color: var(--lime);
  outline: 1px solid var(--lime);
}
.field-input[readonly] {
  background-color: var(--surface-2);
  color: var(--ink);
}
.field-input-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.field-hint {
  margin-top: 5px;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

/* Gruppo password con occhio */
.password-wrap {
  display: flex;
  align-items: stretch;
  gap: 6px;
}
.password-wrap .field-input {
  flex: 1;
}
.btn-password-toggle {
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  background-color: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.btn-password-toggle:hover {
  color: var(--ink);
  background-color: var(--line);
}
.btn-password-toggle svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

/* Icona bi-eye / bi-eye-slash disegnata in CSS senza CDN Bootstrap Icons */
.bi {
  display: inline-block;
  width: 18px;
  height: 18px;
  background-color: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}
.bi-eye {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}
.bi-eye-slash {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49'/%3E%3Cpath d='M14.084 14.158a3 3 0 0 1-4.242-4.242'/%3E%3Cpath d='M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143'/%3E%3Cpath d='m2 2 20 20'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49'/%3E%3Cpath d='M14.084 14.158a3 3 0 0 1-4.242-4.242'/%3E%3Cpath d='M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143'/%3E%3Cpath d='m2 2 20 20'/%3E%3C/svg%3E");
}

/* Blocco consenso genitoriale (< 14 anni) */
.guardian-box {
  margin: 16px 0;
  padding: 14px;
  border-radius: var(--radius-control);
  border: 1px solid rgba(251, 146, 60, 0.5);
  background-color: rgba(251, 146, 60, 0.08);
}
.guardian-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--warning);
  margin: 0 0 6px;
}
.guardian-desc {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
}
.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--lime);
  flex-shrink: 0;
}
.checkbox-row label {
  font-size: 0.8125rem;
  color: var(--ink-muted);
  line-height: 1.45;
}

/* Pulsanti */
.btn-primary {
  width: 100%;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-control);
  background-color: var(--lime);
  color: var(--on-lime);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.btn-primary:hover {
  background-color: #d9ff4d;
  text-decoration: none;
}
.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background-color: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}
.btn-secondary:hover {
  background-color: var(--line);
  text-decoration: none;
}

/* Divisore "oppure" */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--ink-muted);
  font-size: 0.8125rem;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--line);
}

/* Piede scheda */
.auth-card-footer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.auth-footer-note {
  margin-top: 16px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

/* Modulo candidatura beta ripiegabile su /login */
.beta-details {
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background-color: var(--surface-0);
}
.beta-details summary {
  cursor: pointer;
  list-style: none;
  min-height: 44px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-muted);
}
.beta-details summary::-webkit-details-marker {
  display: none;
}
.beta-details summary:hover {
  color: var(--ink);
}
.beta-details summary::after {
  content: "+";
  font-family: var(--font-sport);
  font-size: 1.25rem;
  color: var(--lime);
}
.beta-details[open] summary::after {
  content: "\2212";
}
.beta-details-body {
  padding: 14px;
  border-top: 1px solid var(--line);
}

/* Stato password coincidente in reset_password */
.password-match-msg {
  margin-top: 6px;
  font-size: 0.8125rem;
}
.password-match-ok {
  color: var(--success);
}
.password-match-err {
  color: var(--danger);
}
.d-none {
  display: none !important;
}

/* Contenitore largo per documenti legali (privacy e termini) */
.auth-main-legal {
  max-width: 780px;
}

.legal-prose {
  color: var(--ink-muted);
  font-size: 0.9375rem;
  line-height: 1.65;
}
.legal-prose h2 {
  font-family: var(--font-sport);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--lime);
  margin: 24px 0 8px;
}
.legal-prose h2:first-child {
  margin-top: 0;
}
.legal-prose p {
  margin: 0 0 12px;
}
.legal-prose ul {
  margin: 0 0 14px;
  padding-left: 20px;
}
.legal-prose li {
  margin-bottom: 6px;
}
.legal-prose strong,
.legal-prose code {
  color: var(--ink);
}
.legal-prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}

.legal-box {
  background-color: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 16px;
  margin: 16px 0;
}
.legal-box-warning {
  border-color: rgba(251, 146, 60, 0.45);
}
.legal-box-warning h2 {
  color: var(--warning);
  margin-top: 0;
}

/* Badge numerico grande per pagine di errore 400 / 403 / 404 / 500 */
.error-code-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: var(--radius-control);
  background-color: var(--surface-2);
  border: 1px solid var(--line);
  font-family: var(--font-sport);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 0.06em;
  color: var(--lime);
  margin-bottom: 14px;
}
.error-code-danger {
  color: var(--danger);
  border-color: rgba(251, 113, 133, 0.4);
}
.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.error-actions .btn-primary,
.error-actions .btn-secondary {
  flex: 1 1 180px;
}

