/* Fulanea Brand System (Stage 1)
 * Colors and fonts are controlled by CSS variables updated automatically from Settings.
 */
:root {
  --butter: #F0E6C9;
  --cobalt: #294F91;
  --sage: #A8B6A0;
  --coral: #D66B4E;
  --mushroom: #6C695D;

  --surface: #FFFDF7;
  --surface-tint: #F7F1DF;
  --ink: #1E2430;
  --border: rgba(41, 79, 145, 0.14);
  --radius: 16px;
  --shadow: 0 10px 30px rgba(41, 79, 145, 0.08);

  --font-display: 'Bricolage Grotesque', 'Sora', 'Outfit', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--butter);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--cobalt);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--cobalt);
  text-transform: lowercase;
  letter-spacing: -0.025em;
  margin-top: 0;
  line-height: 1.15;
}

h1 { font-size: clamp(1.9rem, 4.5vw, 2.65rem); margin-bottom: 0.55rem; }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); margin-bottom: 0.5rem; }
h3 { font-size: 1.12rem; margin-bottom: 0.35rem; }

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top Navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(240, 230, 201, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1220px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none !important;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.85rem;
  color: var(--cobalt);
  letter-spacing: -0.04em;
  line-height: 1;
}

.brand-logo-img {
  max-height: 36px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-pill {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cobalt);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.16s ease, background-color 0.16s ease;
}

.nav-pill:hover {
  background: rgba(41, 79, 145, 0.08);
  text-decoration: none;
  transform: translateY(-1px);
}

.nav-pill.active {
  background: var(--cobalt);
  color: var(--butter);
}

/* Main Content */
.app-main {
  flex: 1;
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

.narrow-wrap {
  max-width: 760px;
  margin: 0 auto;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.row-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 720px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 760px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card-sage {
  background: rgba(168, 182, 160, 0.22);
  border: 1px solid rgba(168, 182, 160, 0.65);
}

.muted {
  color: var(--mushroom);
  font-size: 0.92rem;
}

.small-text {
  font-size: 0.82rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-sage {
  background: rgba(168, 182, 160, 0.35);
  color: var(--ink);
}

.badge-cobalt {
  background: rgba(41, 79, 145, 0.12);
  color: var(--cobalt);
}

.badge-coral {
  background: var(--coral);
  color: #FFFFFF;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 19px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 0.94rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease, box-shadow 0.16s ease;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.84rem;
  border-radius: 10px;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(41, 79, 145, 0.15);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--cobalt);
  color: #FFFFFF;
}

.btn-secondary {
  background: var(--surface-tint);
  color: var(--cobalt);
  border-color: var(--border);
}

.btn-coral {
  background: var(--coral);
  color: #FFFFFF;
}

.btn-ghost {
  background: transparent;
  color: var(--mushroom);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(108, 105, 93, 0.1);
  box-shadow: none;
  transform: none;
}

/* Forms */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

.field .hint {
  font-size: 0.8rem;
  color: var(--mushroom);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1.5px solid rgba(108, 105, 93, 0.3);
  background: #FFFFFF;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--cobalt);
  box-shadow: 0 0 0 3px rgba(41, 79, 145, 0.15);
}

.color-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-swatch {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 2px;
  background: #FFFFFF;
  cursor: pointer;
}

/* Status Box */
.status-box {
  padding: 15px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-tint);
  font-size: 0.94rem;
}

.status-box.ok {
  background: rgba(168, 182, 160, 0.28);
  border-color: var(--sage);
}

.status-box.err {
  background: rgba(214, 107, 78, 0.14);
  border-color: var(--coral);
  color: var(--ink);
}

/* Swatch Preview Strip */
.palette-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.swatch-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
}

.swatch-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

/* Stage 1: Multi-Step Questionnaire */
.wizard-progress {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}

.wizard-step-bar {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: rgba(41, 79, 145, 0.14);
  transition: background-color 0.25s ease;
}

