/* ===== Foundation to Wellness — Form Builder forms ===== */
:root {
  --gold: #a6872f;
  --gold-light: #d4af37;
  --orange: #ff8c42;
  --hot: #ff5722;
  --violet: #5865f2;
  --bg: #0b0b0d;
  --panel: #16151a;
  --text: #f4f1ea;
  --muted: #b8b3a8;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body, 'Raleway', sans-serif); }
[hidden] { display: none !important; }
a { color: var(--gold-light); }

.ff-header {
  display: flex; align-items: center; gap: 18px; padding: 18px 26px;
  background: #070707; border-bottom: 2px solid rgba(166,135,47,0.4);
}
.ff-header img { height: 54px; display: block; }
.ff-header h1 {
  font-family: var(--font-head, 'Cinzel', serif); font-size: 1.4rem; margin: 0; letter-spacing: 0.5px;
  background: linear-gradient(90deg, var(--gold-light), var(--orange), var(--gold-light)); background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--gold-light);
  animation: ff-shimmer 6s linear infinite;
}
.ff-header p { margin: 2px 0 0; color: var(--muted); font-size: 0.85rem; }
@keyframes ff-shimmer { to { background-position: -200% center; } }

.ff-main {
  max-width: 760px; margin: 30px auto 50px; padding: 26px; background: var(--panel);
  border: 2px solid var(--orange); border-radius: 16px; box-shadow: 0 0 40px rgba(255,87,34,0.2);
}
.ff-loading, .ff-missing { text-align: center; color: var(--muted); padding: 30px 0; line-height: 1.7; }
.ff-preview-note { background: rgba(88,101,242,0.15); border: 1px solid var(--violet); color: #c9cdfb; border-radius: 8px; padding: 8px 12px; font-size: 0.8rem; margin-bottom: 16px; }

.ff-progress { height: 6px; background: #0f0e12; border-radius: 3px; overflow: hidden; border: 1px solid rgba(166,135,47,0.3); }
.ff-progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-light), var(--hot)); transition: width 0.3s ease; }
.ff-stepcount { color: var(--muted); font-size: 0.78rem; margin: 8px 0 18px; text-align: right; }

.ff-form { overflow: hidden; }
.ff-step { display: flex; flex-wrap: wrap; gap: 18px 16px; }
.ff-step > * { flex: 1 1 100%; min-width: 0; }
.ff-step > .ff-half { flex: 1 1 calc(50% - 8px); }
.ff-step-title, .ff-heading { font-family: var(--font-head, 'Cinzel', serif); color: var(--gold-light); font-size: 1.15rem; margin: 0; font-weight: 600; line-height: 1.4; }
.ff-heading { font-size: 1.02rem; margin-top: 6px; }

.ff-text { color: var(--muted); line-height: 1.7; font-size: 0.93rem; }
.ff-text p { margin: 0 0 12px; }
.ff-text p:last-child { margin-bottom: 0; }
.ff-text strong { color: var(--text); }
.ff-text ul, .ff-text ol { padding-left: 20px; margin: 0 0 12px; }
.ff-text li { margin-bottom: 8px; }

