/* FreedivingBooking Widget Styles v2 */
/* All classes prefixed with .fb- to avoid conflicts */

.fb-widget {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  color: #1a2a3a;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.5;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

.fb-widget * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ======== Step Progress Indicator ======== */

.fb-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  gap: 0;
}

.fb-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.fb-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  background: #e0e7ee;
  color: #6b7c8d;
  transition: all 0.2s;
}

.fb-step--active .fb-step-dot {
  background: #0e8a7e;
  color: #fff;
}

.fb-step--done .fb-step-dot {
  background: #0e8a7e;
  color: #fff;
}

.fb-step-label {
  font-size: 11px;
  color: #a0adb8;
  white-space: nowrap;
}

.fb-step--active .fb-step-label {
  color: #0e8a7e;
  font-weight: 600;
}

.fb-step--done .fb-step-label {
  color: #0e8a7e;
}

.fb-step-line {
  width: 32px;
  height: 2px;
  background: #e0e7ee;
  margin: 0 4px;
  margin-bottom: 18px;
  transition: background 0.2s;
}

.fb-step-line--done {
  background: #0e8a7e;
}

/* ======== Loading Spinner ======== */

.fb-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
}

.fb-spinner::after {
  content: '';
  width: 32px;
  height: 32px;
  border: 3px solid #e0e7ee;
  border-top-color: #0e8a7e;
  border-radius: 50%;
  animation: fb-spin 0.7s linear infinite;
}

.fb-spinner--small {
  padding: 0;
  display: inline-flex;
}

.fb-spinner--small::after {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

@keyframes fb-spin {
  to { transform: rotate(360deg); }
}

/* ======== Error ======== */

.fb-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  animation: fb-fadeIn 0.2s;
}

@keyframes fb-fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ======== Course Filter Badge ======== */

.fb-filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e6f7f5;
  color: #0e8a7e;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.fb-filter-close {
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.fb-filter-close:hover {
  opacity: 1;
}

/* ======== Calendar ======== */

.fb-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.fb-cal-title {
  font-size: 18px;
  font-weight: 600;
  text-transform: capitalize;
}

.fb-cal-nav {
  background: none;
  border: 1px solid #d1d9e0;
  border-radius: 6px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 18px;
  color: #1a2a3a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.fb-cal-nav:hover {
  background: #f0f4f8;
}

.fb-cal-nav--disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.fb-cal-nav--disabled:hover {
  background: none;
}

.fb-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 12px;
}

.fb-cal-dow {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #6b7c8d;
  padding: 8px 0;
  text-transform: uppercase;
}

.fb-cal-day {
  text-align: center;
  padding: 10px 4px;
  border-radius: 8px;
  font-size: 14px;
  cursor: default;
  color: #a0adb8;
  transition: background 0.15s, color 0.15s;
}

.fb-cal-day--current {
  color: #1a2a3a;
}

.fb-cal-day--available {
  background: #e6f7f5;
  color: #0e8a7e;
  font-weight: 600;
  cursor: pointer;
}

.fb-cal-day--available:hover {
  background: #0e8a7e;
  color: #fff;
}

.fb-cal-day--selected {
  background: #0e8a7e;
  color: #fff;
  font-weight: 600;
}

.fb-cal-day--today {
  box-shadow: inset 0 0 0 2px #0e8a7e;
}

.fb-available-count {
  text-align: center;
  font-size: 13px;
  color: #6b7c8d;
  margin-bottom: 8px;
}

.fb-empty-state {
  text-align: center;
  padding: 24px;
  color: #6b7c8d;
  font-size: 14px;
}

.fb-empty-link {
  display: inline-block;
  margin-top: 8px;
  color: #0e8a7e;
  text-decoration: none;
  font-weight: 500;
}

.fb-empty-link:hover {
  text-decoration: underline;
}

/* ======== Back Button ======== */

.fb-back {
  display: inline-block;
  font-size: 14px;
  color: #0e8a7e;
  cursor: pointer;
  margin-bottom: 16px;
  border: none;
  background: none;
  font-family: inherit;
  padding: 0;
}

.fb-back:hover {
  text-decoration: underline;
}

/* ======== Slot List ======== */

.fb-slots-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.fb-slots-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fb-slot {
  border: 1px solid #d1d9e0;
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.fb-slot:hover {
  border-color: #0e8a7e;
  box-shadow: 0 0 0 1px #0e8a7e;
}

.fb-slot-time {
  font-weight: 600;
  font-size: 15px;
}

.fb-slot-title {
  font-size: 14px;
  color: #4a5a6a;
  margin-top: 2px;
}

.fb-slot-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  font-size: 13px;
  color: #6b7c8d;
  flex-wrap: wrap;
}

.fb-slot-price {
  font-weight: 600;
  color: #0e8a7e;
  font-size: 15px;
}

.fb-slot-location,
.fb-slot-instructor {
  font-size: 13px;
}

.fb-slot-spots {
  margin-top: 6px;
  font-size: 13px;
  color: #6b7c8d;
}

.fb-slot-spots--low {
  color: #d97706;
  font-weight: 600;
}

/* ======== No Slots ======== */

.fb-no-slots {
  text-align: center;
  padding: 20px;
  color: #6b7c8d;
  font-size: 14px;
}

