/* =====================================================================
   Modulo "Pubblica track day" (pubblica-trackday.php) — prefisso pf-
   Mobile first: campi grandi (≥48px), testo 16px (niente zoom su iOS).
   ===================================================================== */

.pf-body {
  max-width: 46rem;
}

/* --- Come funziona --- */
.pf-steps {
  display: grid;
  gap: 0.6rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  counter-reset: pf-step;
}

.pf-steps li {
  position: relative;
  display: grid;
  gap: 0.15rem;
  padding: 0.85rem 1rem 0.85rem 3.25rem;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: #fff;
  counter-increment: pf-step;
}

.pf-steps li::before {
  content: counter(pf-step);
  position: absolute;
  left: 0.9rem;
  top: 0.85rem;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.875rem;
}

.pf-steps b {
  font-family: var(--font-display);
  font-weight: 800;
}

.pf-steps span {
  color: var(--muted-foreground);
  line-height: 1.45;
}

.pf-gets {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 1rem 1.1rem;
  list-style: none;
  border-radius: var(--r-lg);
  background: var(--brand-6);
  border: 1px solid var(--brand-16);
}

.pf-gets li {
  position: relative;
  padding-left: 1.6rem;
  line-height: 1.45;
}

.pf-gets li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.35rem;
  width: 0.8rem;
  height: 0.45rem;
  border-left: 3px solid var(--brand);
  border-bottom: 3px solid var(--brand);
  transform: rotate(-45deg);
}

/* --- Modulo --- */
.pf-intro,
.pf-help,
.pf-small {
  margin: 0 0 1rem;
  color: var(--muted-foreground);
  line-height: 1.45;
}

.pf-small {
  margin-top: 0.85rem;
  font-size: var(--text-sm);
  text-align: center;
}

.pf-small a,
.pf-check a {
  color: var(--brand-dark);
  font-weight: 600;
}

.pf-opt {
  display: inline-block;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--secondary);
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: 0.1em;
}

.pf-form {
  display: grid;
  gap: 1rem;
}

.pf-card {
  min-width: 0;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: #fff;
  box-shadow: var(--shadow-card);
}

.pf-card:focus {
  outline: none;
}

.pf-legend {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  float: left;
  width: 100%;
  margin: 0 0 1rem;
  padding: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.pf-legend + * {
  clear: both;
}

.pf-num {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.875rem;
}

.pf-field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
  min-width: 0;
}

.pf-field > label,
.pf-label {
  font-weight: 700;
  font-size: 0.9375rem;
}

.pf-form input[type="text"],
.pf-form input[type="email"],
.pf-form input[type="tel"],
.pf-form input[type="url"],
.pf-form input[type="date"],
.pf-form textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid hsl(240, 5%, 78%);
  border-radius: 0.75rem;
  background: #fff;
  color: var(--foreground);
  font: inherit;
  font-size: 16px;
  line-height: 1.3;
  -webkit-appearance: none;
  appearance: none;
}

.pf-form input[type="date"] {
  min-height: 48px;
}

.pf-form input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
}

.pf-form textarea {
  min-height: 7rem;
  resize: vertical;
}

.pf-form input::placeholder,
.pf-form textarea::placeholder {
  color: hsl(240, 4%, 62%);
}

.pf-form input:focus,
.pf-form textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-20);
}

.pf-form [aria-invalid="true"] {
  border-color: #b42318;
  background: #fff7f6;
}

.pf-error {
  display: flex;
  gap: 0.35rem;
  margin: 0;
  color: #b42318;
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.35;
}

.pf-error::before {
  content: "!";
  flex: none;
  display: grid;
  place-items: center;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.1rem;
  border-radius: 999px;
  background: #b42318;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
}

/* --- Righe date --- */
.pf-rows {
  display: grid;
  gap: 0.85rem;
}

.pf-row {
  min-width: 0;
  margin: 0;
  padding: 0.9rem 0.9rem 0.2rem;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: hsl(240, 5%, 98%);
}

