/*
 * Stylesheet for the GFM conversation wizard.
 *
 * Inspired by GoFundMe’s creation flow, this stylesheet uses a neutral
 * palette with green highlights to guide users through eight steps. It
 * includes a custom toggle switch for subscription and fee options and
 * responsive layouts for smaller screens.
 */
:root {
  /* Updated colour palette based on client specification. Purple is the primary brand colour
     and deep blue is used for hovers and accents. */
  --gfm-primary: #681ED9;
  --gfm-primary-hover: #103A70;
  --gfm-light-grey: #f5f5f5;
  --gfm-dark-text: #333;
  --gfm-accent: #103A70;
  --gfm-border: #e9e9ee;
  --gfm-soft: #f6f6fa;
}

.gfm-conv-wrapper {
  max-width: 900px;
  margin: 48px auto;
  background: #fff;
  border: 1px solid #e9e9ee;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif;
}

/* Topbar */
.gfm-topbar {
  display: flex;
  justify-content: flex-end;
  padding: 18px 22px 0;
}
.gfm-step-indicator {
  font-size: 0.85rem;
  color: #6b6f76;
  background: #f6f6fa;
  border: 1px solid #ececf3;
  border-radius: 999px;
  padding: 6px 12px;
  line-height: 1;
}
.gfm-step-indicator .sep { margin: 0 6px; opacity: 0.7; }

/* Progress bar */
.gfm-progress {
  display: flex;
  width: 100%;
  height: 8px;
  background: var(--gfm-light-grey);
}
.gfm-progress span {
  flex: 1;
  background: var(--gfm-light-grey);
  transition: background 0.3s ease;
}
.gfm-progress span.active {
  background: var(--gfm-primary);
}

/* Form wrapper */
#gfm-conversation-form {
  padding: 28px 36px 38px;
}
.gfm-step {
  display: none;
}
.gfm-step.active {
  display: block;
}
.gfm-step h2 {
  margin-top: 0;
  font-size: 2.05rem;
  letter-spacing: -0.02em;
  color: var(--gfm-dark-text);
}
.gfm-step p.desc,
.gfm-step .helpful-tip {
  color: #666;
  margin-bottom: 22px;
  font-size: 1.02rem;
  line-height: 1.55;
}
.gfm-step .helpful-tip ul {
  margin: 0 0 0 20px;
  list-style: disc;
}
/* Inputs */
.gfm-step input[type="text"],
.gfm-step input[type="number"],
.gfm-step input[type="email"],
.gfm-step input[type="url"],
.gfm-step textarea,
.gfm-step select {
  width: 100%;
  padding: 13px 14px;
  margin-bottom: 18px;
  border: 1px solid #dadbe2;
  border-radius: 12px;
  font-size: 1rem;
  box-sizing: border-box;
  background: #fff;
}
.gfm-step input::placeholder,
.gfm-step textarea::placeholder {
  color: #9aa0a6;
}
.gfm-step textarea {
  min-height: 100px;
  resize: vertical;
}
.gfm-step label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #222;
}

/* Clean up wp_editor chrome a bit */
.gfm-conv-wrapper .wp-editor-wrap {
  border: 1px solid #dadbe2;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 18px;
}
.gfm-conv-wrapper .wp-editor-wrap .wp-editor-container {
  border: 0;
}
.gfm-conv-wrapper .wp-editor-wrap .mce-top-part::before {
  box-shadow: none;
}

/* Buttons */
.gfm-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  gap: 12px;
}
.gfm-buttons button {
  padding: 12px 22px;
  font-size: 1rem;
  border: none;
  /* Use a very large border radius to create pill‑shaped buttons */
  border-radius: 999px;
  cursor: pointer;
  min-width: 140px;
}
/* Button colours for default, hover and previous actions */
.gfm-buttons .prev-step {
  background: #d9d9d9;
  color: #333;
}
.gfm-buttons .next-step,
.gfm-buttons .submit-campaign {
  background: var(--gfm-primary);
  color: #fff;
}
.gfm-buttons .next-step:hover,
.gfm-buttons .submit-campaign:hover {
  background: var(--gfm-primary-hover);
}
.gfm-buttons .prev-step:hover {
  background: #c2c2c2;
}

/* Category selection bubbles */
.category-bubbles {
  margin-bottom: 15px;
}
.category-bubble {
  display: inline-block;
  padding: 6px 16px;
  margin: 4px 6px 4px 0;
  border: 1px solid var(--gfm-primary);
  border-radius: 999px;
  background: #fff;
  color: var(--gfm-primary);
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s ease, color 0.2s ease;
}

