/* ──────────────────────────────────────────────────────────────
   RentFlow Public CSS v1.2.0 — DM Sans only
   Colors driven by CSS custom properties (set via Settings page)
   ────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&display=swap');

/* Default values — overridden by inline <style> from RF_Settings::inline_css() */
:root {
  --rf-forest: #1e3a2f;
  --rf-moss:   #2d6a4f;
  --rf-cream:  #faf8f3;
  --rf-sand:   #e8dcc8;
}

.rf-widget {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--rf-cream);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 32px rgba(30, 58, 47, .1);
  max-width: 680px;
  margin: 0 auto;
  color: #1a1a1a;
}

/* ── Step indicator ─────────────────────────────────────────── */
.rf-steps {
  background: var(--rf-forest);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
}
.rf-step {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  color: rgba(255,255,255,.45);
  border-bottom: 3px solid transparent;
  transition: color .2s, border-color .2s;
}
.rf-step--active {
  color: #fff;
  border-bottom-color: var(--rf-sand);
}
.rf-step__num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.rf-step--active .rf-step__num {
  background: var(--rf-sand);
  color: var(--rf-forest);
}

/* ── Calendar panel ─────────────────────────────────────────── */
.rf-calendar-panel { padding: 24px; }

.rf-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.rf-cal-month {
  font-size: 20px;
  font-weight: 300;
  color: #1a1a1a;
  letter-spacing: -.01em;
}
.rf-cal-arrow {
  background: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 16px;
  color: #666;
  transition: background .15s, border-color .15s;
}
.rf-cal-arrow:hover { background: var(--rf-sand); border-color: #bbb; color: #1a1a1a; }

/* Day name headers */
.rf-cal-daynames {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 6px;
}
.rf-cal-dayname {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #9aa5b4;
  padding: 4px 0;
}

/* Day grid */
.rf-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.rf-cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .1s, color .1s;
  position: relative;
  user-select: none;
}
.rf-cal-day:hover:not(.rf-cal-day--booked):not(.rf-cal-day--blocked):not(.rf-cal-day--past) {
  background: var(--rf-sand);
}
.rf-cal-day--today { color: var(--rf-moss); font-weight: 700; }
.rf-cal-day--today::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--rf-moss);
}
.rf-cal-day--past    { color: #c8c8c8; cursor: default; }
.rf-cal-day--booked  { color: #ccc; cursor: not-allowed; text-decoration: line-through; background: repeating-linear-gradient(45deg,#f5f5f5,#f5f5f5 3px,#fafafa 3px,#fafafa 6px); }
.rf-cal-day--blocked { color: #ccc; cursor: not-allowed; background: repeating-linear-gradient(-45deg,#fef2f2,#fef2f2 3px,#fff5f5 3px,#fff5f5 6px); }
.rf-cal-day--start,
.rf-cal-day--end     { background: var(--rf-forest) !important; color: #fff !important; font-weight: 600; }
.rf-cal-day--start   { border-radius: 6px 0 0 6px; }
.rf-cal-day--end     { border-radius: 0 6px 6px 0; }
.rf-cal-day--start.rf-cal-day--end { border-radius: 6px; }
.rf-cal-day--inrange { background: var(--rf-sand); border-radius: 0; }
.rf-cal-day--hover-range { background: color-mix(in srgb, var(--rf-sand) 60%, transparent); border-radius: 0; }

/* Legend */
.rf-cal-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  font-size: 11px;
  color: #888;
}
.rf-cal-legend-item { display: flex; align-items: center; gap: 5px; }
.rf-cal-legend-dot  { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.rf-cal-legend-dot--sel     { background: var(--rf-forest); border-radius: 50%; }
.rf-cal-legend-dot--range   { background: var(--rf-sand); }
.rf-cal-legend-dot--booked  { background: repeating-linear-gradient(45deg,#f0f0f0,#f0f0f0 2px,#fafafa 2px,#fafafa 4px); border: 1px solid #ddd; }
.rf-cal-legend-dot--blocked { background: repeating-linear-gradient(-45deg,#fecaca,#fecaca 2px,#fff5f5 2px,#fff5f5 4px); border: 1px solid #fca5a5; }

/* ── Selection bar ──────────────────────────────────────────── */
.rf-sel-bar {
  margin: 16px 0 0;
  background: var(--rf-sand);
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 56px;
}
.rf-sel-dates {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  flex-wrap: wrap;
}
.rf-sel-date {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.rf-sel-date__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #888;
  font-weight: 600;
}
.rf-sel-date__val {
  font-size: 15px;
  font-weight: 500;
  color: var(--rf-forest);
}
.rf-sel-date__placeholder {
  font-size: 14px;
  color: #aaa;
  font-weight: 400;
}
.rf-sel-arrow { font-size: 18px; color: #aaa; }
.rf-sel-nights { font-size: 12px; color: #888; white-space: nowrap; }
.rf-sel-actions { display: flex; align-items: center; gap: 8px; }
.rf-sel-clear {
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: #888; padding: 4px;
  text-decoration: underline;
}
.rf-sel-clear:hover { color: var(--rf-forest); }
.rf-btn-next {
  background: var(--rf-forest);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.rf-btn-next:hover:not(:disabled) { background: var(--rf-moss); }
.rf-btn-next:disabled { opacity: .4; cursor: default; }

/* ── Booking form (step 2) ──────────────────────────────────── */
.rf-form-panel { padding: 28px; }

.rf-form-panel h3 {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 500;
  color: var(--rf-forest);
}
.rf-booking-summary {
  background: var(--rf-sand);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 22px;
  font-size: 14px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.rf-booking-summary strong { color: var(--rf-forest); }

.rf-field { margin-bottom: 16px; }
.rf-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #888;
  margin-bottom: 5px;
}
.rf-field input,
.rf-field textarea {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: #1a1a1a;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.rf-field input:focus,
.rf-field textarea:focus {
  border-color: var(--rf-moss);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, .12);
}
.rf-field textarea { resize: vertical; min-height: 80px; }

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

.rf-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  gap: 12px;
  flex-wrap: wrap;
}
.rf-btn-back {
  background: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px 18px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  transition: background .15s;
}
.rf-btn-back:hover { background: var(--rf-sand); }
.rf-btn-submit {
  background: var(--rf-forest);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 11px 24px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  min-width: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.rf-btn-submit:hover:not(:disabled) { background: var(--rf-moss); }
.rf-btn-submit:disabled { opacity: .6; cursor: default; }

/* ── Error / success messages ───────────────────────────────── */
.rf-error-msg {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  color: #c0392b;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.rf-success-panel {
  padding: 48px 28px;
  text-align: center;
}
.rf-success-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--rf-moss);
  color: #fff;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.rf-success-panel h3 {
  font-size: 22px;
  font-weight: 500;
  color: var(--rf-forest);
  margin: 0 0 10px;
}
.rf-success-panel p {
  font-size: 15px;
  color: #666;
  margin: 0;
  line-height: 1.6;
}

/* ── Closed state ───────────────────────────────────────────── */
.rf-closed-panel {
  padding: 48px 28px;
  text-align: center;
  color: #888;
}
.rf-closed-panel p { font-size: 15px; line-height: 1.6; }

/* ── Error (no calendar) ────────────────────────────────────── */
.rf-error {
  padding: 16px;
  background: #fef2f2;
  color: #c0392b;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 520px) {
  .rf-calendar-panel, .rf-form-panel { padding: 16px; }
  .rf-form-row { grid-template-columns: 1fr; }
  .rf-cal-day  { font-size: 11px; }
}