.pf-row-title {
  float: left;
  width: 100%;
  margin: 0 0 0.6rem;
  padding: 0;
  font-weight: 800;
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.pf-row-title + * {
  clear: both;
}

.pf-grid {
  display: grid;
  gap: 0 0.75rem;
}

@media (min-width: 380px) {
  .pf-grid--2 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 640px) {
  .pf-grid--price {
    grid-template-columns: 9rem 1fr;
  }

  .pf-card {
    padding: 1.4rem;
  }
}

.pf-grid--2 {
  align-items: end;
}

.pf-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pf-pill {
  position: relative;
  flex: 1 1 auto;
}

.pf-pill input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.pf-pill span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 0.6rem;
  border: 1.5px solid hsl(240, 5%, 78%);
  border-radius: 999px;
  background: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  white-space: nowrap;
}

.pf-pill input:checked + span {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.pf-pill input:focus-visible + span {
  box-shadow: 0 0 0 3px var(--brand-25);
}

.pf-euro {
  position: relative;
}

.pf-euro span {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  font-weight: 700;
  pointer-events: none;
}

.pf-form .pf-euro input {
  padding-left: 2rem;
}

.pf-remove {
  min-height: 44px;
  margin: -0.3rem 0 0.4rem;
  padding: 0 0.25rem;
  border: 0;
  background: none;
  color: #b42318;
  font: inherit;
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.pf-add {
  width: 100%;
  min-height: 52px;
  margin-top: 0.85rem;
  border: 2px dashed var(--brand-55);
  border-radius: var(--r-lg);
  background: var(--brand-6);
  color: var(--brand-dark);
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
}

.pf-add:hover {
  background: var(--brand-10);
}

.pf-max {
  margin: 0.85rem 0 0;
}

[hidden] {
  display: none !important;
}

.pf-alt {
  margin-top: 1.1rem;
  padding: 0.9rem 0.9rem 0.1rem;
  border-radius: var(--r-lg);
  background: hsl(214, 90%, 97%);
  border: 1px solid hsl(214, 80%, 88%);
}

.pf-alt-title {
  margin: 0 0 0.75rem;
  line-height: 1.45;
}

/* --- Privacy --- */
.pf-check {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.75rem;
  border-radius: var(--r-lg);
  background: var(--secondary);
  line-height: 1.45;
}

.pf-check.is-invalid {
  background: #fff1ef;
  outline: 1.5px solid #b42318;
}

.pf-check input {
  flex: none;
  width: 26px;
  height: 26px;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.pf-check label {
  cursor: pointer;
}

.pf-check + .pf-error {
  margin-top: 0.5rem;
}

/* --- Invio --- */
.pf-submit,
.pf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 1.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.0625rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
}

.pf-submit {
  width: 100%;
  text-transform: uppercase;
}

.pf-submit:hover,
.pf-btn:hover {
  background: var(--brand-dark);
}

.pf-submit:disabled {
  opacity: 0.7;
  cursor: progress;
}

.pf-submit:focus-visible,
.pf-btn:focus-visible,
.pf-add:focus-visible,
.pf-remove:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.pf-btn--ghost {
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--foreground);
}

.pf-btn--ghost:hover {
  background: var(--secondary);
}

/* --- Riepilogo errori --- */
.pf-summary {
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
  border-radius: var(--r-lg);
  background: #fff1ef;
  border: 1.5px solid #b42318;
  color: #7a1a10;
}

.pf-summary:focus {
  outline: 3px solid var(--brand-25);
}

.pf-summary h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 800;
}

.pf-summary p {
  margin: 0 0 0.4rem;
}

.pf-summary ul {
  margin: 0;
  padding-left: 1.1rem;
}

.pf-summary li {
  margin: 0.25rem 0;
}

.pf-summary a {
  color: inherit;
  font-weight: 700;
}

/* --- Conferma --- */
.pf-done {
  margin: 0.5rem 0 2rem;
  padding: 1.5rem 1.25rem;
  border-radius: var(--r-xl);
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.pf-done:focus {
  outline: none;
}

.pf-done svg {
  color: #15803d;
}

.pf-done h2 {
  margin: 0.5rem 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.4rem, 6vw, 1.8rem);
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.pf-done p {
  margin: 0 auto 1rem;
  max-width: 32rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

.pf-done-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

/* --- Antispam e lettori di schermo --- */
.pf-hp,
.pf-sr {
  position: absolute !important;
  left: -10000px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
