/* DirectPoll – shared stylesheet */

/* ── Variables ─────────────────────────────────────── */
:root {
  --red:        #c53838;
  --orange:     #e07830;
  --blue:       #29a8ce;
  --dark:       #333333;
  --gray:       #666666;
  --light:      #f7f7f7;
  --border:     #e0e0e0;
  --white:      #ffffff;
  --footer-bg:  #2c3e50;
  --nav-height: 70px;
  --max-width:  1100px;
  --radius:     4px;
}

/* ── Reset / Base ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: Montserrat, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  color: var(--dark);
  background: var(--white);
  line-height: 1.65;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

ul, ol { padding-left: 1.5rem; }
li { margin-bottom: 0.4rem; }

/* ── Typography ─────────────────────────────────────── */
h1 {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--dark);
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--dark);
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

p { margin-bottom: 1rem; color: var(--gray); }
p:last-child { margin-bottom: 0; }

.lead {
  font-size: 1.15rem;
  color: var(--gray);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

/* ── Layout helpers ─────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section { padding: 4rem 0; }
.section-alt { background: var(--light); }

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.65rem 1.6rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: opacity 0.15s;
  border: none;
  text-decoration: none;
}
.btn:hover { filter: brightness(0.88); text-decoration: none; }

.btn-primary {
  background: var(--blue);
  color: var(--white);
}

.btn-cta {
  background: var(--red);
  color: var(--white);
  font-size: 1rem;
  padding: 0.75rem 2rem;
}

/* ── Header / Nav ───────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
  display: flex;
  align-items: center;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo img { height: 36px; }

nav { display: flex; align-items: center; gap: 2rem; }

nav a {
  color: var(--dark);
  font-weight: 500;
  font-size: 0.95rem;
}
nav a:not(.btn):hover { color: var(--blue); text-decoration: none; }
nav a.active { color: var(--blue); }

/* ── Burger button ──────────────────────────────────── */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 2px;
}
.nav-burger span {
  display: block;
  width: 22px;
  height: 3px;
  background: var(--dark);
  border-radius: 2px;
}

/* ── Hero ───────────────────────────────────────────── */
.hero {
  background-color: var(--white);
  background-image: url('img/pattern.png');
  background-repeat: repeat;
  padding: 0;
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 180px 1fr 360px;
  grid-template-rows: 399px;
  gap: 3rem;
  align-items: center;
}

.hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

.hero-text { padding: 2.5rem 0; }
.hero-text h1    { margin-bottom: 1.25rem; }
.hero-text .lead { margin-bottom: 2rem; }

/* ── Page hero (inner pages) ────────────────────────── */
.page-hero {
  background-color: var(--white);
  background-image: url('img/pattern.png');
  background-repeat: repeat;
  padding: 3rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
}

.page-hero h1 { margin-bottom: 0.5rem; }
.page-hero .lead { margin-bottom: 0; }

/* ── Three-column grid ──────────────────────────────── */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin-top: 2.5rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.card-icon {
  width: 48px;
  height: 6px;
  border-radius: 3px;
  margin-bottom: 1rem;
}
.icon-red    { background: var(--red); }
.icon-orange { background: var(--orange); }
.icon-blue   { background: var(--blue); }

/* ── Steps ──────────────────────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 2.5rem;
}

.step {
  text-align: center;
  padding: 1.5rem;
}

.step-number {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

/* ── CTA band ───────────────────────────────────────── */
.cta-band {
  background: var(--blue);
  color: var(--white);
  text-align: center;
  padding: 3rem 0;
}

.cta-band h2 { color: var(--white); margin-bottom: 1rem; }
.cta-band p  { color: rgba(255,255,255,0.85); }

.btn-white {
  background: var(--white);
  color: var(--blue);
  font-weight: 700;
}

/* ── Section heading ────────────────────────────────── */
.section-header { text-align: center; margin-bottom: 0.5rem; }
.section-header p { max-width: 600px; margin: 0 auto; }

/* ── FAQ ────────────────────────────────────────────── */
.faq-list { margin-top: 2rem; }

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
}
.faq-item:first-child { border-top: 1px solid var(--border); }

.faq-item h3 {
  color: var(--dark);
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.faq-item p { margin-bottom: 0; font-size: 0.95rem; }

/* ── Help / TOC ─────────────────────────────────────── */
.help-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3rem;
  align-items: start;
  margin-top: 2rem;
}

