/* The Cleaner Form — frontend wizard */

.tcf-wizard {
  --tcf-bg: #f7f5f2;
  --tcf-surface: #ffffff;
  --tcf-ink: #1a1f1c;
  --tcf-muted: #5c6b63;
  --tcf-accent: #0f766e;
  --tcf-accent-hover: #0d9488;
  --tcf-border: #d8e0db;
  --tcf-selected: #ccfbf1;
  --tcf-error: #b91c1c;
  --tcf-radius: 12px;
  --tcf-font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem;
  font-family: var(--tcf-font);
  color: var(--tcf-ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(15, 118, 110, 0.08), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 10%, rgba(20, 83, 45, 0.06), transparent 50%),
    var(--tcf-bg);
  border-radius: calc(var(--tcf-radius) + 4px);
  box-sizing: border-box;
}

.tcf-wizard *,
.tcf-wizard *::before,
.tcf-wizard *::after {
  box-sizing: border-box;
}

.tcf-progress {
  height: 6px;
  background: var(--tcf-border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.tcf-progress__bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--tcf-accent), #14b8a6);
  border-radius: inherit;
  transition: width 0.35s ease;
}

.tcf-step-indicator {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  color: var(--tcf-muted);
  letter-spacing: 0.02em;
}

.tcf-form {
  background: var(--tcf-surface);
  border: 1px solid var(--tcf-border);
  border-radius: var(--tcf-radius);
  padding: 1.5rem 1.5rem 1.25rem;
}

.tcf-section-title {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--tcf-ink);
}

.tcf-fieldset {
  border: 0;
  margin: 0 0 1.5rem;
  padding: 0;
}

.tcf-fieldset:last-child {
  margin-bottom: 0.5rem;
}

.tcf-legend {
  display: block;
  width: 100%;
  margin: 0 0 0.75rem;
  padding: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
}

.tcf-req {
  color: var(--tcf-accent);
}

.tcf-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tcf-options--grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.6rem;
}

.tcf-options--inline {
  flex-direction: row;
  flex-wrap: wrap;
}

.tcf-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  padding: 0.85rem 1rem;
  background: #fafbfa;
  border: 1.5px solid var(--tcf-border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.tcf-option:hover {
  border-color: #99b8ae;
  transform: translateY(-1px);
}

.tcf-option:has(input:checked) {
  border-color: var(--tcf-accent);
  background: var(--tcf-selected);
}

.tcf-option input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--tcf-accent);
  flex-shrink: 0;
}

.tcf-option__label {
  font-size: 0.95rem;
  line-height: 1.35;
}

.tcf-other {
  margin-top: 0.6rem;
}

.tcf-input,
.tcf-field input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--tcf-border);
  border-radius: 8px;
  font: inherit;
  color: var(--tcf-ink);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tcf-input:focus,
.tcf-field input:focus {
  outline: none;
  border-color: var(--tcf-accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.tcf-input--qty {
  width: 5rem;
  margin-left: 0.5rem;
}

.tcf-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0;
}

.tcf-field__label {
  display: inline-block;
  line-height: 1.35;
}

.tcf-field__label .tcf-req {
  margin-left: 0.15rem;
}

.tcf-btn--sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

/* Calendar — client availability */
.tcf-calendar {
  border: 1px solid var(--tcf-border);
  border-radius: 12px;
  padding: 0.85rem;
  background: #fafbfa;
  margin-bottom: 1rem;
}

.tcf-calendar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.tcf-calendar__header .tcf-calendar__nav {
  min-width: 2.5rem;
  padding: 0.45rem 0.7rem;
  font-size: 1.25rem;
  line-height: 1;
}

.tcf-calendar__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.tcf-calendar__weekdays,
.tcf-calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
}

.tcf-calendar__weekday {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--tcf-muted);
  padding: 0.25rem 0;
}

.tcf-calendar__cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.9rem;
  border: 0;
  background: transparent;
}

.tcf-calendar__day {
  cursor: pointer;
  background: #fff;
  border: 1.5px solid var(--tcf-border);
  font: inherit;
  color: var(--tcf-ink);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.tcf-calendar__day:hover {
  border-color: #99b8ae;
}

.tcf-calendar__day--selected {
  background: var(--tcf-selected);
  border-color: var(--tcf-accent);
  font-weight: 700;
  color: #0f766e;
}

.tcf-calendar__day--today:not(.tcf-calendar__day--selected) {
  box-shadow: inset 0 0 0 1.5px var(--tcf-accent);
}

.tcf-calendar__day--past {
  opacity: 0.35;
  cursor: not-allowed;
  background: transparent;
  border-color: transparent;
}

.tcf-availability-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tcf-availability-day {
  border: 1px solid var(--tcf-border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: #fff;
}

.tcf-availability-day__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.tcf-availability-day__label {
  font-size: 0.95rem;
}

.tcf-availability-ranges {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

.tcf-availability-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.tcf-availability-range input[type="time"] {
  width: auto;
  min-width: 7.5rem;
}

.tcf-availability-range__sep {
  color: var(--tcf-muted);
  font-weight: 600;
}

.tcf-availability-empty {
  margin-top: 0.5rem;
}

.tcf-narrative {
  margin: 0 0 1rem;
  padding: 0.95rem 1.1rem;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 10px;
  color: #134e4a;
  font-size: 0.95rem;
  line-height: 1.55;
}

/* Submit overlay */
.tcf-submitting {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(247, 245, 242, 0.92);
  backdrop-filter: blur(5px);
  border-radius: inherit;
  padding: 1.5rem;
}

.tcf-submitting[hidden] {
  display: none !important;
}

.tcf-wizard {
  position: relative;
}

.tcf-submitting__card {
  width: min(100%, 380px);
  text-align: center;
  background: #fff;
  border: 1px solid var(--tcf-border);
  border-radius: 16px;
  padding: 1.75rem 1.5rem 1.35rem;
  box-shadow: 0 12px 40px rgba(26, 31, 28, 0.1);
}

.tcf-submitting__icon {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
  min-height: 48px;
}

.tcf-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid #ccfbf1;
  border-top-color: var(--tcf-accent);
  border-radius: 50%;
  animation: tcf-spin 0.8s linear infinite;
}

@keyframes tcf-spin {
  to {
    transform: rotate(360deg);
  }
}

.tcf-status-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  animation: tcf-pop 0.35s ease;
}

.tcf-status-icon--ok {
  background: #ccfbf1;
  color: #0f766e;
}

.tcf-status-icon--error {
  background: #fee2e2;
  color: #b91c1c;
}

@keyframes tcf-pop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.tcf-submitting__title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.tcf-submitting__sub {
  margin: 0 0 1.25rem;
  font-size: 0.85rem;
  color: var(--tcf-muted);
}

.tcf-submitting__steps {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
  text-align: left;
}

.tcf-submitting__steps li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  font-size: 0.92rem;
  color: #9aa8a1;
  border-radius: 10px;
  transition: color 0.2s ease, background 0.2s ease;
}

