@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@300;400;500;600;700&family=Barlow+Condensed:wght@700;800&display=swap');

/* ── Reset base ── */
.checkout-checklist-wrapper * {
  box-sizing: border-box;
}

/* ── Wrapper ── */
.checkout-checklist-wrapper {
  max-width: 860px;
  width: 100%;
  margin: 2.5rem auto;
  padding: 0 1.5rem;
  font-family: 'Barlow', sans-serif;
}

/* ── Decorazione trattino ── */
.checkout-checklist-wrapper::before {
  content: '';
  display: block;
  width: 52px;
  height: 5px;
  background: #1a1a2e;
  margin-bottom: 1.25rem;
  border-radius: 2px;
}

/* ── Titolo ── */
.checkout-checklist-wrapper h2.checklist-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 800;
  color: #1a1a2e;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
  line-height: 1.05;
  text-transform: uppercase;
}

.checkout-checklist-wrapper .checklist-subtitle {
  font-size: 1rem;
  color: #6b7280;
  font-weight: 300;
  margin: 0 0 2.5rem;
  line-height: 1.6;
}

/* ── Progress bar ── */
.checklist-progress {
  margin-bottom: 2rem;
}

.checklist-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.6rem;
}

.checklist-progress-meta .prog-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9ca3af;
}

.checklist-progress-meta .prog-count {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a2e;
}

.progress-track {
  height: 7px;
  background: #e5e7eb;
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a90e2 0%, #357abd 100%);
  border-radius: 99px;
  width: 0%;
  transition: width 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Lista voci ── */
.checklist-items-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* ── Singola voce ── */
.checklist-item-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  animation: fadeUp 0.3s ease both;
}

.checklist-item-row:hover {
  border-color: #4a90e2;
  box-shadow: 0 2px 12px rgba(74, 144, 226, 0.1);
}

.checklist-item-row.is-checked {
  border-color: #4a90e2;
  background: #f0f7ff;
}

/* Animazione entrata scalata per item */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Numero ── */
.item-num {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: #d1d5db;
  min-width: 22px;
  transition: color 0.2s;
}

.checklist-item-row.is-checked .item-num {
  color: #4a90e2;
}

/* ── Custom checkbox ── */
.custom-check-box {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 2px solid #d1d5db;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

/* Checkmark SVG inline */
.custom-check-box::after {
  content: '';
  display: block;
  width: 7px;
  height: 12px;
  border-right: 2.5px solid #fff;
  border-bottom: 2.5px solid #fff;
  transform: rotate(45deg) scale(0) translate(-1px, -1px);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.checklist-item-row.is-checked .custom-check-box {
  background: #4a90e2;
  border-color: #4a90e2;
  transform: scale(1.08);
}

.checklist-item-row.is-checked .custom-check-box::after {
  transform: rotate(45deg) scale(1) translate(-1px, -1px);
}

/* ── Testo voce ── */
.item-text {
  flex: 1;
  font-size: 1rem;
  font-weight: 500;
  color: #374151;
  line-height: 1.4;
  transition: color 0.2s;
}

.checklist-item-row.is-checked .item-text {
  color: #1a1a2e;
}

/* ── Nasconde checkbox nativo Drupal ── */
.checklist-item-row input[type="checkbox"] {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
}

/* Nasconde anche label vuota generata da Drupal */
.checklist-item-row label {
  display: none !important;
}

/* ── Footer submit area ── */
.checklist-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
}

.remaining-hint {
  font-size: 0.9rem;
  color: #9ca3af;
  font-weight: 400;
  transition: all 0.3s ease;
}

.remaining-hint.all-done {
  color: #4a90e2;
  font-weight: 600;
}

/* ── Bottone ── */
.checklist-footer input[type="submit"],
.checklist-footer button[type="submit"] {
  font-family: 'Barlow Condensed', sans-serif !important;
  font-weight: 700 !important;
  font-size: 1rem !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  padding: 0.9rem 2.5rem !important;
  border-radius: 10px !important;
  border: none !important;
  background: #1a1a2e !important;
  color: #fff !important;
  cursor: pointer !important;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease !important;
  box-shadow: 0 4px 16px rgba(26, 26, 46, 0.2) !important;
}

.checklist-footer input[type="submit"]:hover:not([disabled]),
.checklist-footer button[type="submit"]:hover:not([disabled]) {
  background: #4a90e2 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 22px rgba(74, 144, 226, 0.35) !important;
}

.checklist-footer input[type="submit"]:active:not([disabled]),
.checklist-footer button[type="submit"]:active:not([disabled]) {
  transform: translateY(0) !important;
}

/* Disabilitato via JS al caricamento, non via attributo HTML */
.checklist-footer input[type="submit"].js-submit-disabled,
.checklist-footer button[type="submit"].js-submit-disabled {
  background: #e5e7eb !important;
  color: #9ca3af !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  pointer-events: none !important;
}
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .checkout-checklist-wrapper {
    padding: 0 1rem;
    margin: 1.5rem auto;
  }

  .checklist-item-row {
    padding: 0.85rem 1rem;
    gap: 0.75rem;
  }

  .item-text {
    font-size: 0.95rem;
  }

  .checklist-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .checklist-footer input[type="submit"],
  .checklist-footer button[type="submit"] {
    width: 100% !important;
    text-align: center !important;
  }

  .remaining-hint {
    text-align: center;
  }
}