/* 1) Import THG brand fonts */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+Pro:wght@300;400;600;700&display=swap');
/* Museo Sans isn’t on Google Fonts; if you host it, you can @font-face here. Otherwise fallback to 'Segoe UI'. */

/* 2) Root palette (from page 20: Slate #333F48, Yellow #FFC72C, Light Gray #D9D9D6) */
:root {
  --color-bg: #D9D9D6;
  --color-surface: #FFFFFF;
  --color-primary: #333F48;
  --color-primary-light: #556270;
  --color-accent: #FFC72C;
  --color-accent-light: #FFE187;
  --color-danger: #EF4444;
  --color-text: #333F48;
  --color-text-light: #4B5563;
  --color-border: #CCCCCC;
  --color-card-bg: #FFFFFF;
}

/* 3) Base resets */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Source Serif Pro', serif;
  background: var(--color-bg);
  color: var(--color-text);
}

/* 4) Typography */
h1, h2, h4 {
  font-family: 'Museo Sans', 'Segoe UI', sans-serif;
  color: var(--color-primary);
}
p, small, label {
  font-family: 'Source Serif Pro', serif;
}

/* 5) Sections & cards */
.section {
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem;
  background: var(--color-surface);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent); /* fun accent */
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* 6) Tabs: allow wrap so they don’t overflow */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.tab {
  flex: 0 1 auto;
  background: var(--color-accent);
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  text-align: center;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: background 0.2s;
}
.tab.active {
  background: var(--color-primary);
}

/* 7) Forms & fields */
.field {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}
.field label {
  width: 140px;
  font-weight: 600;
  color: var(--color-text-light);
}
input, select, textarea {
  flex: 1;
  padding: 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* 8) Buttons */
button {
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: var(--color-primary);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-right: 0.5rem;
}
button:hover {
  background: var(--color-primary-light);
  transform: translateY(-1px);
}
button:active {
  transform: translateY(0);
}
button.danger {
  background: var(--color-danger);
}
button.danger:hover {
  background: #f87171;
}

/* 9) Log & error */
.error {
  color: var(--color-danger);
  margin-top: 0.5rem;
}

/* 10) Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}
th, td {
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  text-align: left;
}
th {
  background: var(--color-primary);
  color: #fff;
  font-family: 'Museo Sans', sans-serif;
}
td {
  background: var(--color-surface);
}

/* 11) Misc */
.hidden { display: none; }
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}
.content-area {
  padding: 1rem;
}
small {
  color: var(--color-text-light);
}

/* 12) Pairings tab: opt-in toggle card */
.opt-in-card {
  border-left-color: var(--color-accent);
  margin-bottom: 1rem;
  display: flex;
  justify-content: flex-end;
}
.opt-in-field {
  align-items: center;
  display: flex;
  gap: 0.5rem;
}
.opt-in-field label {
  font-weight: 600;
  color: var(--color-text);
}
#optInToggle {
  width: 1.2rem;
  height: 1.2rem;
  cursor: pointer;
}

/* 13) Scrollable tabs on very narrow screens */
@media (max-width: 600px) {
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
