/* ─── FB Booking Engine · Formulario Público — Estilo Calendly ──────────────
   Fondo blanco/claro, tipografía limpia, azul oscuro + gris oscuro
   ─────────────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cal-blue:      #006bff;
  --cal-accent-dark: #b5706a;
  --cal-blue-dark: #0052cc;
  --cal-navy:      #1a2e4a;
  --cal-text:      #3d4f61;
  --cal-muted:     #8896a4;
  --cal-border:    #d8e0e8;
  --cal-bg:        #f4f6f9;
  --cal-white:     #ffffff;
  --cal-green:     #0cb87a;
  --cal-red:       #e5484d;
  --cal-radius:    8px;
  --cal-radius-lg: 14px;
  --cal-font:      -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Arial, sans-serif;
  --cal-shadow:    0 4px 24px rgba(26,46,74,.10);
  --cal-shadow-sm: 0 2px 8px rgba(26,46,74,.07);
}

/* ── Contenedor principal ────────────────────────────────────────────────── */
.fb-public-wrap {
  font-family: var(--cal-font);
  -webkit-font-smoothing: antialiased;
  color: var(--cal-text);
  max-width: 940px;
  margin: 0 auto;
  background: var(--cal-white);
  border-radius: var(--cal-radius-lg);
  box-shadow: var(--cal-shadow);
  overflow: hidden;
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 560px;
}

/* ── Panel izquierdo (info del servicio) ─────────────────────────────────── */
.fb-cal-sidebar {
  background: var(--cal-accent-dark);
  padding: 36px 28px;
  color: var(--cal-white);
  display: flex;
  flex-direction: column;
  gap: 0;
}
.fb-cal-sidebar-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--cal-white);
  margin-bottom: 16px;
  overflow: hidden;
  flex-shrink: 0;
}
.fb-cal-sidebar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fb-cal-sidebar-name {
  font-size: 13px;
  color: rgba(255,255,255,.65);
  margin-bottom: 6px;
  letter-spacing: .3px;
}
.fb-cal-sidebar-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--cal-white);
  line-height: 1.3;
  margin-bottom: 20px;
}
.fb-cal-sidebar-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fb-cal-sidebar-meta-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: rgba(255,255,255,.8);
  line-height: 1.5;
}
.fb-cal-sidebar-meta-item svg,
.fb-cal-sidebar-meta-item .fb-meta-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
  opacity: .7;
}
.fb-cal-sidebar-desc {
  margin-top: 20px;
  font-size: 13px;
  color: rgba(255,255,255,.65);
  line-height: 1.7;
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 16px;
}

/* ── Panel derecho (contenido de pasos) ──────────────────────────────────── */
.fb-cal-main {
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  background: var(--cal-white);
}
.fb-cal-step-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--cal-navy);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--cal-border);
}

/* ── Animación de pasos ──────────────────────────────────────────────────── */
.fb-step { animation: fbCalFade .28s ease; }
@keyframes fbCalFade {
  from { opacity:0; transform:translateY(10px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ── Tipos de cita (Paso 0) ──────────────────────────────────────────────── */
.fb-types-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fb-type-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border: 1.5px solid var(--cal-border);
  border-radius: var(--cal-radius);
  background: var(--cal-white);
  cursor: pointer;
  font-family: var(--cal-font);
  text-align: left;
  transition: all .2s ease;
  width: 100%;
}
.fb-type-btn:hover {
  border-color: var(--cal-blue);
  background: #f0f6ff;
  box-shadow: var(--cal-shadow-sm);
}
.fb-type-btn.selected {
  border-color: var(--cal-blue);
  background: #eaf1ff;
}
.fb-type-btn-left { flex: 1; }
.fb-type-btn-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--cal-navy);
  margin-bottom: 3px;
}
.fb-type-btn-desc {
  font-size: 13px;
  color: var(--cal-muted);
  line-height: 1.4;
}
.fb-type-btn-duration {
  font-size: 13px;
  color: var(--cal-muted);
  white-space: nowrap;
  margin-left: 16px;
  flex-shrink: 0;
}
.fb-type-btn-arrow {
  color: var(--cal-blue);
  font-size: 18px;
  margin-left: 12px;
  flex-shrink: 0;
}

