/* ============================================================
   RLabs Booking Pro — Public Widget Styles
   ============================================================ */

:root {
  --rlb-primary:       #1A56DB;
  --rlb-primary-light: #1A56DB18;
  --rlb-radius:        10px;
  --rlb-shadow:        0 4px 24px rgba(0,0,0,.08);
  --rlb-border:        #E5E7EB;
  --rlb-text:          #111827;
  --rlb-muted:         #6B7280;
  --rlb-bg:            #F9FAFB;
  --rlb-white:         #ffffff;
  --rlb-success:       #059669;
  --rlb-error:         #DC2626;
  --rlb-font:          -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Container ─────────────────────────────────────────────── */

.rlb-widget {
  font-family: var(--rlb-font);
  color: var(--rlb-text);
  max-width: 680px;
  margin: 0 auto;
  background: var(--rlb-white);
  border-radius: var(--rlb-radius);
  box-shadow: var(--rlb-shadow);
  border: 1px solid var(--rlb-border);
  overflow: hidden;
}

/* ── Step indicator ────────────────────────────────────────── */

.rlb-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 24px 0;
  gap: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.rlb-step {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 6px;
}

.rlb-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--rlb-border);
  background: var(--rlb-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--rlb-muted);
  transition: all .2s;
  flex-shrink: 0;
}

.rlb-step.active .rlb-step-dot {
  border-color: var(--rlb-primary);
  background: var(--rlb-primary);
  color: #fff;
}

.rlb-step.done .rlb-step-dot {
  border-color: var(--rlb-success);
  background: var(--rlb-success);
  color: #fff;
}

.rlb-step-label {
  font-size: 11px;
  color: var(--rlb-muted);
  font-weight: 500;
  white-space: nowrap;
}

.rlb-step.active .rlb-step-label { color: var(--rlb-primary); font-weight: 600; }
.rlb-step.done  .rlb-step-label  { color: var(--rlb-success); }

.rlb-step-line {
  width: 24px;
  height: 2px;
  background: var(--rlb-border);
  margin: 0 4px;
  transition: background .2s;
}
.rlb-step-line.done { background: var(--rlb-success); }

/* ── Panel ─────────────────────────────────────────────────── */

.rlb-panel {
  padding: 24px;
}

.rlb-panel-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--rlb-text);
  margin: 0 0 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rlb-border);
}

/* ── Error ─────────────────────────────────────────────────── */

.rlb-error {
  background: #FEF2F2;
  border-left: 4px solid var(--rlb-error);
  color: var(--rlb-error);
  padding: 10px 16px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  cursor: pointer;
}

/* ── Spinner ───────────────────────────────────────────────── */

.rlb-spinner-wrap {
  display: flex;
  justify-content: center;
  padding: 40px 0;
}

.rlb-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--rlb-primary-light);
  border-top-color: var(--rlb-primary);
  border-radius: 50%;
  animation: rlb-spin .6s linear infinite;
}

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

.rlb-btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: rlb-spin .6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

/* ── Services ──────────────────────────────────────────────── */

.rlb-category {
  margin-bottom: 20px;
}

.rlb-category-name {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--rlb-muted);
  margin-bottom: 10px;
}

.rlb-service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.rlb-service-card {
  background: var(--rlb-white);
  border: 2px solid var(--rlb-border);
  border-radius: var(--rlb-radius);
  padding: 14px;
  cursor: pointer;
  text-align: left;
  transition: all .15s;
  position: relative;
  overflow: hidden;
}

.rlb-service-card:hover {
  border-color: var(--rlb-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--rlb-primary-light);
}

.rlb-service-card.selected {
  border-color: var(--rlb-primary);
  background: var(--rlb-primary-light);
}

.rlb-service-card.selected::after {
  content: '✓';
  position: absolute;
  top: 8px; right: 8px;
  width: 20px; height: 20px;
  background: var(--rlb-primary);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rlb-service-color {
  width: 100%;
  height: 3px;
  border-radius: 2px;
  margin-bottom: 10px;
}

.rlb-service-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--rlb-text);
  margin-bottom: 6px;
  line-height: 1.3;
}

.rlb-service-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--rlb-muted);
}

.rlb-price {
  font-weight: 600;
  color: var(--rlb-primary);
  font-size: 13px;
}

