.flex-appt-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(11, 26, 46, 0.55);
  backdrop-filter: blur(4px);
}

.flex-appt-overlay.is-open {
  display: flex;
}

.flex-appt-modal {
  width: min(920px, 100%);
  max-height: min(92vh, 900px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(11, 26, 46, 0.28);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  color: #0b1a2e;
}

.flex-appt-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 16px;
  border-bottom: 1px solid #e8edf3;
}

.flex-appt-header h2 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.flex-appt-header p {
  margin: 0;
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.45;
}

.flex-appt-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: #f1f5f9;
  color: #475569;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.flex-appt-close:hover {
  background: #e2e8f0;
}

.flex-appt-body {
  overflow-y: auto;
  padding: 20px 28px 28px;
}

.flex-appt-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}

.flex-appt-section-title {
  margin: 0 0 12px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.flex-appt-calendar {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  background: #f8fafc;
}

.flex-appt-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.flex-appt-cal-nav button {
  border: none;
  background: #fff;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: #334155;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.flex-appt-cal-nav span {
  font-weight: 600;
  font-size: 0.95rem;
}

.flex-appt-weekdays,
.flex-appt-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.flex-appt-weekdays span {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: #94a3b8;
  padding: 4px 0;
}

.flex-appt-day {
  aspect-ratio: 1;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 0.82rem;
  color: #334155;
  cursor: pointer;
}

.flex-appt-day:hover:not(:disabled) {
  background: #e2e8f0;
}

.flex-appt-day.is-selected {
  background: #0b1a2e;
  color: #fff;
}

.flex-appt-day:disabled {
  color: #cbd5e1;
  cursor: not-allowed;
}

.flex-appt-slots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

@media (min-width: 640px) {
  .flex-appt-slots {
    grid-template-columns: repeat(3, 1fr);
  }
}

.flex-appt-slot {
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  padding: 10px 8px;
  background: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0b1a2e;
  cursor: pointer;
}

.flex-appt-slot:hover {
  border-color: #0b1a2e;
}

.flex-appt-slot.is-selected {
  background: #0b1a2e;
  border-color: #0b1a2e;
  color: #fff;
}

.flex-appt-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}

.flex-appt-form .full {
  grid-column: 1 / -1;
}

.flex-appt-field label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
}

.flex-appt-field input,
.flex-appt-field select,
.flex-appt-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.9rem;
  color: #0b1a2e;
  background: #fff;
}

.flex-appt-field textarea {
  min-height: 72px;
  resize: vertical;
}

.flex-appt-field input:focus,
.flex-appt-field select:focus,
.flex-appt-field textarea:focus {
  outline: 2px solid rgba(11, 26, 46, 0.15);
  border-color: #0b1a2e;
}

.flex-appt-hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.flex-appt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e8edf3;
}

.flex-appt-summary {
  font-size: 0.85rem;
  color: #64748b;
}

.flex-appt-summary strong {
  color: #0b1a2e;
}

.flex-appt-submit {
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  background: linear-gradient(135deg, #0b1a2e 0%, #1e3a5f 100%);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.flex-appt-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.flex-appt-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.88rem;
}

.flex-appt-success {
  text-align: center;
  padding: 56px 28px 48px;
}

.flex-appt-success-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  font-size: 2rem;
  line-height: 72px;
}

.flex-appt-success h3 {
  margin: 0 0 10px;
  font-size: 1.6rem;
  color: #0b1a2e;
}

.flex-appt-success p {
  margin: 0 auto 24px;
  max-width: 420px;
  color: #64748b;
  line-height: 1.6;
}

.flex-appt-success-summary {
  display: inline-block;
  margin-bottom: 24px;
  padding: 12px 18px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #0b1a2e;
  font-weight: 600;
}

.flex-appt-success-close {
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  background: #0b1a2e;
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 768px) {
  .flex-appt-overlay {
    align-items: flex-start;
    padding: 10px;
    overflow-y: auto;
  }

  .flex-appt-modal {
    width: 100%;
    max-height: none;
    margin: 0;
    border-radius: 14px;
  }

  .flex-appt-header {
    gap: 10px;
    padding: 18px 16px 12px;
  }

  .flex-appt-header h2 {
    font-size: 1.25rem;
    line-height: 1.2;
  }

  .flex-appt-header p {
    font-size: 0.88rem;
  }

  .flex-appt-body {
    padding: 16px;
  }

  .flex-appt-grid,
  .flex-appt-form {
    grid-template-columns: 1fr;
  }

  .flex-appt-grid {
    gap: 18px;
  }

  .flex-appt-slots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .flex-appt-submit {
    width: 100%;
  }

  .flex-appt-success {
    padding: 36px 18px 32px;
  }

  .flex-appt-success-summary {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 380px) {
  .flex-appt-overlay {
    padding: 6px;
  }

  .flex-appt-body {
    padding: 12px;
  }

  .flex-appt-calendar {
    padding: 10px;
  }

  .flex-appt-weekdays,
  .flex-appt-days {
    gap: 2px;
  }

  .flex-appt-day {
    border-radius: 7px;
    font-size: 0.78rem;
  }

  .flex-appt-slots {
    grid-template-columns: 1fr;
  }
}
