.qfc-widget {
  --qfc-bg: #ffffff;
  --qfc-border: #e8e8e8;
  --qfc-text: #1a1a1a;
  --qfc-text-muted: #9ca3af;
  --qfc-text-disabled: #c4c4c4;
  --qfc-accent: #1a1a1a;
  --qfc-dot: #374151;
  --qfc-selected-border: #1a1a1a;
  --qfc-time-hover: #f3f4f6;
  --qfc-time-selected: #1a1a1a;
  --qfc-btn-disabled-bg: #e5e7eb;
  --qfc-btn-disabled-text: #ffffff;
  --qfc-btn-active-bg: #1a1a1a;
  --qfc-btn-active-text: #ffffff;
  --qfc-radius: 16px;
  --qfc-radius-sm: 10px;

  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  color: var(--qfc-text);
  background: var(--qfc-bg);
  border: 1px solid var(--qfc-border);
  border-radius: var(--qfc-radius);
  padding: 24px;
  max-width: 768px;
  width: 100%;
  margin: 60px auto;
}

.qfc-widget *,
.qfc-widget *::before,
.qfc-widget *::after {
  box-sizing: border-box;
}

/* Header */

.qfc-header {
  margin-bottom: 20px;
}

.qfc-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.qfc-subtitle {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--qfc-text-muted);
}

/* Steps */

.qfc-steps {
  display: flex;
  align-items: center;
  gap: 0;
}

.qfc-step {
  display: flex;
  align-items: center;
  flex: 1;
}

.qfc-step:last-child {
  flex: 0;
}

.qfc-step__circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--qfc-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--qfc-text-muted);
  background: var(--qfc-bg);
  flex-shrink: 0;
}

.qfc-step__circle--active {
  border-color: var(--qfc-accent);
  border-width: 2px;
  color: var(--qfc-accent);
  font-weight: 600;
}

.qfc-step__line {
  flex: 1;
  height: 1.5px;
  background: var(--qfc-border);
  margin: 0 4px;
}

/* Body: calendar + times */

.qfc-body {
  display: flex;
  gap: 0;
  min-height: 280px;
  margin-bottom: 20px;
}

.qfc-calendar-panel {
  flex: 1;
  padding-right: 24px;
}

.qfc-times-panel {
  width: 160px;
  border-left: 1px solid var(--qfc-border);
  padding-left: 24px;
  display: flex;
  flex-direction: column;
}

.qfc-times-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--qfc-text-muted);
  font-size: 14px;
  padding: 20px 0;
}

.qfc-times-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  max-height: 260px;
}

.qfc-time-slot {
  appearance: none;
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-radius: var(--qfc-radius-sm);
  font-size: 15px;
  font-weight: 500;
  color: var(--qfc-text);
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
  border: 1px solid #E5E7EB;
}

.qfc-time-slot:hover {
  background: var(--qfc-time-selected);
  color: var(--qfc-btn-active-text);
}

.qfc-time-slot--selected {
  background: var(--qfc-time-selected);
  color: var(--qfc-btn-active-text);
}

/* Month navigation */

.qfc-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.qfc-month-nav__label {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.qfc-month-nav__btn {
  appearance: none;
  border: none;
  background: transparent;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--qfc-text-muted);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.qfc-month-nav__btn:hover {
  background: var(--qfc-time-hover);
  color: var(--qfc-text);
}

.qfc-month-nav__btn:disabled {
  opacity: 0.3;
  cursor: default;
}

/* Weekday headers */

.qfc-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 8px;
}

.qfc-weekday {
  text-align: center;
  font-size: 13px;
  color: var(--qfc-text-muted);
  font-weight: 400;
  padding: 4px 0;
}

/* Date grid */

.qfc-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px 0;
}

.qfc-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: transparent;
  border-radius: var(--qfc-radius-sm);
  cursor: default;
  padding: 4px;
  position: relative;
}

.qfc-day__num {
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  width: 100%;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--qfc-radius-sm);
  border: 2px solid transparent;
}

.qfc-day--empty {
  visibility: hidden;
}

.qfc-day--disabled .qfc-day__num {
  color: var(--qfc-text-disabled);
}

.qfc-day--weekend.qfc-day--disabled .qfc-day__num {
  color: var(--qfc-text-disabled);
}

.qfc-day--available {
  cursor: pointer;
}

.qfc-day--available .qfc-day__num {
  color: var(--qfc-text);
  font-weight: 500;
}

.qfc-day--available:hover .qfc-day__num {
  background-color: var(--qfc-selected-border);
  color: #fff;
}

.qfc-day--selected .qfc-day__num {
  background-color: var(--qfc-selected-border);
  color: #fff;
}

.qfc-day__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--qfc-dot);
  flex-shrink: 0;
}

/* Footer button */

.qfc-footer {
  margin-top: 4px;
}

.qfc-submit {
  appearance: none;
  width: 100%;
  border: none;
  border-radius: var(--qfc-radius-sm);
  padding: 16px 24px;
  font-size: 15px;
  font-weight: 500;
  cursor: default;
  transition: background 0.15s, opacity 0.15s;
  background: var(--qfc-btn-disabled-bg);
  color: var(--qfc-btn-disabled-text);
}

.qfc-submit--active {
  background: var(--qfc-btn-active-bg);
  color: var(--qfc-btn-active-text);
  cursor: pointer;
}

.qfc-submit--active:hover {
  opacity: 0.88;
}

/* Responsive */

@media (max-width: 560px) {
  .qfc-widget {
    padding: 20px 16px 16px;
  }

  .qfc-body {
    flex-direction: column;
    min-height: auto;
  }

  .qfc-calendar-panel {
    padding-right: 0;
  }

  .qfc-times-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--qfc-border);
    padding-left: 0;
    padding-top: 16px;
    margin-top: 16px;
  }

  .qfc-times-list {
    flex-direction: row;
    flex-wrap: wrap;
    max-height: none;
  }

  .qfc-time-slot {
    flex: 0 0 auto;
  }
}