.rlb-service-desc {
  font-size: 11px;
  color: var(--rlb-muted);
  margin-top: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Employees ─────────────────────────────────────────────── */

.rlb-employee-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rlb-employee-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--rlb-white);
  border: 2px solid var(--rlb-border);
  border-radius: var(--rlb-radius);
  padding: 12px 16px;
  cursor: pointer;
  text-align: left;
  transition: all .15s;
  width: 100%;
}

.rlb-employee-card:hover {
  border-color: var(--rlb-primary);
  background: var(--rlb-primary-light);
}

.rlb-employee-card.selected {
  border-color: var(--rlb-primary);
  background: var(--rlb-primary-light);
}

.rlb-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.rlb-employee-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--rlb-text);
}

.rlb-employee-meta {
  font-size: 12px;
  color: var(--rlb-muted);
  margin-top: 2px;
}

/* ── Calendar ──────────────────────────────────────────────── */

.rlb-calendar {
  background: var(--rlb-bg);
  border: 1px solid var(--rlb-border);
  border-radius: var(--rlb-radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.rlb-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--rlb-white);
  border-bottom: 1px solid var(--rlb-border);
}

.rlb-cal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--rlb-text);
}

.rlb-cal-nav {
  background: none;
  border: 1px solid var(--rlb-border);
  border-radius: 6px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 16px;
  color: var(--rlb-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  line-height: 1;
  padding: 0;
}

.rlb-cal-nav:hover:not(:disabled) {
  border-color: var(--rlb-primary);
  color: var(--rlb-primary);
}

.rlb-cal-nav:disabled {
  opacity: .35;
  cursor: default;
}

.rlb-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 8px;
  gap: 2px;
}

.rlb-day-name {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--rlb-muted);
  padding: 6px 0;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.rlb-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: default;
  transition: all .15s;
  min-width: 0;
  color: var(--rlb-muted);
}

.rlb-day.other      { opacity: .25; }
.rlb-day.past       { opacity: .3; color: var(--rlb-muted); }
.rlb-day.unavailable { color: #D1D5DB; }

.rlb-day.available {
  color: var(--rlb-text);
  background: var(--rlb-primary-light);
  cursor: pointer;
  font-weight: 600;
}

.rlb-day.available:hover {
  background: var(--rlb-primary);
  color: #fff;
}

.rlb-day.selected {
  background: var(--rlb-primary) !important;
  color: #fff !important;
  font-weight: 700;
}

/* ── Time slots ────────────────────────────────────────────── */

.rlb-slots-section {
  margin-top: 0;
}

.rlb-slots-title {
  font-size: 13px;
  color: var(--rlb-muted);
  margin-bottom: 12px;
}

.rlb-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rlb-slot {
  background: var(--rlb-white);
  border: 2px solid var(--rlb-border);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  color: var(--rlb-text);
}

.rlb-slot:hover {
  border-color: var(--rlb-primary);
  color: var(--rlb-primary);
}

.rlb-slot.selected {
  background: var(--rlb-primary);
  border-color: var(--rlb-primary);
  color: #fff;
}

/* ── Form ──────────────────────────────────────────────────── */

.rlb-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

.rlb-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--rlb-text);
  margin-bottom: 6px;
}

.rlb-field input,
.rlb-field textarea,
.rlb-field select {
  width: 100%;
  border: 1.5px solid var(--rlb-border);
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: var(--rlb-font);
  color: var(--rlb-text);
  background: var(--rlb-white);
  transition: border-color .15s;
  box-sizing: border-box;
}

.rlb-field input:focus,
.rlb-field textarea:focus {
  outline: none;
  border-color: var(--rlb-primary);
  box-shadow: 0 0 0 3px var(--rlb-primary-light);
}

.rlb-field textarea {
  resize: vertical;
  min-height: 80px;
}

/* ── Summary ───────────────────────────────────────────────── */

.rlb-summary {
  background: var(--rlb-bg);
  border: 1px solid var(--rlb-border);
  border-radius: var(--rlb-radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.rlb-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--rlb-border);
  font-size: 14px;
}

.rlb-summary-row:last-child { border-bottom: none; }

.rlb-summary-row span { color: var(--rlb-muted); }
.rlb-summary-row strong { color: var(--rlb-text); text-align: right; }

.rlb-summary-total {
  background: var(--rlb-white);
  font-weight: 700;
}

.rlb-summary-total strong {
  color: var(--rlb-primary);
  font-size: 17px;
}

.rlb-payment-note {
  background: #FFF7ED;
  border: 1px solid #FED7AA;
  border-radius: 7px;
  padding: 12px 16px;
  font-size: 13px;
  color: #92400E;
  margin-bottom: 4px;
}