/* Callouts & tips */
.gfm-callout,
.gfm-tip {
  border: 1px solid #ececf3;
  background: #fafafe;
  border-radius: 14px;
  padding: 16px;
  margin: 0 0 18px;
}
.gfm-callout-title,
.gfm-tip-title {
  font-weight: 700;
  color: #1f2330;
  margin-bottom: 6px;
}
.gfm-callout-body,
.gfm-tip-body {
  color: #5b5f66;
  font-size: 0.98rem;
  line-height: 1.5;
}
.gfm-tip-list {
  margin: 12px 0 0 18px;
  color: #5b5f66;
}
.gfm-callout-actions { margin-top: 12px; }
.gfm-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--gfm-primary);
  color: var(--gfm-primary);
  border-radius: 999px;
  padding: 10px 16px;
  text-decoration: none;
  font-weight: 700;
}
.gfm-link-btn:hover { background: rgba(104,30,217,0.08); }
.category-bubble.selected {
  background: var(--gfm-primary);
  color: #fff;
}

/* Toggle switch */
.toggle-row {
  margin-bottom: 25px;
  display: flex;
  flex-direction: column;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  margin-right: 12px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}
.toggle-switch .slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}
.toggle-switch input:checked + .slider {
  background-color: var(--gfm-primary);
}
.toggle-switch input:focus + .slider {
  box-shadow: 0 0 1px var(--gfm-primary);
}
.toggle-switch input:checked + .slider:before {
  transform: translateX(24px);
}
.toggle-label {
  display: inline-block;
  margin-left: 10px;
  font-weight: 500;
}
.toggle-row p.desc {
  margin-top: 5px;
  margin-left: 62px;
  font-size: 0.85rem;
  color: #666;
}
.fee-label {
  margin-top: 10px;
  font-weight: 500;
}

/* Reward section */
.reward-group {
  border: 1px solid #e5e5e5;
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 4px;
  background: #fafafa;
  position: relative;
}

/* Gallery previews */
.gallery-previews img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
  margin: 0 8px 8px 0;
  border: 1px solid #ececf3;
}

@media (max-width: 640px) {
  .gfm-conv-wrapper { margin: 18px 12px; }
  #gfm-conversation-form { padding: 20px 18px 26px; }
  .gfm-step h2 { font-size: 1.6rem; }
  .gfm-buttons button { min-width: 0; flex: 1; }
}
.reward-group .remove-reward {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #f44336;
  color: #fff;
  border: none;
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
}

.image-preview {
  margin-bottom: 10px;
  max-width: 100%;
  height: auto;
  display: none;
}
.gallery-previews img {
  max-width: 80px;
  margin-right: 8px;
  margin-bottom: 8px;
  border-radius: 4px;
}

/* Review section */
.review-section {
  padding: 15px;
  border: 1px solid #e5e5e5;
  background: #fafafa;
  border-radius: 4px;
  margin-bottom: 20px;
  font-size: 0.95rem;
}
.review-section h3 {
  margin-top: 0;
  font-size: 1.2rem;
  color: var(--gfm-dark-text);
}
.review-section dl {
  display: flex;
  flex-wrap: wrap;
}
.review-section dt {
  width: 40%;
  font-weight: 600;
  margin-bottom: 5px;
}
.review-section dd {
  width: 60%;
  margin: 0 0 5px;
}

/* Terms */
.terms {
  margin: 20px 0;
  font-size: 0.9rem;
}
.terms input[type="checkbox"] {
  margin-right: 8px;
}

/* Validation */
.gfm-error-summary {
  margin: 14px 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(220, 38, 38, 0.25);
  background: rgba(220, 38, 38, 0.06);
  border-radius: 14px;
}
.gfm-error-summary-title {
  font-weight: 700;
  margin-bottom: 8px;
}
.gfm-error-summary ul {
  margin: 0;
  padding-left: 18px;
}
.gfm-error-msg {
  margin-top: 6px;
  font-size: 0.92rem;
  color: #b91c1c;
}
.gfm-invalid {
  border-color: rgba(185, 28, 28, 0.55) !important;
  box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.12) !important;
}

/* Responsive */
@media (max-width: 600px) {
  .gfm-buttons {
    flex-direction: column;
  }
  .gfm-buttons button {
    width: 100%;
    margin-bottom: 10px;
  }
  .toggle-row {
    flex-direction: column;
  }
  .toggle-row p.desc {
    margin-left: 0;
  }
}