.tcf-check {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  border: 2px solid #d8e0db;
  background: #fff;
  position: relative;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.tcf-check::after {
  content: "";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tcf-submitting__steps li.is-pending .tcf-check {
  border-color: #d8e0db;
}

.tcf-submitting__steps li.is-active {
  color: var(--tcf-ink);
  background: #f0fdfa;
  font-weight: 600;
}

.tcf-submitting__steps li.is-active .tcf-check {
  border-color: var(--tcf-accent);
  border-top-color: transparent;
  animation: tcf-spin 0.7s linear infinite;
}

.tcf-submitting__steps li.is-done {
  color: #0f766e;
  font-weight: 600;
}

.tcf-submitting__steps li.is-done .tcf-check {
  border-color: #0f766e;
  background: #0f766e;
}

.tcf-submitting__steps li.is-done .tcf-check::after {
  content: "✓";
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.35rem;
  text-align: center;
}

.tcf-submitting__steps li.is-error {
  color: #b91c1c;
  background: #fef2f2;
  font-weight: 600;
}

.tcf-submitting__steps li.is-error .tcf-check {
  border-color: #b91c1c;
  background: #b91c1c;
}

.tcf-submitting__steps li.is-error .tcf-check::after {
  content: "!";
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.35rem;
  text-align: center;
}

.tcf-submitting__error {
  margin: 0.85rem 0 0.5rem;
  padding: 0.75rem 0.9rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  color: #b91c1c;
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: left;
}

.tcf-submitting__close {
  margin-top: 0.85rem;
  width: 100%;
}

.tcf-submitting.is-success .tcf-submitting__title {
  color: #0f766e;
}

.tcf-submitting.is-failed .tcf-submitting__title {
  color: #b91c1c;
}

.tcf-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.tcf-mattress-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tcf-mattress-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--tcf-border);
  border-radius: 10px;
  background: #fafbfa;
}

.tcf-option--mattress {
  flex: 1 1 220px;
  border: 0;
  background: transparent;
  padding: 0.4rem;
}

.tcf-option--mattress:hover {
  transform: none;
}

.tcf-mattress-qty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.tcf-mattress-qty label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--tcf-muted);
}

.tcf-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-height: 220px;
  overflow-y: auto;
  padding: 0.15rem;
}

.tcf-date-chip {
  appearance: none;
  border: 1.5px solid var(--tcf-border);
  background: #fff;
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  font: inherit;
  color: var(--tcf-ink);
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.tcf-date-chip:hover {
  border-color: #99b8ae;
}

.tcf-date-chip.is-active {
  border-color: var(--tcf-accent);
  background: var(--tcf-selected);
  font-weight: 600;
}

.tcf-date-chip__label {
  font-size: 0.9rem;
}

.tcf-hint {
  margin: 0;
  color: var(--tcf-muted);
  font-size: 0.9rem;
}

.tcf-loading {
  color: var(--tcf-muted);
}

.tcf-summary {
  margin: 0 0 1rem;
  padding: 0;
  border: 1px solid var(--tcf-border);
  border-radius: 10px;
  overflow: hidden;
}

.tcf-summary-row {
  display: grid;
  grid-template-columns: minmax(140px, 38%) 1fr;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--tcf-border);
  margin: 0;
}

.tcf-summary-row:nth-child(odd) {
  background: #f8faf9;
}

.tcf-summary-row:last-child {
  border-bottom: 0;
}

.tcf-summary-row dt {
  margin: 0;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--tcf-muted);
}

.tcf-summary-row dd {
  margin: 0;
  font-size: 0.95rem;
}

.tcf-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--tcf-border);
}

.tcf-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.tcf-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.tcf-btn--primary {
  margin-left: auto;
  background: var(--tcf-accent);
  color: #fff;
}

.tcf-btn--primary:hover:not(:disabled) {
  background: var(--tcf-accent-hover);
}

.tcf-btn--ghost {
  background: transparent;
  color: var(--tcf-muted);
  border: 1.5px solid var(--tcf-border);
}

.tcf-btn--ghost:hover {
  color: var(--tcf-ink);
  border-color: #99b8ae;
}

.tcf-error {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: var(--tcf-error);
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .tcf-wizard {
    padding: 1rem;
  }

  .tcf-form {
    padding: 1.1rem;
  }

  .tcf-grid-2 {
    grid-template-columns: 1fr;
  }

  .tcf-summary-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .tcf-options--grid {
    grid-template-columns: 1fr 1fr;
  }
}
