/*
 * Portale assistenza pubblica — estensione leggera di app.css (token NEXT condivisi).
 * Una card, niente palette custom, niente box dentro box.
 */

body.assist-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 24px 16px 0;
}

.assist-shell {
  width: min(720px, 100%);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 24px;
}

.assist-logo {
  text-align: center;
  margin-bottom: 16px;
}

.assist-logo-link {
  display: inline-block;
  text-decoration: none;
  line-height: 0;
}

@media (hover: hover) and (pointer: fine) {
  .assist-logo-link:hover {
    opacity: 0.88;
  }
}

.assist-logo img {
  width: min(260px, 62vw);
  max-height: 56px;
  object-fit: contain;
}

.assist-card.card {
  padding: 22px 20px 20px;
}

.assist-head {
  text-align: center;
  margin-bottom: 16px;
}

.assist-head .assist-page-title {
  color: var(--text);
  font-size: clamp(26px, 4vw, 32px);
}

.assist-page-title {
  margin: 0;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: clamp(30px, 4.5vw, 38px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--danger);
}

.assist-page--hub .assist-page-title {
  color: var(--danger);
}

.assist-welcome,
.assist-wizard-lead,
.assist-review-intro,
.assist-qr-lead,
.assist-qr-footnote {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  max-width: 48ch;
}

.assist-wizard-lead {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.assist-head .assist-welcome {
  margin-left: auto;
  margin-right: auto;
}

.assist-lottie {
  width: 140px;
  height: 140px;
  margin: 0 auto 8px;
}

.assist-lottie-check {
  width: 120px;
  height: 120px;
}

/* Scelte hub */
.assist-choices {
  display: grid;
  gap: 12px;
}

@media (min-width: 640px) {
  .assist-choices {
    grid-template-columns: 1fr 1fr;
  }
}

.assist-choice {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 88px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border-soft);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow), var(--glass-highlight);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.18s ease;
}

@media (hover: hover) and (pointer: fine) {
  .assist-choice:hover {
    transform: scale(1.02);
    border-color: var(--glass-border);
  }
}

.assist-welcome--hub {
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.assist-welcome--hub strong {
  color: var(--text);
  font-weight: 700;
}

.assist-choice img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
}

.assist-choice--cliente {
  border-color: rgba(125, 224, 164, 0.5);
}

.assist-choice--cliente strong {
  color: var(--ok-ink);
}

.assist-choice--guest {
  border-color: rgba(210, 10, 16, 0.45);
}

.assist-choice--guest strong {
  color: var(--danger-ink);
}

.assist-choice--guest > span > span {
  color: var(--muted);
}

.assist-choice strong {
  display: block;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 22px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  line-height: 1.05;
}

.assist-choice span {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  color: var(--muted);
}

/* Form */
.assist-card label {
  display: block;
  margin: 12px 0 4px;
  font-size: 13px;
  color: var(--muted);
}

.assist-card label.req::after {
  content: " *";
  color: var(--danger);
}

.assist-required-note {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
}

.assist-req-mark {
  color: var(--danger);
  font-weight: 700;
}

.assist-privacy {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

.assist-privacy input {
  flex-shrink: 0;
  width: auto;
  margin-top: 3px;
}

.assist-privacy.req > span::after {
  content: " *";
  color: var(--danger);
}

/* Checkbox accetta condizioni nello step 4 — leggermente più distinta */
.assist-terms-box {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--btn-radius);
  border: 1px solid rgba(125, 224, 164, 0.32);
  background: rgba(31, 157, 85, 0.06);
}

.assist-terms-box .assist-privacy {
  margin-top: 0;
}

/* Toast bozza ripristinata */
.assist-draft-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: var(--btn-radius);
  border: 1px solid rgba(125, 224, 164, 0.4);
  background: rgba(31, 157, 85, 0.1);
  font-size: 13px;
  color: var(--ok-ink);
  animation: assist-toast-in 0.25s ease;
}