.rlb-payment-note p { margin: 0; }

.rlb-free-note {
  background: #F0FDF4;
  border-color: #BBF7D0;
  color: #065F46;
}

/* ── Success ───────────────────────────────────────────────── */

.rlb-success {
  text-align: center;
  padding: 40px 24px;
}

.rlb-success-icon {
  width: 64px;
  height: 64px;
  background: var(--rlb-success);
  color: #fff;
  border-radius: 50%;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  animation: rlb-pop .4s cubic-bezier(.175,.885,.32,1.275);
}

@keyframes rlb-pop {
  from { transform: scale(.5); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}

.rlb-success-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--rlb-text);
  margin: 0 0 8px;
}

.rlb-success-text {
  font-size: 14px;
  color: var(--rlb-muted);
  margin: 0 0 24px;
  line-height: 1.6;
}

/* ── Footer navigation ─────────────────────────────────────── */

.rlb-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--rlb-border);
  background: var(--rlb-bg);
}

.rlb-progress {
  font-size: 12px;
  color: var(--rlb-muted);
}

/* ── Buttons ───────────────────────────────────────────────── */

.rlb-btn {
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

.rlb-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.rlb-btn-primary {
  background: var(--rlb-primary);
  color: #fff;
  border-color: var(--rlb-primary);
}

.rlb-btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.rlb-btn-outline {
  background: var(--rlb-white);
  color: var(--rlb-primary);
  border-color: var(--rlb-primary);
}

.rlb-btn-outline:hover:not(:disabled) {
  background: var(--rlb-primary-light);
}

/* ── Empty ─────────────────────────────────────────────────── */

.rlb-empty {
  text-align: center;
  color: var(--rlb-muted);
  font-size: 14px;
  padding: 32px 0;
}

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 480px) {
  .rlb-steps { padding: 14px 12px 0; }
  .rlb-step-label { display: none; }
  .rlb-panel { padding: 16px; }
  .rlb-footer { padding: 12px 16px; }
  .rlb-service-grid { grid-template-columns: 1fr; }
  .rlb-form-row { grid-template-columns: 1fr; }
  .rlb-slots { gap: 6px; }
  .rlb-slot { padding: 7px 12px; font-size: 13px; }
}

/* ── Modality badges (on service cards) ──────────────────────── */

.rlb-service-modality-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 7px;
}

.rlb-modality-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
}

.rlb-badge-presential {
  background: #FFF7ED;
  color: #92400E;
  border: 1px solid #FED7AA;
}

.rlb-badge-virtual {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

/* ── Modality selection step ─────────────────────────────────── */

.rlb-modality-subtitle {
  font-size: 13px;
  color: var(--rlb-muted);
  margin: -12px 0 20px;
}

.rlb-modality-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.rlb-modality-card {
  background: var(--rlb-white);
  border: 2px solid var(--rlb-border);
  border-radius: 12px;
  padding: 24px 20px;
  cursor: pointer;
  text-align: center;
  transition: all .18s;
  position: relative;
  width: 100%;
}

.rlb-modality-card:hover {
  border-color: var(--rlb-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--rlb-primary-light);
}

.rlb-modality-card.selected {
  border-color: var(--rlb-primary);
  background: var(--rlb-primary-light);
}

.rlb-modality-icon {
  font-size: 36px;
  margin-bottom: 10px;
  line-height: 1;
}

.rlb-modality-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--rlb-text);
  margin-bottom: 8px;
}

.rlb-modality-desc {
  font-size: 12px;
  color: var(--rlb-muted);
  line-height: 1.5;
}

.rlb-modality-check {
  margin-top: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--rlb-primary);
  background: var(--rlb-primary-light);
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
}

/* ── Modality reminder in calendar step ──────────────────────── */

.rlb-modality-reminder {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: #F8FAFF;
  border-radius: 7px;
  border: 1px solid var(--rlb-border);
}

/* ── Virtual note in summary ─────────────────────────────────── */

.rlb-virtual-note {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 7px;
  padding: 12px 16px;
  font-size: 13px;
  color: #1D4ED8;
  margin-bottom: 16px;
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 420px) {
  .rlb-modality-grid { grid-template-columns: 1fr; }
  .rlb-modality-card { padding: 18px 14px; }
  .rlb-modality-icon { font-size: 28px; }
  .rlb-modality-title { font-size: 15px; }
}
