/* ============================================================
   Restaurant Booking Manager Pro – Public Booking Form
   Lightweight, fast-loading, no external dependencies
   ============================================================ */

:root {
  --rbmf-bg:       var(--rbm-form-bg, #ffffff);
  --rbmf-text:     var(--rbm-form-text, #1a1a2e);
  --rbmf-accent:   var(--rbm-form-accent, #1a1a2e);
  --rbmf-border:   var(--rbm-form-border, #e0e0e0);
  --rbmf-muted:    var(--rbm-form-muted, #888);
  --rbmf-radius:   8px;
  --rbmf-success:  #2dce89;
  --rbmf-error:    #f75676;
}

.rbmf-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 560px;
  margin: 0 auto;
  color: var(--rbmf-text);
}

/* ── Steps ──────────────────────────────────────────────────── */
.rbmf-step { display: none; }
.rbmf-step.active { display: block; animation: rbmfIn .22s ease; }
@keyframes rbmfIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── Step Indicator ─────────────────────────────────────────── */
.rbmf-steps-bar {
  display: flex;
  align-items: center;
  margin-bottom: 28px;
  gap: 0;
}
.rbmf-step-dot {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--rbmf-border);
  color: var(--rbmf-muted);
  font-size: 12px; font-weight: 700;
  transition: all .2s;
  flex-shrink: 0;
}
.rbmf-step-dot.done    { background: var(--rbmf-accent); color: #fff; }
.rbmf-step-dot.current { background: var(--rbmf-accent); color: #fff; box-shadow: 0 0 0 4px rgba(26,26,46,.12); }
.rbmf-step-line { flex: 1; height: 2px; background: var(--rbmf-border); transition: background .2s; }
.rbmf-step-line.done { background: var(--rbmf-accent); }

/* ── Calendar Grid ──────────────────────────────────────────── */
.rbmf-cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.rbmf-cal-month { font-size: 16px; font-weight: 700; }
.rbmf-cal-nav {
  background: none; border: 1px solid var(--rbmf-border);
  border-radius: 6px; padding: 5px 10px; cursor: pointer;
  color: var(--rbmf-text); font-size: 14px; transition: all .15s;
}
.rbmf-cal-nav:hover { background: var(--rbmf-accent); color: #fff; border-color: var(--rbmf-accent); }
.rbmf-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.rbmf-cal-day-label {
  text-align: center; font-size: 11px; font-weight: 700;
  color: var(--rbmf-muted); padding: 4px 0;
  text-transform: uppercase; letter-spacing: .4px;
}
.rbmf-cal-day {
  text-align: center; padding: 8px 4px;
  border-radius: 6px; cursor: pointer;
  font-size: 14px; transition: all .15s;
  border: 1px solid transparent;
  user-select: none;
}
.rbmf-cal-day:hover:not(.disabled):not(.past)  { background: rgba(26,26,46,.07); }
.rbmf-cal-day.available  { font-weight: 600; }
.rbmf-cal-day.unavailable{ color: var(--rbmf-muted); opacity: .5; cursor: default; }
.rbmf-cal-day.past       { color: var(--rbmf-muted); opacity: .35; cursor: default; }
.rbmf-cal-day.selected   { background: var(--rbmf-accent); color: #fff; border-color: var(--rbmf-accent); font-weight: 700; }
.rbmf-cal-day.today      { border-color: var(--rbmf-accent); font-weight: 700; }
.rbmf-cal-day.empty      { cursor: default; }

/* ── Time Slots ─────────────────────────────────────────────── */
.rbmf-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  margin-top: 16px;
}
.rbmf-slot {
  padding: 10px 8px;
  border-radius: 6px;
  border: 1px solid var(--rbmf-border);
  text-align: center;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.rbmf-slot:hover:not(.full) { border-color: var(--rbmf-accent); color: var(--rbmf-accent); }
.rbmf-slot.selected { background: var(--rbmf-accent); color: #fff; border-color: var(--rbmf-accent); }
.rbmf-slot.full     { opacity: .4; cursor: not-allowed; font-size: 11px; }

/* ── Party Size ─────────────────────────────────────────────── */
.rbmf-party {
  display: flex; align-items: center; gap: 0;
  border: 1px solid var(--rbmf-border); border-radius: 8px;
  overflow: hidden; width: fit-content;
}
.rbmf-party-btn {
  background: none; border: none;
  width: 44px; height: 44px;
  font-size: 20px; cursor: pointer;
  color: var(--rbmf-text); transition: background .15s;
  display: flex; align-items: center; justify-content: center;
}
.rbmf-party-btn:hover { background: rgba(26,26,46,.07); }
.rbmf-party-count {
  min-width: 48px; text-align: center;
  font-size: 18px; font-weight: 700;
  border-left: 1px solid var(--rbmf-border);
  border-right: 1px solid var(--rbmf-border);
  padding: 8px;
}

/* ── Form Fields ─────────────────────────────────────────────── */
.rbmf-field { margin-bottom: 16px; }
.rbmf-field label {
  display: block; font-size: 12px; font-weight: 700;
  color: var(--rbmf-muted); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: .4px;
}
.rbmf-input, .rbmf-select, .rbmf-textarea {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--rbmf-border);
  border-radius: var(--rbmf-radius);
  font-size: 14px; color: var(--rbmf-text);
  background: var(--rbmf-bg);
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
.rbmf-input:focus, .rbmf-select:focus, .rbmf-textarea:focus {
  outline: none;
  border-color: var(--rbmf-accent);
  box-shadow: 0 0 0 3px rgba(26,26,46,.1);
}
.rbmf-input.error { border-color: var(--rbmf-error); }
.rbmf-field-error { color: var(--rbmf-error); font-size: 12px; margin-top: 4px; }
.rbmf-textarea { resize: vertical; min-height: 80px; }
.rbmf-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .rbmf-form-row { grid-template-columns: 1fr; } }

/* ── Honeypot (hidden spam field) ────────────────────────────── */
.rbmf-hp { position: absolute; left: -9999px; }

/* ── Submit Button ───────────────────────────────────────────── */
.rbmf-submit {
  width: 100%;
  padding: 14px;
  background: var(--rbmf-accent);
  color: #fff;
  border: none;
  border-radius: var(--rbmf-radius);
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  transition: all .18s;
  letter-spacing: .3px;
  margin-top: 4px;
}
.rbmf-submit:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.rbmf-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.rbmf-submit.loading { position: relative; }
.rbmf-submit.loading::after {
  content: '';
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: rbmfSpin .6s linear infinite;
}
@keyframes rbmfSpin { to { transform: translateY(-50%) rotate(360deg); } }

/* ── Navigation Buttons ──────────────────────────────────────── */
.rbmf-nav {
  display: flex; gap: 12px; margin-top: 20px;
}
.rbmf-btn-back {
  background: none; border: 1px solid var(--rbmf-border);
  border-radius: var(--rbmf-radius); padding: 11px 20px;
  font-size: 14px; cursor: pointer; color: var(--rbmf-muted);
  transition: all .15s;
}
.rbmf-btn-back:hover { border-color: var(--rbmf-text); color: var(--rbmf-text); }
.rbmf-btn-next {
  flex: 1; background: var(--rbmf-accent); color: #fff;
  border: none; border-radius: var(--rbmf-radius); padding: 11px 20px;
  font-size: 14px; font-weight: 700; cursor: pointer; transition: all .15s;
}
.rbmf-btn-next:hover:not(:disabled) { filter: brightness(1.1); }
.rbmf-btn-next:disabled { opacity: .5; cursor: default; }

/* ── Summary Card ────────────────────────────────────────────── */
.rbmf-summary {
  background: rgba(26,26,46,.04);
  border: 1px solid var(--rbmf-border);
  border-radius: var(--rbmf-radius);
  padding: 20px;
  margin-bottom: 20px;
}
.rbmf-summary-row {
  display: flex; justify-content: space-between;
  padding: 7px 0; font-size: 14px;
  border-bottom: 1px solid var(--rbmf-border);
}
.rbmf-summary-row:last-child { border: none; }
.rbmf-summary-label { color: var(--rbmf-muted); }
.rbmf-summary-value { font-weight: 600; }

/* ── Success Screen ──────────────────────────────────────────── */
.rbmf-success {
  text-align: center; padding: 40px 20px;
}
.rbmf-success-icon {
  font-size: 56px; margin-bottom: 16px;
  animation: rbmfBounce .4s ease;
}
@keyframes rbmfBounce {
  0%   { transform: scale(.5); opacity: 0; }
  70%  { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
.rbmf-success h2 { font-size: 22px; margin: 0 0 8px; }
.rbmf-success p  { color: var(--rbmf-muted); font-size: 15px; }
.rbmf-ref-badge  {
  display: inline-block; background: var(--rbmf-accent);
  color: #fff; padding: 8px 20px; border-radius: 20px;
  font-size: 14px; font-weight: 700; letter-spacing: 1px;
  margin-top: 16px;
}

/* ── Loading Spinner ─────────────────────────────────────────── */
.rbmf-spinner {
  display: flex; justify-content: center; padding: 20px;
}
.rbmf-spinner::after {
  content: '';
  width: 24px; height: 24px;
  border: 3px solid var(--rbmf-border);
  border-top-color: var(--rbmf-accent);
  border-radius: 50%;
  animation: rbmfSpin .7s linear infinite;
}

/* ── Consent / GDPR ──────────────────────────────────────────── */
.rbmf-consent {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 12px; color: var(--rbmf-muted);
  margin-bottom: 14px;
}
.rbmf-consent input { margin-top: 2px; flex-shrink: 0; }