/* ======== Order Summary Card ======== */

.fb-summary {
  border: 1px solid #d1d9e0;
  border-radius: 10px;
  margin-bottom: 20px;
  overflow: hidden;
}

.fb-summary-header {
  background: #f0faf9;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #0e8a7e;
  border-bottom: 1px solid #d1d9e0;
}

.fb-summary-body {
  padding: 12px 16px;
}

.fb-summary-row {
  font-size: 14px;
  color: #4a5a6a;
  padding: 2px 0;
}

.fb-summary-row:first-child {
  font-weight: 600;
  color: #1a2a3a;
  font-size: 15px;
}

/* ======== Booking Form ======== */

.fb-form {
  margin-top: 4px;
}

.fb-field {
  margin-bottom: 14px;
}

.fb-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #4a5a6a;
  margin-bottom: 4px;
}

.fb-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d9e0;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: #1a2a3a;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}

.fb-input:focus {
  border-color: #0e8a7e;
  box-shadow: 0 0 0 2px rgba(14, 138, 126, 0.15);
}

.fb-input::placeholder {
  color: #a0adb8;
}

.fb-input--error {
  border-color: #f87171;
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.15);
}

.fb-select {
  cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b7c8d' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center;
  padding-right: 32px;
}

/* ======== Price Calculation ======== */

.fb-price-calc {
  font-size: 18px;
  font-weight: 700;
  color: #0e8a7e;
  text-align: center;
  padding: 12px 0;
  margin-bottom: 4px;
}

/* ======== Buttons ======== */

.fb-btn-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fb-btn {
  width: 100%;
  padding: 14px;
  background: #0e8a7e;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.fb-btn:hover {
  background: #0b7a6f;
}

.fb-btn:active {
  transform: scale(0.99);
}

.fb-btn:disabled {
  background: #a0adb8;
  cursor: not-allowed;
  transform: none;
}

.fb-btn--outline {
  background: transparent;
  color: #0e8a7e;
  border: 2px solid #0e8a7e;
}

.fb-btn--outline:hover {
  background: #f0faf9;
}

.fb-btn--outline:disabled {
  color: #a0adb8;
  border-color: #a0adb8;
  background: transparent;
}

/* ======== Payment Interstitial ======== */

.fb-interstitial {
  text-align: center;
  padding: 40px 0;
}

.fb-interstitial-text {
  font-size: 18px;
  font-weight: 600;
  margin-top: 8px;
}

.fb-interstitial-sub {
  font-size: 14px;
  color: #6b7c8d;
  margin-top: 8px;
}

.fb-interstitial-amount {
  font-size: 20px;
  font-weight: 700;
  color: #0e8a7e;
  margin-top: 12px;
}

.fb-interstitial-fallback {
  margin-top: 24px;
  font-size: 13px;
  color: #6b7c8d;
  animation: fb-fadeIn 0.3s;
}

.fb-interstitial-fallback a {
  color: #0e8a7e;
}

/* ======== Status Page ======== */

.fb-status {
  text-align: center;
  padding: 24px 0;
}

.fb-status-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.fb-status-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.fb-status-ref {
  font-size: 13px;
  color: #6b7c8d;
  margin-bottom: 16px;
}

.fb-status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

.fb-status-badge--pending {
  background: #fef3c7;
  color: #92400e;
}

.fb-status-badge--paid,
.fb-status-badge--confirmed {
  background: #d1fae5;
  color: #065f46;
}

.fb-status-badge--cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.fb-status-details {
  text-align: left;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  margin: 16px 0;
  font-size: 14px;
  color: #4a5a6a;
  line-height: 1.8;
}

.fb-status-amount {
  font-weight: 600;
  color: #0e8a7e;
  margin-top: 4px;
}

.fb-status-next,
.fb-status-bring {
  text-align: left;
  padding: 12px 16px;
  font-size: 14px;
  color: #4a5a6a;
  line-height: 1.8;
}

.fb-status-next-title {
  font-weight: 600;
  color: #1a2a3a;
  margin-bottom: 4px;
}

.fb-status-contacts {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.fb-contact-btn {
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid #d1d9e0;
  border-radius: 8px;
  color: #1a2a3a;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s;
}

.fb-contact-btn:hover {
  border-color: #0e8a7e;
  background: #f0faf9;
}

.fb-status-waiting {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 14px;
  color: #6b7c8d;
}

.fb-status-error {
  margin-top: 16px;
}

.fb-status-error > div:first-child {
  font-size: 15px;
  color: #991b1b;
  margin-bottom: 12px;
}

.fb-contact-link {
  display: block;
  margin-top: 12px;
  color: #0e8a7e;
  font-size: 14px;
}

/* ======== Responsive ======== */

@media (max-width: 520px) {
  .fb-widget {
    padding: 0 4px;
    font-size: 14px;
  }

  .fb-cal-day {
    padding: 8px 2px;
    font-size: 13px;
  }

  .fb-step-label {
    font-size: 10px;
  }

  .fb-step-dot {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .fb-step-line {
    width: 20px;
  }

  .fb-slot-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  /* Sticky button on mobile */
  .fb-btn-section {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 12px 0;
    margin: 0 -4px;
    padding-left: 4px;
    padding-right: 4px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
    z-index: 10;
  }
}