/* ── Calendario (Paso 1) ─────────────────────────────────────────────────── */
.fb-calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.fb-cal-month-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--cal-navy);
}
.fb-cal-nav-btn {
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--cal-border);
  border-radius: 50%;
  background: var(--cal-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cal-text);
  font-size: 16px;
  transition: all .2s ease;
}
.fb-cal-nav-btn:hover { border-color: var(--cal-blue); color: var(--cal-blue); }
.fb-cal-nav-btn:disabled { opacity: .35; cursor: default; }

.fb-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 8px;
}
.fb-cal-weekdays div {
  font-size: 11px;
  font-weight: 700;
  color: var(--cal-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 4px 0;
}
.fb-cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.fb-cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fb-cal-day button {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: none;
  font-size: 14px;
  cursor: pointer;
  color: var(--cal-text);
  font-family: var(--cal-font);
  font-weight: 500;
  transition: all .18s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fb-cal-day.avail button:hover {
  background: #e8f0ff;
  color: var(--cal-blue);
}
.fb-cal-day.avail button { color: var(--cal-blue); font-weight: 600; }
.fb-cal-day.selected button {
  background: var(--cal-blue) !important;
  color: #fff !important;
  font-weight: 700;
}
.fb-cal-day.past button,
.fb-cal-day button:disabled {
  color: #cdd4db !important;
  cursor: default;
}
.fb-cal-day.other-month button { color: #dde2e7; }
.fb-cal-dot {
  width: 4px;
  height: 4px;
  background: var(--cal-blue);
  border-radius: 50%;
  position: absolute;
  bottom: 2px;
}
.fb-cal-day-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Slots (Paso 2) ──────────────────────────────────────────────────────── */
.fb-cal-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.fb-cal-layout .fb-cal-day-panel {
  padding-right: 20px;
  border-right: 1px solid var(--cal-border);
}
.fb-slots-panel h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--cal-navy);
  margin-bottom: 14px;
}
.fb-slots-date {
  font-size: 13px;
  color: var(--cal-muted);
  margin-bottom: 12px;
}
.fb-slots-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}
.fb-slots-list::-webkit-scrollbar { width: 4px; }
.fb-slots-list::-webkit-scrollbar-thumb { background: var(--cal-border); border-radius: 2px; }

.fb-slot-btn {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--cal-blue);
  border-radius: var(--cal-radius);
  background: var(--cal-white);
  color: var(--cal-blue);
  font-family: var(--cal-font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s ease;
  text-align: center;
}
.fb-slot-btn:hover { background: var(--cal-blue); color: #fff; }
.fb-slot-btn.selected { background: var(--cal-blue); color: #fff; }
.fb-no-slots {
  font-size: 13px;
  color: var(--cal-muted);
  text-align: center;
  padding: 24px 0;
}

/* ── Formulario de datos (Paso 3) ────────────────────────────────────────── */
.fb-form-header {
  margin-bottom: 24px;
}
.fb-form-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--cal-navy);
  margin-bottom: 4px;
}
.fb-form-header p {
  font-size: 13px;
  color: var(--cal-muted);
}
.fb-pub-field {
  margin-bottom: 16px;
}
.fb-pub-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--cal-navy);
  margin-bottom: 6px;
}
.fb-pub-field label .fb-required {
  color: var(--cal-red);
  margin-left: 2px;
}
.fb-pub-field input[type="text"],
.fb-pub-field input[type="email"],
.fb-pub-field input[type="tel"],
.fb-pub-field select,
.fb-pub-field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--cal-border);
  border-radius: var(--cal-radius);
  font-family: var(--cal-font);
  font-size: 14px;
  color: var(--cal-navy);
  background: var(--cal-white);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.fb-pub-field input:focus,
.fb-pub-field select:focus,
.fb-pub-field textarea:focus {
  border-color: var(--cal-blue);
  box-shadow: 0 0 0 3px rgba(0,107,255,.1);
}
.fb-pub-field textarea { resize: vertical; min-height: 80px; }
.fb-pub-field select { appearance: none; cursor: pointer; }

