/**
 * Partner brief intake — /partner-brief/?token=XXX
 * Bound to the CleanMyBed design tokens (site.css) so it matches the
 * homepage standard exactly: same type scale, spacing, radii, shadows,
 * surfaces and violet. Styling only, scoped to .brief-page; markup +
 * form logic untouched.
 */

.brief-page {
  --brief-primary: var(--color-brand-primary);
  --brief-primary-dark: var(--color-brand-primary-dark);
  --brief-primary-soft: #f4edfa;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  line-height: var(--line-height-base);
  background: var(--surface-0);
  min-height: 100vh;
}
.brief-page *, .brief-page *::before, .brief-page *::after { box-sizing: border-box; }

/* Loading / error / thanks state */
.brief-state {
  max-width: 560px;
  margin: var(--space-24) auto;
  padding: var(--space-12) var(--space-8);
  text-align: center;
  background: var(--surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}
.brief-state h1 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-3);
  color: var(--text-primary);
}
.brief-state__detail { font-size: var(--font-size-lg); color: var(--text-secondary); margin: 0 0 var(--space-3); }
.brief-state__hint { font-size: var(--font-size-sm); color: var(--text-muted); margin: 0; }
.brief-spinner {
  width: 30px; height: 30px;
  border: 2.5px solid var(--brief-primary-soft);
  border-top-color: var(--brief-primary);
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-4);
  animation: brief-spin 0.8s linear infinite;
}
@keyframes brief-spin { to { transform: rotate(360deg); } }

/* App */
.brief-app {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 var(--space-6) var(--space-32);
}

/* Intro — premium hero band, matches the homepage hero gradient */
.brief-intro {
  text-align: center;
  margin: 0 calc(-1 * var(--space-6)) var(--space-12);
  padding: var(--space-20) var(--space-8) var(--space-16);
  background: linear-gradient(180deg, var(--surface-1) 0%, var(--surface-0) 100%);
  border-bottom: 1px solid var(--border-subtle);
}
.brief-intro__eyebrow {
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--brief-primary);
  font-weight: var(--font-weight-semibold);
  margin: 0 0 var(--space-3);
}
.brief-intro__title {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.025em;
  line-height: var(--line-height-tight);
  color: var(--text-primary);
  margin: 0 0 var(--space-4);
}
.brief-intro__body {
  font-size: var(--font-size-xl);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
  max-width: 580px;
  margin: 0 auto;
}
.brief-intro__terms {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin: var(--space-5) auto 0;
  max-width: 560px;
  padding: var(--space-3) var(--space-5);
  background: var(--color-brand-primary-alpha-8);
  border-radius: var(--radius-md);
  display: inline-block;
}
.brief-intro__terms code {
  font-family: 'SFMono-Regular', Consolas, monospace;
  background: var(--surface-0);
  border: 1px solid var(--color-brand-primary-alpha-20);
  color: var(--brief-primary-dark);
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  font-weight: var(--font-weight-semibold);
}

/* Tabs */
.brief-tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-10);
  overflow-x: auto;
  scrollbar-width: none;
}
.brief-tabs::-webkit-scrollbar { display: none; }
.brief-tab {
  background: transparent;
  border: none;
  padding: var(--space-4) var(--space-5);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  white-space: nowrap;
  font-family: inherit;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.brief-tab:hover { color: var(--text-primary); }
.brief-tab.is-active {
  color: var(--brief-primary);
  border-bottom-color: var(--brief-primary);
  font-weight: var(--font-weight-bold);
}

/* Panels */
.brief-form { position: relative; }
.brief-panel { display: none; animation: brief-fade 0.25s ease; }
.brief-panel.is-active { display: block; }
@keyframes brief-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.brief-panel__desc {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
  margin: 0 0 var(--space-8);
  max-width: 640px;
}

/* Sections within a panel */
.brief-subsection {
  margin-top: var(--space-10);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border-subtle);
}
.brief-subsection:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.brief-subsection__title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 0 0 var(--space-2);
}
.brief-subsection__desc { font-size: var(--font-size-sm); color: var(--text-secondary); margin: 0 0 var(--space-5); }

/* Fields */
.brief-field { margin-bottom: var(--space-5); }
.brief-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
@media (max-width: 560px) { .brief-row { grid-template-columns: 1fr; } }
.brief-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}
.brief-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-family: inherit;
  background: var(--surface-0);
  color: var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.brief-input::placeholder { color: var(--text-tertiary); }
.brief-input:focus {
  outline: none;
  border-color: var(--brief-primary);
  box-shadow: 0 0 0 4px var(--color-brand-primary-alpha-15);
}
.brief-input--mono { font-family: 'SFMono-Regular', Consolas, monospace; letter-spacing: 0.04em; }
textarea.brief-input { resize: vertical; min-height: 64px; line-height: var(--line-height-base); }
.brief-help { font-size: var(--font-size-sm); color: var(--text-muted); margin: var(--space-2) 0 0; }