.assist-draft-toast-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

@keyframes assist-toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Banner "riprendi" nella hub — fuori dalla card */
#assistResumeBanner {
  width: min(720px, 100%);
  margin: 10px auto 0;
}

.assist-resume-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--btn-radius);
  border: 1px solid rgba(125, 224, 164, 0.4);
  background: rgba(31, 157, 85, 0.07);
  text-decoration: none;
  color: var(--ok-ink);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}

@media (hover: hover) and (pointer: fine) {
  .assist-resume-banner:hover {
    background: rgba(31, 157, 85, 0.13);
    border-color: rgba(125, 224, 164, 0.6);
  }
}

.assist-resume-banner-text {
  flex: 1;
  line-height: 1.35;
}

.assist-resume-banner-sub {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
}

.assist-privacy a,
.assist-legal-notice a,
.assist-condizioni-contact a {
  color: var(--ok-ink);
  font-weight: 600;
  text-underline-offset: 3px;
}

.assist-legal-notice {
  margin: 14px 0 0;
  padding: 11px 13px 11px 15px;
  border-radius: var(--btn-radius);
  border: 1px solid rgba(210, 10, 16, 0.28);
  border-left: 3px solid var(--danger);
  background: rgba(210, 10, 16, 0.06);
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.assist-legal-notice strong {
  color: var(--text);
  font-weight: 700;
}

.assist-shell--wide {
  width: min(820px, 100%);
}

.assist-page-title--condizioni {
  font-size: clamp(24px, 4vw, 30px);
}

.assist-condizioni {
  text-align: left;
}

.assist-condizioni-intro {
  margin-bottom: 18px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.assist-condizioni-intro p {
  margin: 0 0 10px;
}

.assist-legal-notice--page {
  margin-top: 12px;
}

.assist-condizioni-block {
  margin-bottom: 14px;
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.assist-condizioni-heading {
  margin: 0;
  padding: 10px 14px;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--line-faint);
}

.assist-condizioni-heading--dark {
  background: var(--black-soft);
  color: #fff;
  border-bottom: 0;
}

.assist-condizioni-block p {
  margin: 0;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
}

.assist-condizioni-block p + p {
  border-top: 1px solid var(--line-faint);
}

.assist-condizioni-fees {
  display: grid;
  gap: 0;
}

@media (min-width: 560px) {
  .assist-condizioni-fees {
    grid-template-columns: 1fr 1fr;
  }
}

.assist-condizioni-fee {
  padding: 14px;
  border-top: 1px solid var(--line-faint);
}

@media (min-width: 560px) {
  .assist-condizioni-fee:first-child {
    border-right: 1px solid var(--line-faint);
  }
}

.assist-condizioni-fee-amount {
  margin: 0 0 6px;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--danger);
  line-height: 1;
}

.assist-condizioni-fee-title {
  margin: 0 0 8px;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}

.assist-condizioni-fee-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.assist-condizioni-contact {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-left: 4px solid var(--danger);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.assist-condizioni-version {
  margin: 12px 0 0;
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}

.assist-actions--single {
  margin-top: 18px;
}

.assist-actions--single .btn {
  flex: none;
  width: 100%;
}

.assist-actions--condizioni-back {
  flex-direction: column;
}

.assist-file-note {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.assist-grid {
  display: grid;
  gap: 12px 14px;
}

@media (min-width: 560px) {
  .assist-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.assist-page .assist-card input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.assist-page .assist-card select,
.assist-page .assist-card textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border-radius: var(--btn-radius);
  border: 1px solid var(--glass-border-soft);
  background: var(--glass-bg-input);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
  font-family: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.assist-page .assist-card textarea {
  min-height: 120px;
  resize: vertical;
  padding-top: 12px;
}

.assist-page .assist-card input::placeholder,
.assist-page .assist-card textarea::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.assist-page .assist-card input[readonly] {
  opacity: 0.88;
  border-style: dashed;
}

.assist-page .assist-card input[type="file"] {
  min-height: auto;
  padding: 10px 12px;
  font-size: 14px;
}

.assist-page .assist-card select {
  cursor: pointer;
}

.assist-page .assist-card input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.assist-page .assist-card select:focus,
.assist-page .assist-card textarea:focus {
  outline: none;
  border-color: rgba(125, 224, 164, 0.55);
  box-shadow: 0 0 0 3px rgba(31, 157, 85, 0.18);
}

.assist-section {
  margin: 0 0 14px;
  padding-left: 10px;
  border-left: 3px solid var(--danger);
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 22px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text);
}

.assist-wizard-prelead {
  margin: 0 0 4px;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text);
}

/* Timeline — nessun contenitore, solo step */
.assist-wizard {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  background: none;
}

.assist-wizard-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  position: relative;
}

.assist-wizard-track::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 13px;
  height: 1px;
  background: var(--line);
  z-index: 0;
}