.wizard-step-bar.done {
  background: var(--sage);
}

.wizard-step-bar.current {
  background: var(--cobalt);
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 620px) {
  .choice-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.service-choice {
  text-align: left;
  padding: 20px;
  border-radius: 16px;
  border: 2px solid var(--border);
  background: #FFFFFF;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.service-choice:hover {
  transform: translateY(-2px);
  border-color: var(--cobalt);
}

.service-choice.selected {
  border-color: var(--cobalt);
  background: rgba(41, 79, 145, 0.06);
  box-shadow: 0 8px 20px rgba(41, 79, 145, 0.12);
}

.service-choice-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--cobalt);
  text-transform: lowercase;
  margin-bottom: 6px;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice-chip {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #FFFFFF;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.14s ease;
}

.choice-chip:hover {
  border-color: var(--cobalt);
}

.choice-chip.selected {
  background: var(--cobalt);
  color: #FFFFFF;
  border-color: var(--cobalt);
}

.upload-zone {
  border: 2px dashed rgba(41, 79, 145, 0.3);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  background: var(--surface-tint);
  cursor: pointer;
}

.upload-zone:hover {
  border-color: var(--cobalt);
}

.upload-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.upload-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 10px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  font-size: 0.88rem;
}

/* Honeypot hidden field (invisible to humans) */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Playful success tick animation */
.success-tick {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--sage);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 16px;
  animation: popIn 0.35s ease;
}

@keyframes popIn {
  0% { transform: scale(0.6); opacity: 0; }
  75% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

/* Stage 1: Leads Pipeline Kanban Board */
.pipeline-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(235px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
  align-items: start;
}

.pipeline-col {
  background: rgba(255, 253, 247, 0.72);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  min-height: 360px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.pipeline-col.drag-over {
  background: rgba(168, 182, 160, 0.32);
  border-color: var(--cobalt);
}

.pipeline-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.pipeline-col-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--cobalt);
  text-transform: lowercase;
}

.pipeline-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lead-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 4px 12px rgba(41, 79, 145, 0.06);
  cursor: grab;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.lead-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(41, 79, 145, 0.12);
}

.lead-card.dragging {
  opacity: 0.45;
}

.lead-card-name {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.98rem;
  margin-bottom: 2px;
}

.lead-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.lead-card-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(41, 79, 145, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.lead-card-actions select {
  padding: 5px 8px;
  font-size: 0.78rem;
  border-radius: 8px;
  width: auto;
  flex: 1;
}

/* Modal / Drawer */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30, 36, 48, 0.48);
  backdrop-filter: blur(4px);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

.modal-panel {
  background: var(--surface);
  border-radius: 18px;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
}

.qa-item {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-tint);
  margin-bottom: 10px;
}

.qa-q {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mushroom);
  margin-bottom: 4px;
}

.qa-a {
  font-size: 0.95rem;
  color: var(--ink);
  white-space: pre-wrap;
}

/* Tabs for Questionnaire Editor */
.tab-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.editor-q-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}

/* Skeleton Loaders */
.skeleton {
  background: linear-gradient(90deg, rgba(168,182,160,0.2) 25%, rgba(168,182,160,0.38) 50%, rgba(168,182,160,0.2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
  border-radius: 10px;
}

.skeleton-title { height: 32px; width: 45%; margin-bottom: 16px; }
.skeleton-line { height: 16px; width: 100%; margin-bottom: 10px; }
.skeleton-line.short { width: 65%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
}

.toast {
  background: var(--cobalt);
  color: #FFFFFF;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
  animation: fadeUp 0.2s ease;
}

.toast.toast-error {
  background: var(--coral);
  color: #FFFFFF;
}

.toast.toast-success {
  background: var(--cobalt);
  color: var(--butter);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Footer */
.app-footer {
  max-width: 1220px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--mushroom);
  border-top: 1px solid var(--border);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}