:root {
  /* Bookeasy primary palette (sampled from testsuite.min.css) */
  --be-primary: #5856d6;
  --be-primary-dark: #3634a3;
  --be-primary-soft: #cfc7f3;
  --be-ink: #080a0c;
  --be-ink-2: #212631;
  --be-ink-3: #6b7785;
  --be-surface: #ffffff;
  --be-surface-2: #f7f8fb;
  --be-surface-3: #eef0f5;
  --be-border: #e3e6ee;
  --be-success: #1b9e3e;
  --be-warning: #f9b115;
  --be-danger: #e55353;
  --be-star: #ffb547;

  /* Modern accents */
  --be-accent-grad: linear-gradient(135deg, #6e6bf0 0%, #5856d6 45%, #3634a3 100%);
  --be-header-grad: linear-gradient(135deg, #2a2e3d 0%, #20242f 45%, #181b24 100%);
  --be-glow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(88, 86, 214, 0.08);
  --be-radius-sm: 8px;
  --be-radius: 14px;
  --be-radius-lg: 20px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #f7f8fb 0%, #eef0f5 100%);
  color: var(--be-ink);
  font-family: "Inter", "SN Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--be-primary); }

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- Header ---------- */

.page-header {
  background: var(--be-header-grad);
  color: #fff;
  padding: 36px 28px 32px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 6px 20px rgba(0, 0, 0, 0.15);
}

.page-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.page-header .brand-logo {
  height: 88px;
  width: auto;
  display: block;
}

.page-header .tagline {
  margin: 0;
  font-size: 15px;
  opacity: 0.85;
  letter-spacing: 0.01em;
}

/* ---------- Main layout ---------- */

.page-main {
  flex: 1 1 auto;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  background: var(--be-surface);
  border: 1px solid var(--be-border);
  border-radius: var(--be-radius);
  box-shadow: var(--be-glow);
  overflow: hidden;
}

.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--be-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-header h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--be-ink-3);
}

.card-body {
  padding: 20px;
}

/* ---------- AI assistant intro card ---------- */

.intro-card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.intro-text {
  margin: 0;
  color: var(--be-ink-2);
}

/* ---------- Chat drawer (vendored bookeasychat embed) ----------
   The framework mounts at <div data-be-bookeasychat-embed> and renders a
   floating FAB + a fixed drawer that slides in from the right. We trigger
   open/close with our own <button data-be-bookeasychat-trigger> in the
   intro card, so the framework's own FAB and settings gear are hidden. */

#gadget { display: none; }

.be-bechat-embed-fab,
.be-bechat-embed-gear,
.be-bechat-embed-dialog {
  display: none !important;
}

/* Desktop: the drawer is a fixed right-hand panel whose width the user can
   drag. --be-drawer-width is the single source of truth — the widget width,
   the body push, and the drag handle all read it, so they can never drift
   apart (the framework's own fixed max-width:22.5rem is overridden below).
   app.js persists the dragged value as an inline style on <body>; absent
   that, this default applies. The +4px on the push is intentional breathing
   room between flow content and the drawer's left edge. The drag clamp range
   is enforced in app.js (it may go narrower than the framework's format
   minimum). Narrow viewports (below) fall back to a full-screen overlay. */
@media (min-width: 900px) {
  body {
    --be-drawer-width: 22.5rem;
    transition: padding-right 240ms cubic-bezier(0.4, 0, 0.2, 1);
  }
  body[data-chat-open="true"] {
    padding-right: calc(var(--be-drawer-width) + 4px);
  }
  /* Make the vendored drawer honour the adjustable width. */
  body[data-chat-open="true"] .be-bookeasychat-widget {
    width: var(--be-drawer-width) !important;
    max-width: var(--be-drawer-width) !important;
    min-width: 0 !important;
  }
  /* Suppress the push transition and text selection mid-drag so the panel
     tracks the pointer instead of easing behind it. */
  body.tp-resizing {
    transition: none;
    cursor: ew-resize;
    user-select: none;
  }

  /* Drag handle pinned to the drawer's left edge; only present while open. */
  .tp-drawer-resizer { display: none; }
  body[data-chat-open="true"] .tp-drawer-resizer {
    display: block;
    position: fixed;
    top: 0;
    right: var(--be-drawer-width);
    width: 10px;
    height: 100vh;
    margin-right: -5px;     /* straddle the edge so the line is centred on it */
    z-index: 3001;          /* above the widget (z-index:3000) */
    cursor: ew-resize;
    touch-action: none;
    background: transparent;
  }
  /* Visible grip line, brightened on hover / focus / drag. */
  .tp-drawer-resizer::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 50%;
    width: 2px;
    transform: translateX(-50%);
    background: var(--be-border);
    transition: background-color 120ms ease, width 120ms ease;
  }
  .tp-drawer-resizer:hover::before,
  .tp-drawer-resizer:focus-visible::before,
  body.tp-resizing .tp-drawer-resizer::before {
    background: var(--be-primary);
    width: 3px;
  }
  .tp-drawer-resizer:focus-visible { outline: none; }
}

