/* Shared CSS for thanks.html and result.html. Served from /style.css and
 * cached for an hour. If you add a third page, extend this file rather
 * than re-embedding rules in the new template. */

:root {
  --light: #faf8f8;
  --dark: #141021;
  --secondary: #FF5D62;
  --tertiary: #3150AA;
  --primary: #f28482;
  --gray: #4e4e4e;
  --lightgray: #f0f0f0;
  --outlinegray: #dadada;
  --bg: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --light: #1F1F28;
    --dark: #FF5D62;
    --secondary: #658594;
    --tertiary: #E46876;
    --primary: #D27E99;
    --gray: #DCD7BA;
    --lightgray: #181820;
    --outlinegray: #C8C093;
    --bg: #181820;
  }
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--gray);
  line-height: 1.55;
  margin: 0;
  padding: 2rem 1rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  max-width: 34rem;
  width: 100%;
  background: var(--light);
  border: 1px solid var(--outlinegray);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.hero {
  background: linear-gradient(135deg, rgba(255, 93, 98, 0.10) 0%, rgba(210, 126, 153, 0.10) 100%);
  border-radius: 12px;
  padding: 2rem 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.logo {
  display: inline-block;
  width: 72px;
  height: 72px;
  margin-bottom: 1rem;
}

h1 {
  font-weight: 500;
  font-size: 2rem;
  margin: 0 0 0.5rem;
  background: linear-gradient(135deg, var(--secondary), var(--tertiary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  margin: 0;
  font-size: 1.05rem;
  color: var(--gray);
}

.subtitle code {
  background: rgba(255, 93, 98, 0.10);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.95rem;
}

/* Bar chart on /result/<id>. Unused by /thanks; harmless when not rendered. */
.results {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0 0 1.5rem;
  text-align: left;
}

.row {
  display: grid;
  grid-template-columns: minmax(6rem, 28%) 1fr auto;
  align-items: center;
  gap: 0.75rem;
}

.answer {
  font-weight: 600;
  color: var(--gray);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 1.6rem;
  background: var(--lightgray);
  border: 1px solid var(--outlinegray);
  border-radius: 6px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(135deg, var(--secondary), var(--tertiary));
  border-radius: 6px 0 0 6px;
  min-width: 2px;
  transition: width 0.4s ease;
}

.count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--gray);
  min-width: 2.5rem;
  text-align: right;
}

.empty {
  color: var(--gray);
  opacity: 0.7;
  margin: 2rem 0;
}

/* Landing page (/{id}) vote buttons. Stacked vertically, brand-coloured.
 * Uses the same --secondary / --tertiary palette as the rest of the page. */
.answers {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.answers .answer-link {
  display: block;
  width: 100%;
  padding: 0.95rem 1.4rem;
  background: var(--lightgray);
  color: var(--gray);
  text-decoration: none;
  border: 1px solid var(--outlinegray);
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.answers .answer-link:hover,
.answers .answer-link:focus-visible {
  transform: translateY(-2px);
  background: linear-gradient(135deg, var(--secondary), var(--tertiary));
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
  text-decoration: none;
  outline: none;
}

/* CTAs */
.back-link {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  background: linear-gradient(135deg, #FF5D62, #d27e99);
  color: #ffffff;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.back-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: stretch;
  margin: 0;
}

.secondary-link {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  background: transparent;
  color: var(--secondary);
  text-decoration: none;
  border: 1px solid var(--secondary);
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.secondary-link:hover {
  transform: translateY(-2px);
  background: var(--secondary);
  color: #ffffff;
}

.muted {
  color: var(--gray);
  opacity: 0.75;
  font-size: 0.85rem;
  margin: 2rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--outlinegray);
  line-height: 1.6;
}

/* Inline links inside the card's body paragraphs (home.html explainer).
 * Browser default is dark blue; match the page accent palette instead. */
.card p a {
  color: var(--secondary);
  text-decoration: none;
  border-bottom: 1px solid var(--outlinegray);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.card p a:hover {
  color: var(--tertiary);
  border-bottom-color: var(--secondary);
}

.footer-credit {
  margin: 1.25rem 0 0;
  font-size: 0.75rem;
  color: var(--gray);
  opacity: 0.55;
  text-align: center;
}

.footer-credit a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--outlinegray);
  text-underline-offset: 2px;
}

.footer-credit a:hover {
  opacity: 1;
  text-decoration-color: var(--secondary);
}

@media (max-width: 480px) {
  .card { padding: 1.75rem 1.25rem; }
  h1 { font-size: 1.6rem; }
  .logo { width: 60px; height: 60px; }
  .row { grid-template-columns: minmax(5rem, 35%) 1fr auto; }
}