/* Colour pickers */
.brief-colour-row { display: flex; gap: var(--space-2); align-items: stretch; }
.brief-swatch {
  width: 48px; height: 46px; padding: 3px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-0);
  cursor: pointer; flex-shrink: 0;
}
.brief-colour-row .brief-input { flex: 1; }

/* Upload — premium card (homepage card standard) */
.brief-upload {
  margin-bottom: var(--space-4);
  padding: var(--space-5);
  background: var(--surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}
.brief-upload:hover { box-shadow: var(--shadow-lg); border-color: var(--color-brand-primary-alpha-20); }
.brief-upload__title { font-size: var(--font-size-sm); font-weight: var(--font-weight-bold); color: var(--text-primary); margin: 0 0 var(--space-1); }
.brief-upload__hint { font-size: var(--font-size-sm); color: var(--text-muted); margin: 0 0 var(--space-4); }
.brief-upload__row { display: flex; align-items: center; gap: var(--space-5); }
.brief-upload__thumb {
  width: 88px; height: 66px; flex-shrink: 0;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.brief-upload__thumb--dark { background: var(--surface-dark); border-color: #2a2233; }
.brief-upload__thumb--lg { width: 152px; height: 96px; }
.brief-upload__thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brief-upload__thumb--dark .brief-upload__placeholder { color: rgba(255,255,255,0.45); }
.brief-upload__placeholder { font-size: var(--font-size-xs); color: var(--text-muted); text-align: center; padding: 4px; }
.brief-upload__controls { flex: 1; display: flex; flex-direction: column; gap: var(--space-3); }
.brief-upload__file { font-size: var(--font-size-sm); color: var(--text-secondary); }
.brief-upload__file::file-selector-button {
  font-family: inherit;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--brief-primary);
  background: var(--brief-primary-soft);
  border: 1px solid var(--color-brand-primary-alpha-20);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  margin-right: var(--space-3);
  cursor: pointer;
  transition: background 0.15s ease;
}
.brief-upload__file::file-selector-button:hover { background: #ebe0f6; }

/* Lists (paragraphs / credentials) */
.brief-list { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-3); }
.brief-list__row { display: flex; gap: var(--space-3); align-items: stretch; }
.brief-list__row .brief-input { flex: 1; }

/* Buttons */
.brief-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.brief-btn--primary {
  background: linear-gradient(135deg, var(--brief-primary) 0%, var(--brief-primary-dark) 100%);
  color: var(--text-inverse);
  box-shadow: 0 4px 14px var(--color-brand-primary-alpha-20);
}
.brief-btn--primary:hover { transform: translateY(-1px); box-shadow: 0 10px 26px var(--color-brand-primary-alpha-35); }
.brief-btn--primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.brief-btn--ghost { background: var(--surface-0); color: var(--text-primary); border-color: var(--border-subtle); }
.brief-btn--ghost:hover { border-color: var(--brief-primary); color: var(--brief-primary); }
.brief-btn--ghost:disabled { opacity: 0.4; cursor: not-allowed; }
.brief-btn--sm { padding: var(--space-2) var(--space-3); font-size: var(--font-size-xs); border-radius: var(--radius-sm); }
.brief-btn--lg { padding: var(--space-4) var(--space-8); font-size: var(--font-size-base); }

/* Review cards */
.brief-review {
  background: var(--surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
}
.brief-review h3 { font-size: var(--font-size-lg); font-weight: var(--font-weight-bold); color: var(--text-primary); margin: 0 0 var(--space-3); }
.brief-review p, .brief-review ol { font-size: var(--font-size-sm); color: var(--text-secondary); line-height: var(--line-height-relaxed); margin: 0; }
.brief-review ol { padding-left: var(--space-5); }
.brief-review ol li { margin-bottom: var(--space-2); }
.brief-review--cta {
  background: linear-gradient(135deg, var(--brief-primary-soft) 0%, var(--surface-0) 100%);
  border-color: var(--color-brand-primary-alpha-20);
  text-align: center;
}
.brief-review--cta h3 { color: var(--brief-primary-dark); }
.brief-review--cta .brief-btn { margin-top: var(--space-2); }

/* Sticky save bar */
.brief-savebar {
  position: sticky;
  bottom: var(--space-4);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  margin-top: var(--space-8);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
}
.brief-savebar__status { font-size: var(--font-size-sm); color: var(--text-secondary); }
.brief-savebar__buttons { display: flex; gap: var(--space-3); flex-shrink: 0; }
@media (max-width: 560px) {
  .brief-savebar { flex-direction: column; align-items: stretch; }
  .brief-savebar__buttons { justify-content: stretch; }
  .brief-savebar__buttons .brief-btn { flex: 1; }
}

/* Footer — matches the real CleanMyBed site footer (dark, white logo) */
.brief-foot {
  padding: var(--space-12) var(--space-6) var(--space-16);
  text-align: center;
  background: var(--surface-dark);
}
.brief-foot__logo {
  height: 26px; width: auto; aspect-ratio: auto;
  display: inline-block;
  margin-bottom: var(--space-4);
  opacity: 1;
}
.brief-foot p {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  line-height: var(--line-height-relaxed);
  margin: 0 auto;
  max-width: 480px;
}
