/* EquiPro — design system ricavato dal mockup Figma */

:root {
  --green:        #2A5C3F;
  --green-dark:   #234E35;
  --green-ink:    #1A2E1F;
  --green-soft:   #E8F2EC;
  --gold:         #C9A84C;
  --gold-dark:    #A8892F;
  --cream:        #F5F0E8;
  --panel:        #FDFBF7;
  --white:        #FFFFFF;
  --line:         #D4C9B5;
  --line-soft:    #E7DFD1;
  --muted:        #7A6E5F;
  --brown:        #5C4A32;
  --danger:       #9B3B2E;
  --danger-soft:  #FBEDEA;
  --radius:       8px;
  --radius-lg:    12px;
  --sans:  'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --serif: 'Cormorant Garamond', Garamond, Georgia, 'Times New Roman', serif;
  --mono:  'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Senza questa riga una classe con `display: flex` batte per specificità lo
   stile predefinito di [hidden] e l'elemento resta visibile. */
[hidden] { display: none !important; }

body {
  font-family: var(--sans);
  background: var(--cream);
  color: var(--green-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
input, select { font: inherit; color: inherit; }
a { color: inherit; }

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Logo ──────────────────────────────────────────────────────────────── */

/* I due cavalli del marchio: verdi sul chiaro, color crema sul verde. */
.logo { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.logo-mark { height: 44px; width: auto; flex: none; display: block; }
.logo-text {
  font-family: var(--serif);
  font-size: 28px; font-weight: 600; letter-spacing: .03em; line-height: 1;
}

/* ══ PAGINA DI ACCESSO ═════════════════════════════════════════════════ */

.split { display: flex; min-height: 100vh; background: var(--panel); }

/* — lato sinistro: hero — */

.hero {
  position: relative;
  flex: 0 0 58.3%;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  color: var(--cream);
}
.hero-photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: var(--green-ink);
}
.hero-veil {
  position: absolute; inset: 0;
  background: linear-gradient(to top,
    var(--green-ink) 0%,
    rgba(26, 46, 31, 0.80) 50%,
    rgba(26, 46, 31, 0.30) 100%);
}
.hero > .logo, .hero-copy { position: relative; z-index: 1; }
.hero .logo-text { color: var(--cream); }
.hero-copy { max-width: 520px; padding-bottom: 32px; }
.hero-copy .eyebrow { color: var(--cream); opacity: 0.75; }

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(44px, 6vw, 72px);
  line-height: 1.02;
  font-weight: 500;
  margin: 24px 0 20px;
}
.hero h1 em {
  display: block;
  font-style: italic;
  font-weight: 400;
  color: var(--gold);
}
.hero-lead {
  font-size: 17px; font-weight: 300;
  line-height: 1.6;
  max-width: 430px;
  color: rgba(245, 240, 232, 0.92);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid rgba(245, 240, 232, 0.22);
}
.hero-stats dt {
  font-family: var(--serif);
  font-size: 24px; font-weight: 600;
  color: var(--gold);
}
.hero-stats dd {
  font-size: 13px; line-height: 1.4; margin-top: 4px;
  color: rgba(245, 240, 232, 0.8);
}

/* — lato destro: pannello — */

.panel {
  flex: 1;
  background: var(--panel);
  padding: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.panel-inner { width: 100%; max-width: 448px; }
.panel h2 {
  font-family: var(--serif);
  font-size: 36px; font-weight: 600; line-height: 1.12;
  margin: 12px 0 8px;
}
.panel-sub { font-size: 14px; color: var(--muted); line-height: 1.5; }

/* — toggle Accedi / Registrati — */

.tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--cream);
  border-radius: var(--radius);
  padding: 4px;
  margin: 24px 0;
}
.tabs button {
  height: 36px;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 400;
  color: var(--muted);
  transition: background .15s, color .15s, box-shadow .15s;
}
.tabs button[aria-selected="true"] {
  background: var(--white);
  color: var(--green-ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(26, 46, 31, 0.08);
}

/* — campi — */

.field { margin-bottom: 16px; }
.field > label,
.fieldset-label {
  display: block;
  font-size: 12px; font-weight: 600;
  margin-bottom: 6px;
}
.field input,
.field select {
  width: 100%;
  height: 46px;
  padding: 12px 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: #A99E8C; }
.field select {
  appearance: none; -webkit-appearance: none;
  padding-right: 40px; cursor: pointer; color: inherit; font-family: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237A6F5E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
}
.field-hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.field.has-error .field-hint { display: none; }
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(42, 92, 63, 0.12);
}
.field input[aria-invalid="true"],
.field select[aria-invalid="true"] { border-color: var(--danger); }
.field-error {
  display: none;
  font-size: 12px; color: var(--danger); margin-top: 6px;
}
.field.has-error .field-error { display: block; }

/* — consenso a privacy e termini — */

.field > label.consent {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 12.5px; font-weight: 400; line-height: 1.45;
  color: var(--muted); cursor: pointer; margin: 0;
}
.consent input[type="checkbox"] {
  flex: none; width: 17px; height: 17px; padding: 0; margin: 1px 0 0;
  accent-color: var(--green); cursor: pointer;
}
.field.has-error .consent { color: var(--danger); }

/* — scelta del profilo — */

.roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.role {
  min-height: 96px;
  padding: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-align: left;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color .15s, background .15s;
}
.role:hover { border-color: var(--muted); }
.role svg { width: 18px; height: 18px; stroke: var(--green); flex: none; }
.role b { font-size: 12px; font-weight: 600; display: block; }
.role span { font-size: 11px; line-height: 1.35; color: var(--muted); }
.role[aria-pressed="true"] {
  background: var(--green-soft);
  border-color: var(--green);
}
.role:focus-visible, .tabs button:focus-visible {
  outline: 2px solid var(--green); outline-offset: 2px;
}

/* — bottoni — */

.btn-primary {
  width: 100%;
  height: 48px;
  background: var(--green);
  color: var(--cream);
  border-radius: var(--radius);
  font-size: 14px; font-weight: 600;
  transition: background .15s, opacity .15s;
}
.btn-primary:hover:not(:disabled) { background: var(--green-dark); }
.btn-primary:disabled { opacity: .62; cursor: progress; }
.btn-primary:focus-visible { outline: 2px solid var(--green-ink); outline-offset: 2px; }

.switch-line {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.switch-line button {
  color: var(--green);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* — messaggio d'errore generale — */

.alert {
  display: none;
  background: var(--danger-soft);
  border: 1px solid rgba(155, 59, 46, 0.25);
  color: var(--danger);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}
.alert.show { display: block; }

/* ══ AREA RISERVATA ════════════════════════════════════════════════════ */

.topbar {
  background: var(--green-ink);
  color: var(--cream);
  padding: 18px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.topbar .logo-text { color: var(--cream); font-size: 20px; }
.topbar-user { display: flex; align-items: center; gap: 16px; font-size: 13px; }
.topbar-user .who { text-align: right; line-height: 1.3; }
.topbar-user .who b { display: block; font-weight: 600; }
.topbar-user .who span { color: rgba(245, 240, 232, 0.6); font-size: 12px; }
.avatar {
  width: 38px; height: 38px; flex: none;
  border-radius: 50%;
  background: var(--gold);
  color: var(--green-ink);
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 15px;
}
.btn-ghost {
  border: 1px solid rgba(245, 240, 232, 0.3);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 13px;
  color: var(--cream);
  transition: background .15s;
}
.btn-ghost:hover { background: rgba(245, 240, 232, 0.1); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 48px 32px 72px; }

.page-head { margin-bottom: 36px; }
.page-head h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 600; line-height: 1.15;
  margin: 10px 0 8px;
}
.page-head h1 em { font-style: italic; font-weight: 300; color: var(--gold-dark); }
.page-head p { color: var(--muted); font-size: 15px; max-width: 560px; }

.modules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.module {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.module svg { width: 20px; height: 20px; stroke: var(--green); margin-bottom: 12px; }
.module h3 { font-family: var(--serif); font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.module p { font-size: 13px; color: var(--muted); line-height: 1.45; }
.module .tag {
  display: inline-block; margin-top: 12px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold-dark); background: #F7F1DF;
  border-radius: 999px; padding: 3px 8px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
.card-head h2 { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.card-head .count { font-size: 13px; color: var(--muted); }

.add-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--white);
}
.add-row input {
  height: 42px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 14px; background: var(--white);
}
.add-row input:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(42, 92, 63, 0.12);
}
.add-row button {
  height: 42px; padding: 0 20px;
  background: var(--green); color: var(--cream);
  border-radius: var(--radius); font-size: 14px; font-weight: 600;
}
.add-row button:hover:not(:disabled) { background: var(--green-dark); }
.add-row button:disabled { opacity: .6; }

.list { list-style: none; }
.list li {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line-soft);
}
.list li:last-child { border-bottom: none; }
.list .bullet {
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  background: var(--green-soft); color: var(--green);
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 14px;
}
.list .body { flex: 1; min-width: 0; }
.list .body b { font-size: 15px; font-weight: 600; display: block; }
.list .body span { font-size: 13px; color: var(--muted); }
.list .when { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.list .remove {
  font-size: 13px; color: var(--muted);
  padding: 6px 10px; border-radius: var(--radius);
}
.list .remove:hover { background: var(--danger-soft); color: var(--danger); }

.empty { padding: 48px 24px; text-align: center; color: var(--muted); font-size: 14px; }
.empty b { display: block; font-family: var(--serif); font-size: 17px; color: var(--green-ink); margin-bottom: 6px; font-weight: 600; }

.foot-note {
  margin-top: 28px; font-size: 12px; color: var(--muted); text-align: center;
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .hero { display: none; }
  .split { background: var(--cream); }
  .panel { flex: 1; background: var(--cream); padding: 40px 24px; }
  .panel-inner .logo { margin-bottom: 28px; }
}

@media (min-width: 901px) {
  .panel-inner > .logo { display: none; }
}

@media (max-width: 640px) {
  .topbar { padding: 14px 20px; }
  .topbar-user .who { display: none; }
  .wrap { padding: 32px 20px 56px; }
  .roles { grid-template-columns: 1fr; }
  .role { min-height: 0; flex-direction: row; align-items: center; gap: 10px; }
  .role .role-text { display: flex; flex-direction: column; }
  .add-row { grid-template-columns: 1fr; }
  .list li { flex-wrap: wrap; }
  .list .when { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ══ AVVISO DI CONFERMA EMAIL ══════════════════════════════════════════ */

.banner {
  display: flex; align-items: center; gap: 14px;
  background: #FBF4DF;
  border: 1px solid #E8D9A8;
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 28px;
}
.banner-icon {
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  background: var(--gold);
  display: grid; place-items: center;
}
.banner-icon svg { width: 17px; height: 17px; stroke: var(--green-ink); }
.banner-text { flex: 1; min-width: 0; font-size: 13px; line-height: 1.45; color: var(--brown); }
.banner-text b { display: block; font-size: 14px; font-weight: 600; color: var(--green-ink); }
.banner-text #banner-email { font-weight: 600; color: var(--green-ink); }
.banner button {
  flex: none;
  border: 1px solid var(--gold-dark);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 13px; font-weight: 600;
  color: var(--gold-dark);
  transition: background .15s;
}
.banner button:hover:not(:disabled) { background: #F5EACB; }
.banner button:disabled { opacity: .6; cursor: progress; }

/* ══ PAGINA DI CONFERMA ════════════════════════════════════════════════ */

body.centered {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 32px 20px;
  background: var(--cream);
}
.notice {
  width: 100%; max-width: 480px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
}
.notice .logo { justify-content: center; margin-bottom: 28px; }
.notice-icon {
  width: 56px; height: 56px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--green-soft);
}
.notice-icon svg { width: 26px; height: 26px; stroke: var(--green); }
.notice-ko .notice-icon { background: var(--danger-soft); }
.notice-ko .notice-icon svg { stroke: var(--danger); }
.notice h1 {
  font-family: var(--serif);
  font-size: 28px; font-weight: 600; line-height: 1.2;
  margin: 10px 0 12px;
}
.notice-text {
  font-size: 15px; line-height: 1.6; color: var(--muted);
  margin-bottom: 28px;
}
.btn-link {
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
}
.notice-actions { display: flex; flex-direction: column; gap: 10px; }
.notice-secondary {
  background: none; color: var(--muted); font-size: 13.5px;
  text-decoration: underline; text-underline-offset: 2px;
}
.notice-note { font-size: 13px; color: var(--muted); margin: 14px 0 0; min-height: 1em; }

@media (max-width: 640px) {
  .notice { padding: 32px 24px; }
  .banner { flex-wrap: wrap; }
  .banner button { width: 100%; }
}

/* ── Invito da una scuderia, sulla pagina di accesso ───────────────────── */

.invite-card {
  background: var(--green-soft);
  border: 1px solid rgba(42, 92, 63, .22);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin-bottom: 18px;
}
.invite-card .eyebrow { color: var(--green); margin-bottom: 4px; }
.invite-text { font-size: 13.5px; line-height: 1.5; color: var(--green-ink); }
.invite-text b { font-weight: 600; }