/* Checkbox y radio */
.fb-check-group,
.fb-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fb-check-label,
.fb-radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--cal-text);
  cursor: pointer;
  padding: 8px 12px;
  border: 1.5px solid var(--cal-border);
  border-radius: var(--cal-radius);
  transition: all .18s ease;
}
.fb-check-label:hover,
.fb-radio-label:hover { border-color: var(--cal-blue); background: #f0f6ff; }
.fb-check-label input,
.fb-radio-label input { accent-color: var(--cal-blue); width: 16px; height: 16px; }

/* ── Error ───────────────────────────────────────────────────────────────── */
.fb-pub-error {
  background: #fff0f0;
  border: 1.5px solid #f5c6cb;
  color: #c0392b;
  padding: 10px 14px;
  border-radius: var(--cal-radius);
  font-size: 13px;
  margin-bottom: 16px;
}

/* ── Botones ─────────────────────────────────────────────────────────────── */
.fb-pub-submit {
  width: 100%;
  padding: 13px;
  background: var(--cal-blue);
  color: #fff;
  border: none;
  border-radius: var(--cal-radius);
  font-family: var(--cal-font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, transform .15s ease;
  margin-top: 8px;
}
.fb-pub-submit:hover:not(:disabled) {
  background: var(--cal-blue-dark);
  transform: translateY(-1px);
}
.fb-pub-submit:disabled { opacity: .6; cursor: not-allowed; }

.fb-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--cal-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-bottom: 20px;
  font-family: var(--cal-font);
  transition: color .18s ease;
}
.fb-back-link:hover { color: var(--cal-blue); }

/* ── Confirmación (Paso 4) ───────────────────────────────────────────────── */
.fb-success-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  flex: 1;
}
.fb-success-icon {
  width: 72px;
  height: 72px;
  background: #eafaf4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 20px;
}
.fb-success-wrap h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--cal-navy);
  margin-bottom: 8px;
}
.fb-success-wrap p { font-size: 14px; color: var(--cal-muted); margin-bottom: 16px; }
.fb-success-detail {
  background: var(--cal-bg);
  border-radius: var(--cal-radius);
  padding: 16px 20px;
  text-align: left;
  width: 100%;
  max-width: 380px;
  margin-bottom: 24px;
}
.fb-success-detail p {
  font-size: 14px;
  color: var(--cal-text);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fb-success-detail a { color: var(--cal-blue); text-decoration: none; }
.fb-pub-submit.secondary {
  background: var(--cal-white);
  color: var(--cal-blue);
  border: 1.5px solid var(--cal-blue);
  width: auto;
  padding: 10px 24px;
  font-size: 13px;
}
.fb-pub-submit.secondary:hover { background: #f0f6ff; }

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.fb-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0,107,255,.2);
  border-top-color: var(--cal-blue);
  border-radius: 50%;
  animation: fbSpin .75s linear infinite;
  vertical-align: middle;
}
@keyframes fbSpin { to { transform: rotate(360deg); } }

.fb-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  color: var(--cal-muted);
  font-size: 14px;
}

/* ── Notice ──────────────────────────────────────────────────────────────── */
.fb-public-notice {
  padding: 16px 20px;
  background: #fff8e1;
  border: 1.5px solid #ffc107;
  border-radius: var(--cal-radius);
  font-size: 14px;
  color: #795600;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .fb-public-wrap {
    grid-template-columns: 1fr;
    border-radius: var(--cal-radius);
  }
  .fb-cal-sidebar {
    padding: 24px 20px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
  }
  .fb-cal-sidebar-avatar { width: 44px; height: 44px; font-size: 16px; margin-bottom: 0; }
  .fb-cal-sidebar-title { font-size: 16px; margin-bottom: 8px; }
  .fb-cal-sidebar-desc { display: none; }
  .fb-cal-main { padding: 24px 20px; }
  .fb-cal-layout { grid-template-columns: 1fr; }
  .fb-cal-layout .fb-cal-day-panel { border-right: none; padding-right: 0; border-bottom: 1px solid var(--cal-border); padding-bottom: 20px; }
}
