/* ================================================================
   Posto Widget — v3
   Served as an iframe. Zero style leakage to host site.
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

/* ── Custom properties ────────────────────────────────────────── */
:root {
  --accent:       #000000;
  --accent-light: rgba(0,0,0,0.07);
  --bg:           #ffffff;
  --bg-soft:      #f7f6f4;
  --surface:      #f0efed;
  --text:         #111111;
  --text-muted:   #6a6a6a;
  --border:       #e2e1de;
  --radius:       10px;
  --radius-lg:    14px;
}

[data-theme="dark"] {
  --bg:           #1a1a1a;
  --bg-soft:      #222222;
  --surface:      #2a2a2a;
  --text:         #f2ede8;
  --text-muted:   #888888;
  --border:       #383838;
  --accent-light: rgba(255,255,255,0.07);
}

/* ── Base ─────────────────────────────────────────────────────── */
html { font-size: 15px; }

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  padding: 20px 20px 24px;
  min-height: 100px;
}

/* ── Step transitions ─────────────────────────────────────────── */
.step { animation: stepIn 0.22s ease both; }
@keyframes stepIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ── Booking screen header ────────────────────────────────────── */
.widget-eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 6px;
}
.widget-title {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 22px;
}

/* ── Field row (party + date side by side) ───────────────────── */
.field-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.field-row .field-group {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

/* ── Select + date inputs ─────────────────────────────────────── */
.field-select,
.field-date {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.field-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236a6a6a' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}
.field-select:focus,
.field-date:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* ── Slots section ────────────────────────────────────────────── */
#slots-section { margin-top: 0; }

.slots-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* Spinner lives inside #slots-loading */
.slots-spinner {
  display: block;
  width: 26px;
  height: 26px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 14px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.slots-msg {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 8px 2px;
  line-height: 1.5;
}

/* ── Time slots ───────────────────────────────────────────────── */
.slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.slot-btn {
  padding: 12px 8px;
  background: var(--bg-soft);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  text-align: center;
  line-height: 1;
}
.slot-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}
.slot-btn.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.slot-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Back button ──────────────────────────────────────────────── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none; border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer; padding: 0;
  margin-bottom: 20px;
  font-family: inherit;
  transition: color 0.15s;
}
.back-btn:hover { color: var(--text); }

/* ── Step titles (contact / success / pending) ────────────────── */
.step-title {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.25;
}
.step-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* ── Summary strip ────────────────────────────────────────────── */
.summary-strip {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* ── Form fields ──────────────────────────────────────────────── */
.field-group { margin-bottom: 15px; }

.field-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.field-group .req { color: var(--accent); }
.field-group .opt {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.75rem;
}

.field-group input,
.field-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field-group input:focus,
.field-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.field-group textarea { resize: vertical; min-height: 72px; }

/* ── Demo sample-email checkbox ───────────────────────────────── */
.field-group .checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  margin-bottom: 0;
}
.field-group .checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ── Primary button ───────────────────────────────────────────── */
.btn-primary {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.12s;
  margin-top: 6px;
}
.btn-primary:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Error messages ───────────────────────────────────────────── */
.error-msg {
  font-size: 0.85rem;
  color: #c0392b;
  margin-top: 10px;
  margin-bottom: 14px;
  padding: 11px 14px;
  background: rgba(192,57,43,0.07);
  border-radius: var(--radius);
  border: 1px solid rgba(192,57,43,0.18);
  line-height: 1.45;
}

/* ── Success / Pending screens ────────────────────────────────── */
#step-success,
#step-pending { text-align: center; padding: 24px 0 12px; }

.success-icon,
.pending-icon {
  width: 60px; height: 60px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 20px;
}
.success-icon { background: rgba(42,92,52,0.1); color: #2a7a3a; }
.pending-icon { background: rgba(160,120,40,0.1); color: #9a7828; }

#step-success .step-title { color: #2a7a3a; }
#step-pending .step-title { color: var(--text); }

.success-detail {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 12px;
  line-height: 1.5;
}

/* ── Divider ──────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 22px 0;
}