.assist-wizard-step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.assist-wizard-dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  box-shadow: 0 0 0 3px var(--surface-solid);
  color: var(--muted);
}

.assist-wizard-step.is-active .assist-wizard-dot,
.assist-wizard-step.is-done .assist-wizard-dot {
  border-color: var(--ok);
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--surface-solid);
  color: #fff;
}

.assist-wizard-step.is-active .assist-wizard-dot {
  transform: scale(1.06);
}

.assist-wizard-step.is-active .assist-wizard-label,
.assist-wizard-step.is-done .assist-wizard-label {
  color: var(--ok-ink);
  font-weight: 600;
}

.assist-wizard-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.assist-wizard-pane {
  display: block;
}

.assist-wizard-pane[hidden] {
  display: none !important;
}

/* Bottoni — stesso linguaggio di guide.css / app.css */
.assist-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.assist-page button,
.assist-page a.btn {
  flex: 1;
  min-height: 44px;
  border-radius: var(--btn-radius);
  padding: 0 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  touch-action: manipulation;
}

.assist-page a.btn.secondary,
.assist-page button.secondary {
  background: var(--btn-secondary-bg);
  border-color: var(--glass-border);
  color: var(--btn-secondary-ink);
  box-shadow: none;
}

.assist-page button.confirm,
.assist-page a.btn.confirm,
.assist-page button.primary,
.assist-page a.btn.primary {
  border: 1px solid rgba(125, 224, 164, 0.42);
  background: linear-gradient(
    145deg,
    rgba(125, 224, 164, 0.22) 0%,
    rgba(31, 157, 85, 0.14) 48%,
    rgba(16, 70, 42, 0.2) 100%
  );
  color: var(--chip-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 8px 20px rgba(9, 22, 15, 0.32);
}

@media (hover: hover) and (pointer: fine) {
  .assist-page button.confirm:hover,
  .assist-page a.btn.confirm:hover,
  .assist-page button.primary:hover,
  .assist-page a.btn.primary:hover {
    transform: scale(1.02);
  }
}

.assist-error,
.assist-ok,
.assist-hint {
  margin-top: 10px;
  border-radius: var(--btn-radius);
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.4;
}

.assist-error {
  display: none;
  border: 1px solid rgba(210, 10, 16, 0.55);
  background: rgba(210, 10, 16, 0.16);
  color: var(--danger-ink);
}

.assist-ok {
  display: none;
  border: 1px solid rgba(31, 157, 85, 0.45);
  background: rgba(31, 157, 85, 0.14);
  color: var(--ok-ink);
}

.assist-hint {
  display: none;
  border: 1px solid var(--line);
  color: var(--muted);
}

.assist-hint.ok-hint {
  border-color: rgba(31, 157, 85, 0.45);
  color: var(--ok-ink);
}

.assist-review {
  margin: 0;
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.assist-review-row {
  display: grid;
  grid-template-columns: minmax(110px, 34%) 1fr;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-faint);
}

.assist-review-row:last-child {
  border-bottom: 0;
}

.assist-review dt {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.assist-review dd {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  word-break: break-word;
}

.assist-thanks {
  text-align: center;
}

.assist-thanks h2 {
  margin: 0 0 8px;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 28px;
  text-transform: uppercase;
  color: var(--text);
}

.assist-thanks p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.assist-page .app-platform-footer {
  width: 100%;
  margin-top: auto;
}

.brand-box {
  position: relative;
}

.brand-list {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--radius-lg);
  background: var(--surface-solid);
  box-shadow: var(--glass-shadow);
}

.brand-list button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line-faint);
  background: transparent;
  color: var(--text);
  font-size: 15px;
  padding: 10px 12px;
  cursor: pointer;
}