.toc {
  position: sticky;
  top: calc(var(--nav-height) + 1rem);
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.toc h3 { font-size: 0.85rem; text-transform: uppercase;
           letter-spacing: 0.05em; color: var(--gray);
           margin-bottom: 0.75rem; }

.toc ul { list-style: none; padding: 0; }
.toc li { margin-bottom: 0; }
.toc a  {
  display: block;
  padding: 0.35rem 0;
  color: var(--gray);
  font-size: 0.9rem;
  border-left: 3px solid transparent;
  padding-left: 0.75rem;
}
.toc a:hover { color: var(--blue); border-left-color: var(--blue);
               text-decoration: none; }

div.dp-section {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}
div.dp-section:first-child { border-top: none; margin-top: 0; padding-top: 0; }

div.dp-section h2 { font-size: 1.4rem; margin-bottom: 1rem; }
.dp-section:nth-of-type(3n+1) h2 { color: var(--blue); }
.dp-section:nth-of-type(3n+2) h2 { color: var(--orange); }
.dp-section:nth-of-type(3n+3) h2 { color: var(--red); }
div.dp-section h3 { margin-top: 1.25rem; }
div.dp-section p, div.dp-section li { font-size: 0.97rem; }

/* ── Poll demo ──────────────────────────────────────── */
ul.poll {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

ul.poll li {
  margin-bottom: 0.75rem;
}

ul.poll li:last-child { margin-bottom: 0; }

.poll-bar-wrap {
  flex: 1;
  height: 36px;
  background: rgba(0,0,0,0.07);
  border-radius: var(--radius);
  overflow: hidden;
}

.poll-bar {
  position: relative;
  height: 100%;
  width: 0%;
  border-radius: var(--radius);
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.poll-bar.bar-red    { background: var(--red); }
.poll-bar.bar-orange { background: var(--orange); }
.poll-bar.bar-blue   { background: var(--blue); }

.poll-count {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.35);
  white-space: nowrap;
  pointer-events: none;
}

.poll-demo-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  max-width: 420px;
}

/* ── Error pages ────────────────────────────────────── */
.error-page {
  text-align: center;
  padding: 6rem 0;
}

.error-code {
  font-size: 6rem;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
  margin-bottom: 1rem;
}

.error-page h1 { margin-bottom: 0.75rem; }
.error-page .lead { margin-bottom: 2rem; }

/* ── Footer ─────────────────────────────────────────── */
footer {
  background: var(--footer-bg);
  color: rgba(255,255,255,0.75);
  padding: 3rem 0 2rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: end;
}

.footer-brand { display: flex; flex-direction: column; }
.footer-brand .logo-light { height: 52px; width: auto; align-self: flex-start; margin-bottom: 1rem; }
.footer-brand p { font-size: 0.875rem; color: rgba(255,255,255,0.6); }
.footer-copyright { font-size: 0.8rem; color: rgba(255,255,255,0.45); margin-top: 1rem; }

.footer-links { text-align: right; }
.footer-links ul { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 0.35rem; }
.footer-links a {
  color: rgba(255,255,255,0.7);
  font-size: 0.875rem;
}
.footer-links a:hover { color: var(--white); text-decoration: none; }


/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 1100px) {
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.35rem; }
}

@media (max-width: 1000px) {
  .hero-inner { grid-template-columns: 180px 1fr; }
  .hero .poll-demo-wrap { display: none; }
}

@media (max-width: 768px) {
  .grid-3, .steps { grid-template-columns: 1fr; gap: 1.5rem; }
  .help-layout { grid-template-columns: 1fr; }
  .toc { position: static; }
  .footer-inner { grid-template-columns: 1fr; }

  nav { gap: 1rem; }
  nav .btn { display: none; }
}

@media (max-width: 600px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-image { display: none; }
}

@media (max-width: 550px) {
  .nav-burger { display: flex; }

  nav {
    display: none;
    position: absolute;
    top: calc(var(--nav-height) - 4px);
    right: 0;
    min-width: 180px;
    flex-direction: column;
    align-items: flex-end;
    padding: 0.75rem 1.25rem;
    gap: 0.75rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  }

  nav.open { display: flex; }
  nav.open .btn { display: inline-block; }
}