.ff-field { display: flex; flex-direction: column; gap: 8px; border: none; padding: 0; margin: 0; min-width: 0; }
.ff-label { font-size: 0.9rem; font-weight: 600; color: var(--gold-light); line-height: 1.5; padding: 0; margin-bottom: 2px; }
.ff-help { font-size: 0.82rem; color: var(--muted); line-height: 1.5; margin-top: -4px; }
.ff-req { color: #ff6b5e; }

.ff-field input[type="text"], .ff-field input[type="email"], .ff-field input[type="tel"], .ff-field input[type="number"],
.ff-field input[type="date"], .ff-field input[type="time"], .ff-field textarea, .ff-field select {
  width: 100%; background: #0f0e12; color: var(--text); border: 1px solid rgba(166,135,47,0.5);
  border-radius: 8px; padding: 11px 13px; font: 0.95rem var(--font-body, 'Raleway', sans-serif); color-scheme: dark;
}
.ff-field textarea { resize: vertical; line-height: 1.5; }
.ff-field input:focus, .ff-field textarea:focus, .ff-field select:focus { outline: none; border-color: var(--gold-light); }
.ff-field.ff-invalid input, .ff-field.ff-invalid textarea, .ff-field.ff-invalid select, .ff-field.ff-invalid .ff-sig-wrap, .ff-field.ff-invalid .ff-drop { border-color: #ff6b5e; }

.ff-options { display: flex; gap: 10px 24px; flex-wrap: wrap; }
.ff-options.ff-stack { flex-direction: column; }
.ff-options.ff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.ff-check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: 0.92rem; line-height: 1.45; color: var(--text); }
.ff-check input { width: 18px; height: 18px; margin-top: 1px; flex-shrink: 0; accent-color: var(--hot); }

.ff-sig-wrap { position: relative; background: #fff; border-radius: 10px; border: 2px solid var(--gold); overflow: hidden; }
.ff-sig { display: block; width: 100%; height: 200px; touch-action: none; cursor: crosshair; }
.ff-sig-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #9a9a9a; pointer-events: none; font-size: 0.9rem; }

.ff-drop { border: 2px dashed rgba(166,135,47,0.6); border-radius: 10px; padding: 16px; text-align: center; color: var(--muted); font-size: 0.88rem; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.ff-drop:hover, .ff-drop.ff-over { border-color: var(--orange); background: rgba(255,140,66,0.06); }
.ff-files { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ff-files li { display: flex; align-items: center; gap: 10px; background: #0f0e12; border: 1px solid rgba(166,135,47,0.3); border-radius: 8px; padding: 6px 10px; font-size: 0.85rem; }
.ff-files img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.ff-files span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ff-files button { background: none; border: none; color: #ff8a8d; cursor: pointer; font-size: 1.1rem; }

.ff-date-btn { text-align: left; width: 100%; background: #0f0e12; color: var(--muted); border: 1px solid rgba(166,135,47,0.5);
  border-radius: 8px; padding: 11px 13px; font: 0.95rem var(--font-body, 'Raleway', sans-serif); cursor: pointer; }
.ff-date-btn.has { color: var(--text); }
.ff-date-btn::after { content: '📅'; float: right; }
.ff-date-btn:focus { outline: none; border-color: var(--gold-light); }
.ff-field.ff-invalid .ff-date-btn { border-color: #ff6b5e; }
.ff-cal { background: #0f0e12; border: 2px solid var(--orange); border-radius: 12px; padding: 12px; max-width: 340px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.ff-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ff-cal-head strong { font-family: var(--font-head, 'Cinzel', serif); color: var(--gold-light); font-size: 0.95rem; }
.ff-cal-head button { background: none; border: 1px solid rgba(166,135,47,0.5); color: var(--orange); border-radius: 6px; width: 32px; height: 32px; font-size: 1.1rem; cursor: pointer; }
.ff-cal-head button:disabled { opacity: .3; cursor: default; }
.ff-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.ff-cal-grid em { font-style: normal; font-size: 0.72rem; color: var(--muted); padding: 4px 0; }
.ff-cal-grid button { background: rgba(255,255,255,0.04); border: 1px solid transparent; color: var(--text); border-radius: 6px; padding: 8px 0; font: 600 0.85rem var(--font-body, 'Raleway', sans-serif); cursor: pointer; }
.ff-cal-grid button:hover:not(:disabled) { border-color: var(--orange); }
.ff-cal-grid button.today { border-color: rgba(166,135,47,0.6); }
.ff-cal-grid button.on { background: var(--hot); color: #fff; }
.ff-cal-grid button:disabled { background: none; color: #4a4750; text-decoration: line-through; cursor: not-allowed; }

/* Coloured notes for Information text (use class="ff-red" / "ff-blue" in the HTML) */
.ff-red, .ff-text .ff-red { color: #ff6b5e; }
.ff-blue, .ff-text .ff-blue { color: #8fa8ff; }
.ff-red strong, .ff-red b, .ff-blue strong, .ff-blue b { color: inherit; }

.ff-basket { display: flex; flex-direction: column; gap: 8px; }
.ff-basket-item { display: flex; align-items: center; gap: 10px; background: #0f0e12; border: 1px solid rgba(166,135,47,0.4); border-radius: 10px; padding: 8px 10px; }
.ff-basket-item img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }
.ff-basket-icon { width: 48px; text-align: center; font-size: 1.4rem; }
.ff-basket-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ff-basket-main strong { font-size: 0.9rem; color: var(--text); }
.ff-basket-main small { color: var(--muted); font-size: 0.8rem; }
.ff-qty { display: inline-flex; align-items: center; gap: 6px; }
.ff-qty button { width: 28px; height: 28px; border-radius: 6px; border: 1px solid rgba(166,135,47,0.5); background: none; color: var(--orange); cursor: pointer; font-size: 1rem; }
.ff-basket-del { background: none; border: none; color: #ff8a8d; cursor: pointer; font-size: 1rem; }
.ff-basket-more { font-size: 0.85rem; }

.ff-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ff-error { color: #ff8a8d; min-height: 1.2em; margin: 18px 0 0; font-size: 0.9rem; }

.ff-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; }
.ff-nav .ff-next, .ff-nav .ff-submit { margin-left: auto; }

.ff-btn {
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  background: #0d0d10; color: var(--orange); border: 2px solid var(--hot); border-radius: 8px;
  padding: 12px 24px; font: 700 0.8rem var(--font-body, 'Raleway', sans-serif); letter-spacing: 1px; text-transform: uppercase;
  cursor: pointer; box-shadow: 0 0 14px rgba(255,87,34,0.45); transition: all 0.25s ease;
}
.ff-btn:hover { color: #ffd4ab; border-color: #ffb37a; box-shadow: 0 0 24px rgba(255,87,34,0.8); }
.ff-btn:disabled { opacity: 0.5; cursor: wait; }
.ff-btn-primary { border-color: var(--violet); box-shadow: 0 0 0 1px rgba(88,101,242,0.4), 0 0 16px rgba(255,87,34,0.5); }
.ff-btn-ghost { border-color: rgba(166,135,47,0.5); color: var(--muted); box-shadow: none; }
.ff-btn-small { padding: 7px 14px; font-size: 0.7rem; align-self: flex-start; }

.ff-done { text-align: center; color: var(--muted); line-height: 1.7; padding: 20px 0; }
.ff-done h2 { font-family: var(--font-head, 'Cinzel', serif); color: var(--gold-light); }

.ff-footer { text-align: center; color: var(--muted); font-size: 0.75rem; padding: 0 20px 30px; }

/* Embedded in another page (e.g. WordPress): no header, fits the space */
body.ff-embed { background: transparent; }
body.ff-embed .ff-header, body.ff-embed .ff-footer { display: none; }
body.ff-embed .ff-main { margin: 0 auto; max-width: none; }
/* Inside a site pop-up that already has its own frame */
html.ff-embed-html { background: transparent; }
body.ff-bare .ff-main, body.ff-bare.ff-embed .ff-main { border: none; box-shadow: none; background: transparent; padding: 8px 10px 14px; border-radius: 0; }

@media (max-width: 640px) {
  .ff-header { padding: 14px 16px; }
  .ff-header h1 { font-size: 1.05rem; }
  .ff-header img { height: 44px; }
  .ff-main { margin: 0; border-radius: 0; border-left: none; border-right: none; padding: 20px 16px; }
  body.ff-embed .ff-main { border-radius: 12px; border: 2px solid var(--orange); }
  .ff-step > .ff-half { flex-basis: 100%; }
  .ff-options.ff-grid { grid-template-columns: 1fr; }
  .ff-sig { height: 180px; }
}

/* Steps slide in */
.ff-in-next { animation: ff-slide-next 0.35s ease; }
.ff-in-back { animation: ff-slide-back 0.35s ease; }
@keyframes ff-slide-next { from { opacity: 0; transform: translateX(50px); } to { opacity: 1; transform: none; } }
@keyframes ff-slide-back { from { opacity: 0; transform: translateX(-50px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ff-in-next, .ff-in-back { animation: none; } }