/* ============================================================
   Pagina Unisciti (templates/contact.html) — percorso + scheda
   ============================================================ */

.cx {
  --cx-discord: #5865F2;
  --cx-discord-hover: #4752C4;
  --cx-error: #E05252;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 64px;
  align-items: start;
}

.cx-kicker {
  font-family: var(--font-title);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--green-bright);
  margin-bottom: 6px;
}
.cx-heading {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  text-transform: uppercase;
  margin-bottom: 28px;
}

/* ── Percorso ───────────────────────────────────────────────── */
.cx-path { list-style: none; position: relative; margin-bottom: 36px; }
.cx-path::before {                       /* filo che unisce i passi */
  content: '';
  position: absolute;
  left: 21px; top: 24px; bottom: 24px;
  width: 2px;
  background: linear-gradient(to bottom, var(--green-bright), var(--green-dark) 60%, transparent);
  opacity: 0.55;
}
.cx-step {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 18px;
  padding: 0 0 26px;
  animation: cx-rise 0.55s cubic-bezier(.2,.7,.2,1) both;
}
.cx-step:nth-child(2) { animation-delay: 0.08s; }
.cx-step:nth-child(3) { animation-delay: 0.16s; }
.cx-step:nth-child(4) { animation-delay: 0.24s; padding-bottom: 0; }
.cx-step__num {                          /* esagono: è pur sempre uno sciame */
  width: 44px; height: 48px;
  display: grid; place-items: center;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: var(--green-dark);
  color: var(--white);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.05rem;
  position: relative;
  z-index: 1;
}
.cx-step--first .cx-step__num {
  background: var(--green-bright);
  color: var(--bg-main);
  box-shadow: 0 0 22px rgba(77,184,77,0.45);
}
.cx-step__title {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white);
  margin: 4px 0 2px;
}
.cx-step__desc { color: var(--gray-mid); font-size: 0.92rem; line-height: 1.55; }
.cx-step__desc strong { color: var(--gray-light); font-weight: 600; }
.cx-step__cta { margin-top: 12px; }

/* ── Box laterali (requisiti, community) ───────────────────── */
.cx-box {
  border: 1px solid rgba(45,122,45,0.55);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: rgba(26,26,26,0.6);
  animation: cx-rise 0.55s cubic-bezier(.2,.7,.2,1) 0.32s both;
}
.cx-box + .cx-box { margin-top: 16px; animation-delay: 0.4s; }
.cx-box__title {
  font-family: var(--font-title);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green-bright);
  margin-bottom: 10px;
}
.cx-box p { color: var(--gray-light); font-size: 0.9rem; line-height: 1.6; }
.cx-req { list-style: none; display: grid; gap: 8px; }
.cx-req li { display: flex; gap: 10px; color: var(--gray-light); font-size: 0.9rem; }
.cx-req li::before { content: '▸'; color: var(--green-bright); flex-shrink: 0; }

/* ── Scheda ─────────────────────────────────────────────────── */
.cx-sheet {
  position: sticky;
  top: 96px;
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(77,184,77,0.09), transparent 60%),
    var(--bg-card);
  border: 1px solid var(--green-dark);
  border-radius: var(--radius);
  padding: 30px 30px 26px;
  animation: cx-rise 0.6s cubic-bezier(.2,.7,.2,1) 0.12s both;
}
.cx-sheet::before, .cx-sheet::after {    /* angoli da mirino */
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid var(--green-bright);
  pointer-events: none;
}
.cx-sheet::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: var(--radius); }
.cx-sheet::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: var(--radius); }
.cx-sheet__tab {
  position: absolute;
  top: -12px; left: 26px;
  background: var(--bg-main);
  border: 1px solid var(--green-dark);
  border-radius: 3px;
  padding: 2px 10px;
  font-family: var(--font-title);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--green-bright);
}

/* Chi si candida */
.cx-who {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 18px; margin-bottom: 22px;
  border-bottom: 1px dashed rgba(45,122,45,0.6);
}
.cx-who__avatar {
  width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--green-dark);
  flex-shrink: 0;
}
.cx-who__avatar--init {
  display: grid; place-items: center;
  background: var(--green-dark); color: var(--white);
  font-family: var(--font-title); font-weight: 700;
}
.cx-who__label { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gray-mid); }
.cx-who__name  { color: var(--white); font-weight: 600; font-size: 1rem; word-break: break-all; }

/* Campi */
.cx-form { display: grid; gap: 22px; }
.cx-field { display: grid; gap: 8px; border: 0; min-width: 0; }
.cx-label {
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gray-mid);
}
.cx-label em { font-style: normal; color: rgba(136,136,136,0.65); text-transform: none; letter-spacing: 0; font-weight: 400; }
.cx-riot {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 12px 14px;
}
.cx-hint { font-size: 0.75rem; color: var(--gray-mid); line-height: 1.5; }
.cx-hint code { color: var(--green-bright); font-family: inherit; }