/* Narrow viewports: full-screen drawer. The framework anchors it to bottom:0
   with max-height:95dvh (leaving a strip of the page header showing through),
   so pin it to the top edge to cover the viewport. Force min-width:0 /
   width:100vw so the panel can shrink to screens narrower than the desktop
   format's minimum (small phones) instead of overflowing or being floored at
   that minimum. Paired with the min-width:900px block above. */
@media (max-width: 899.98px) {
  .be-bookeasychat-widget {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    min-width: 0 !important;
    max-width: 100vw !important;
    max-height: 100dvh !important;
  }
}

/* Hide the widget's own session-feedback bar — we collect feedback via the
   page's feedback form, not inside the chat. */
.be-session-feedback {
  display: none !important;
}

/* Lowercase the chat widget's framework buttons to match the page. */
.be-bookeasychat-widget button { text-transform: lowercase; }

/* ---------- Feedback form ---------- */

.feedback-form {
  display: grid;
  gap: 16px;
}

.feedback-form .row-2 {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 16px;
}

@media (max-width: 640px) {
  .feedback-form .row-2 { grid-template-columns: 1fr; }
}

label.field {
  display: block;
  font-size: 13px;
  color: var(--be-ink-2);
  font-weight: 500;
}

label.field > .label-text {
  display: block;
  margin-bottom: 6px;
}

label.field .required {
  color: var(--be-danger);
  margin-left: 2px;
}

input[type="text"],
textarea {
  width: 100%;
  font: inherit;
  color: var(--be-ink);
  background: var(--be-surface);
  border: 1px solid var(--be-border);
  border-radius: var(--be-radius-sm);
  padding: 10px 12px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--be-primary);
  box-shadow: 0 0 0 3px rgba(88, 86, 214, 0.15);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

/* Star rating */
.stars {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 4px;
}

.stars input { display: none; }

.stars label {
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  color: var(--be-surface-3);
  transition: color 100ms ease, transform 100ms ease;
  user-select: none;
}

.stars label:hover,
.stars label:hover ~ label,
.stars input:checked ~ label {
  color: var(--be-star);
}

.stars label:hover { transform: scale(1.1); }

.actions {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  align-items: center;
}

.actions .hint {
  font-size: 13px;
  color: var(--be-ink-3);
}

/* Match the chat widget's Send button so the page's buttons feel native. */
button.primary {
  background: #0d6efd;
  color: #fff;
  border: 0;
  /* Use the same system stack as the framework's send button so glyphs match. */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-transform: lowercase;
  padding: 12px 22px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(13, 110, 253, 0.25);
  transition: background-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

button.primary:hover { background: #0b5ed7; transform: translateY(-1px); }
button.primary:active { transform: translateY(0); }
button.primary:disabled {
  background: #6c757d;
  cursor: not-allowed;
  box-shadow: none;
}

button.secondary {
  background: var(--be-surface);
  color: #0d6efd;
  border: 1px solid var(--be-border);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-transform: lowercase;
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
}

button.secondary:hover { border-color: #0d6efd; }

/* Thank-you state */
.thanks {
  text-align: center;
  padding: 32px 16px;
}

.thanks h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.thanks p {
  margin: 0 0 20px;
  color: var(--be-ink-3);
}

.error {
  color: var(--be-danger);
  font-size: 13px;
  min-height: 18px;
}

/* ---------- Footer ---------- */

.page-footer {
  text-align: center;
  padding: 20px;
  color: var(--be-ink-3);
  font-size: 12px;
}