.brand-list button:last-child {
  border-bottom: 0;
}

.brand-list button.is-other {
  color: var(--ok-ink);
  font-weight: 700;
}

/* QR hint — layout piatto */
.assist-qr-hint {
  text-align: center;
}

.assist-qr-hint .assist-section {
  text-align: center;
}

.assist-qr-lead,
.assist-qr-footnote,
.assist-qr-steps {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  max-width: 46ch;
}

.assist-qr-steps {
  list-style-position: inside;
  padding-left: 0;
}

.assist-qr-visual {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin: 14px 0;
  padding: 12px 0;
  border-top: 1px solid var(--line-faint);
  border-bottom: 1px solid var(--line-faint);
}

.assist-qr-machine {
  position: relative;
  flex-shrink: 0;
  width: min(130px, 36vw);
  color: var(--muted);
}

.assist-qr-frame {
  width: 100%;
  height: auto;
  display: block;
}

.assist-qr-arrow {
  flex-shrink: 0;
  color: var(--muted);
  opacity: 0.6;
}

.assist-qr-plate {
  position: absolute;
  left: 47%;
  top: 52%;
  width: 26%;
  aspect-ratio: 1;
  background: #fff;
  border-radius: 2px;
}

.assist-qr-on-machine {
  position: absolute;
  inset: 10%;
  color: #1d1d1b;
}

.assist-qr-phone {
  flex-shrink: 0;
  width: min(100px, 28vw);
  aspect-ratio: 9 / 18;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 6px;
  background: var(--black-soft);
}

.assist-qr-viewfinder {
  position: relative;
  height: 100%;
  border-radius: 8px;
  background: #090909;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.assist-qr-in-phone {
  width: 50%;
  color: #fff;
}

.assist-qr-scanline {
  position: absolute;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--ok);
  animation: assist-qr-scan 1.1s linear infinite;
}

.assist-qr-corner {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.7);
}

.assist-qr-corner.c1 {
  top: 8px;
  left: 8px;
  border-right: 0;
  border-bottom: 0;
}

.assist-qr-corner.c2 {
  top: 8px;
  right: 8px;
  border-left: 0;
  border-bottom: 0;
}

.assist-qr-corner.c3 {
  bottom: 8px;
  left: 8px;
  border-right: 0;
  border-top: 0;
}

.assist-qr-corner.c4 {
  bottom: 8px;
  right: 8px;
  border-left: 0;
  border-top: 0;
}

@keyframes assist-qr-scan {
  0% {
    top: 16%;
    opacity: 0.3;
  }
  100% {
    top: 78%;
    opacity: 0.3;
  }
}

.assist-qr-steps {
  margin: 0 0 14px;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.assist-qr-back {
  margin: 10px 0 0;
  text-align: center;
}

.assist-link-btn {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: var(--ok-ink);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 520px) {
  .assist-wizard-label {
    font-size: 9px;
  }

  .assist-review-row {
    grid-template-columns: 1fr;
  }

  .assist-qr-visual {
    gap: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .assist-qr-scanline {
    animation: none;
  }

  .assist-choice:hover {
    transform: none;
  }
}