/* Ruoli */
.cx-roles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.cx-role input { position: absolute; opacity: 0; pointer-events: none; }
.cx-role span {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 4px 10px;
  border: 1px solid rgba(45,122,45,0.6);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.03);
  color: var(--gray-mid);
  font-family: var(--font-title);
  font-size: 0.82rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition), transform var(--transition);
}
.cx-role span:hover { color: var(--gray-light); border-color: var(--green-bright); }
.cx-role input:checked + span {
  color: var(--green-glow);
  border-color: var(--green-bright);
  background: rgba(77,184,77,0.1);
  box-shadow: inset 0 0 0 1px var(--green-bright);
  transform: translateY(-2px);
}
.cx-role input:focus-visible + span { outline: 2px solid var(--green-glow); outline-offset: 2px; }

.cx-count { justify-self: end; font-size: 0.72rem; color: var(--gray-mid); margin-top: -2px; }
.cx-count.is-over { color: var(--cx-error); }

/* Spunta Discord */
.cx-check {
  display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start;
  padding: 14px 16px;
  border: 1px solid rgba(88,101,242,0.45);
  border-radius: var(--radius);
  background: rgba(88,101,242,0.07);
  cursor: pointer;
}
.cx-check input {
  appearance: none; -webkit-appearance: none;
  width: 22px; height: 22px; margin: 0;
  border: 2px solid var(--cx-discord);
  border-radius: 4px;
  background: transparent;
  display: grid; place-items: center;
  cursor: pointer;
}
.cx-check input::after {
  content: '';
  width: 6px; height: 11px;
  border: solid var(--white);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) translate(-1px, -1px) scale(0);
  transition: transform 0.15s ease;
}
.cx-check input:checked { background: var(--cx-discord); }
.cx-check input:checked::after { transform: rotate(45deg) translate(-1px, -1px) scale(1); }
.cx-check input:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
.cx-check__text { color: var(--gray-light); font-size: 0.9rem; line-height: 1.45; }
.cx-check__text small { display: block; color: var(--gray-mid); font-size: 0.78rem; margin-top: 2px; }

.cx-submit { width: 100%; justify-content: center; min-height: 50px; font-size: 1rem; }
.cx-submit[disabled] { opacity: 0.6; cursor: progress; transform: none; box-shadow: none; }
.cx-legal { color: var(--gray-mid); font-size: 0.75rem; text-align: center; line-height: 1.5; }

/* Pulsante Discord */
.cx-discord {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 22px;
  border-radius: var(--radius);
  background: var(--cx-discord);
  color: var(--white);
  font-weight: 700; font-size: 0.9rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.cx-discord:hover { background: var(--cx-discord-hover); color: var(--white); transform: translateY(-2px); box-shadow: 0 6px 22px rgba(88,101,242,0.35); }
.cx-discord svg { flex-shrink: 0; }
.cx-discord--ghost { background: transparent; border: 1px solid var(--cx-discord); color: #AEB5FF; padding: 9px 16px; font-size: 0.8rem; }
.cx-discord--ghost:hover { background: rgba(88,101,242,0.15); color: var(--white); box-shadow: none; }

/* Stati senza form: login, inviata, già membro */
.cx-state { text-align: center; padding: 18px 4px 6px; }
.cx-state__icon { display: grid; place-items: center; margin: 0 auto 16px; width: 64px; height: 64px; }
.cx-state__title {
  font-size: 1.5rem; text-transform: uppercase;
  margin-bottom: 10px;
}
.cx-state__text { color: var(--gray-light); font-size: 0.95rem; line-height: 1.6; max-width: 380px; margin: 0 auto 22px; }
.cx-state__note { color: var(--gray-mid); font-size: 0.8rem; margin-top: 16px; }
.cx-stamp {
  display: inline-block;
  margin-bottom: 18px;
  padding: 6px 16px;
  border: 2px solid var(--green-bright);
  border-radius: 4px;
  color: var(--green-bright);
  font-family: var(--font-title);
  font-size: 1.1rem; font-weight: 700;
  letter-spacing: 0.25em; text-transform: uppercase;
  transform: rotate(-4deg);
  box-shadow: 0 0 18px rgba(77,184,77,0.25), inset 0 0 12px rgba(77,184,77,0.15);
  animation: cx-stamp 0.45s cubic-bezier(.3,1.6,.5,1) both;
}

@keyframes cx-rise  { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes cx-stamp { from { opacity: 0; transform: rotate(-4deg) scale(1.6); } to { opacity: 1; transform: rotate(-4deg) scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .cx-step, .cx-box, .cx-sheet, .cx-stamp { animation: none; }
}

@media (max-width: 960px) {
  .cx { grid-template-columns: 1fr; gap: 48px; }
  .cx-sheet { position: relative; top: 0; }
}
@media (max-width: 560px) {
  .cx-sheet { padding: 26px 18px 22px; }
  .cx-roles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cx-role span { padding: 12px 4px; }
}
