/* ballot.css — shared styles for all public ballot pages */

:root {
  --n:   #1B2A4A;   /* navy */
  --nl:  #243660;   /* navy light */
  --r:   #C8102E;   /* red */
  --g:   #C9973A;   /* gold */
  --off: #F7F5F0;   /* off-white */
  --b:   #E2DDD6;   /* border/tan */
  --gr:  #6B7280;   /* grey */
  --fb:  'Source Sans 3', sans-serif;
  --fd:  'Playfair Display', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--fb);
  background: var(--off);
  color: var(--n);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════ */

.b-header {
  background: var(--n);
  border-bottom: 4px solid var(--r);
  min-height: 84px;
  display: flex;
  align-items: center;
  padding: 0 2rem;
}

.b-brand {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  text-decoration: none;
  color: inherit;
}

.b-brand-badge {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: #fff;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  line-height: .86;
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
  flex: 0 0 auto;
}

.b-brand-az {
  font-family: var(--fb);
  font-size: 25px;
  font-weight: 900;
  letter-spacing: -.055em;
  color: var(--n);
  text-transform: uppercase;
  transform: translateY(1px);
}

.b-brand-free {
  font-family: var(--fb);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .015em;
  color: #F5A623;
  text-transform: uppercase;
  transform: translateY(2px);
}

.b-brand-action {
  font-family: var(--fb);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -.045em;
  color: #fff;
  line-height: 1;
}

.b-brand-i {
  position: relative;
  display: inline-block;
}

.b-brand-i::after {
  content: '';
  position: absolute;
  left: 58%;
  top: .07em;
  transform: translateX(-50%);
  width: .21em;
  height: .21em;
  border-radius: 50%;
  background: #F5A623;
}

/* ═══════════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════════ */

.b-hero {
  background: var(--n);
  padding: 3.5rem 2rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Subtle diagonal texture, matching action alerts */
.b-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent, transparent 40px,
    rgba(255,255,255,.016) 40px, rgba(255,255,255,.016) 80px
  );
}

.b-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
}

.b-eyebrow {
  display: inline-block;
  background: var(--r);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  padding: 4px 14px;
  margin-bottom: 1.1rem;
}

.b-hero h1 {
  font-family: var(--fd);
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.15;
  max-width: 720px;
  margin: 0 auto .9rem;
}

.b-hero h1 span { color: var(--g); }

/* Support / oppose badge */
.b-position {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 18px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .85rem;
}

.b-position.support {
  background: rgba(21,128,61,.25);
  color: #6ee7a0;
  border: 1px solid rgba(21,128,61,.4);
}

.b-position.oppose {
  background: rgba(200,16,46,.25);
  color: #fca5a5;
  border: 1px solid rgba(200,16,46,.4);
}

.b-hero-sub {
  font-size: 1rem;
  color: rgba(255,255,255,.7);
  max-width: 520px;
  margin: 0 auto 1.5rem;
}

.b-hero-cta {
  display: inline-block;
  background: var(--r);
  color: #fff;
  font-family: var(--fb);
  font-size: 1.1rem;
  font-weight: 600;
  padding: .9rem 2.5rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: background .15s, transform .1s;
  letter-spacing: .01em;
  margin-bottom: 1.25rem;
}

.b-hero-cta:hover { background: #a00d25; transform: translateY(-2px); }

.b-arr {
  display: block;
  color: rgba(255,255,255,.45);
  font-size: 1.4rem;
  line-height: 1;
  animation: b-bounce 1.8s ease-in-out infinite;
}

@keyframes b-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ═══════════════════════════════════════════════════
   BACKGROUND SECTION (navy)
═══════════════════════════════════════════════════ */

.b-bgsec {
  background: var(--n);
  padding: 3rem 1.5rem;
}

.b-bgi {
  max-width: 860px;
  margin: 0 auto;
}

.b-bgey {
  display: inline-block;
  background: var(--r);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  padding: 4px 14px;
  margin-bottom: 1rem;
}

.b-bgsec h2 {
  font-family: var(--fd);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.5rem;
  line-height: 1.25;
}

.b-bgbody p {
  color: rgba(255,255,255,.82);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

/* Key Points box */
.b-keypoints {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
}

.b-keypoints-title {
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  margin-bottom: .85rem;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.b-keypoints-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.b-keypoints-list li {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  color: rgba(255,255,255,.82);
  font-size: .95rem;
  line-height: 1.65;
}

.b-ck {
  color: var(--g);
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: .1em;
}

/* ═══════════════════════════════════════════════════
   SAMPLE ARGUMENT SECTION (slightly lighter navy)
═══════════════════════════════════════════════════ */

.b-sample-sec {
  background: #162240;
  padding: 3rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,.07);
}

.b-sample-sec h2 {
  font-family: var(--fd);
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 1rem;
  line-height: 1.25;
}

.b-sample-intro {
  color: rgba(255,255,255,.65);
  font-size: .95rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  max-width: 640px;
}

.b-sample-quote {
  background: rgba(255,255,255,.05);
  border-left: 3px solid var(--g);
  border-radius: 0 6px 6px 0;
  padding: 1.5rem 1.75rem;
  font-family: Georgia, serif;
  font-size: .97rem;
  line-height: 1.85;
  color: rgba(255,255,255,.85);
  font-style: normal;
}

.b-sample-quote p { margin-bottom: 1rem; }
.b-sample-quote p:last-child { margin-bottom: 0; }

/* ═══════════════════════════════════════════════════
   FORM SECTION (off-white)
═══════════════════════════════════════════════════ */

.b-form-sec {
  background: var(--off);
  padding: 3rem 1.5rem 4rem;
}

.b-form-inner {
  max-width: 760px;
  margin: 0 auto;
}

.b-form-heading {
  text-align: center;
  margin-bottom: 2rem;
}

.b-form-title {
  font-family: var(--fd);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--n);
  margin: .75rem 0 .5rem;
}

.b-form-sub {
  font-size: .95rem;
  color: var(--gr);
  line-height: 1.5;
}

.b-form-heading .b-bgey {
  background: var(--n);
  margin-bottom: 0;
}

/* Loading text style */
.b-loading-text {
  color: rgba(255,255,255,.4);
  font-style: italic;
}

/* ═══════════════════════════════════════════════════
   STEPS INDICATOR
═══════════════════════════════════════════════════ */

.b-steps {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--b);
}

.b-step {
  flex: 1;
  text-align: center;
  padding: .65rem .5rem;
  font-size: 12px;
  font-weight: 600;
  color: var(--gr);
  background: #fff;
  border-right: 1px solid var(--b);
  transition: background .2s, color .2s;
}

.b-step:last-child { border-right: none; }

.b-step.active {
  background: var(--n);
  color: #fff;
  border-top: 3px solid var(--g);
}

.b-step.done {
  background: #e8f5e9;
  color: #2e7d32;
}

.b-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  background: rgba(0,0,0,.08);
  margin-bottom: 2px;
  margin-right: 4px;
}

.b-step.active .b-step-num { background: rgba(255,255,255,.2); }
.b-step.done .b-step-num   { background: rgba(46,125,50,.2); }

/* ═══════════════════════════════════════════════════
   FORM CARDS
═══════════════════════════════════════════════════ */

.b-card {
  background: #fff;
  border: 1px solid var(--b);
  border-radius: 10px;
  padding: 1.75rem;
  margin-bottom: 1.25rem;
}

.b-card-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gr);
  margin-bottom: .85rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--b);
}

/* ═══════════════════════════════════════════════════
   FORM FIELDS
═══════════════════════════════════════════════════ */

.b-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

@media (max-width: 520px) { .b-form-grid { grid-template-columns: 1fr; } }

.b-form-grid .full { grid-column: 1 / -1; }

.b-field {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.b-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--n);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.b-field .req { color: var(--r); }

.b-field input,
.b-field textarea {
  font-family: var(--fb);
  font-size: .9rem;
  padding: .6rem .8rem;
  border: 1.5px solid var(--b);
  border-radius: 6px;
  background: #fff;
  color: var(--n);
  transition: border-color .15s;
  outline: none;
}

.b-field input:focus,
.b-field textarea:focus { border-color: var(--n); }

.b-field textarea { resize: vertical; min-height: 120px; }

.b-field .hint { font-size: 11px; color: var(--gr); line-height: 1.4; }

/* ═══════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════ */

.b-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--fb);
  font-size: .88rem;
  font-weight: 700;
  padding: .65rem 1.4rem;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background .15s, border-color .15s, opacity .15s;
  letter-spacing: .02em;
  text-decoration: none;
  white-space: nowrap;
}

.b-btn-primary { background: var(--r); color: #fff; border-color: var(--r); }
.b-btn-primary:hover:not(:disabled) { background: #a00d25; border-color: #a00d25; }

.b-btn-navy { background: var(--n); color: #fff; border-color: var(--n); }
.b-btn-navy:hover:not(:disabled) { background: var(--nl); border-color: var(--nl); }

.b-btn-outline { background: transparent; color: var(--n); border-color: var(--b); }
.b-btn-outline:hover:not(:disabled) { border-color: var(--n); }

.b-btn:disabled { opacity: .5; cursor: not-allowed; }

.b-btn-row {
  display: flex;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* ═══════════════════════════════════════════════════
   WORD COUNT / ARGUMENT TEXTAREA
═══════════════════════════════════════════════════ */

.b-wordcount {
  font-size: 11px;
  color: var(--gr);
  margin-top: .25rem;
  text-align: right;
}

.b-wordcount.warn  { color: #d97706; }
.b-wordcount.good  { color: #15803d; }
.b-wordcount.over  { color: var(--r); }

.b-argument-wrap { position: relative; }

.b-argument-text {
  font-family: Georgia, serif;
  font-size: .97rem;
  line-height: 1.8;
  padding: 1rem;
  border: 1.5px solid var(--b);
  border-radius: 6px;
  background: #fafaf8;
  width: 100%;
  min-height: 200px;
  resize: vertical;
  color: var(--n);
  outline: none;
  transition: border-color .15s;
}

.b-argument-text:focus { border-color: var(--n); background: #fff; }

.b-generation-note {
  font-size: 12px;
  color: var(--gr);
  margin-top: .35rem;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════
   STATUS / SPINNER
═══════════════════════════════════════════════════ */

.b-status {
  font-size: .88rem;
  padding: .5rem .75rem;
  border-radius: 6px;
  display: none;
}

.b-status.show    { display: block; }
.b-status.info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.b-status.success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.b-status.error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.b-status.loading { background: #f8fafc; color: var(--gr); border: 1px solid var(--b); display: flex; align-items: center; gap: 8px; }

.b-spinner {
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(0,0,0,.12);
  border-top-color: var(--n);
  border-radius: 50%;
  animation: b-spin .7s linear infinite;
  flex-shrink: 0;
}

@keyframes b-spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════
   SUCCESS / NOTICE
═══════════════════════════════════════════════════ */

.b-success-box {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 10px;
  padding: 1.75rem 1.5rem;
  text-align: center;
}

.b-success-icon { font-size: 3rem; line-height: 1; margin-bottom: .75rem; }

.b-success-box h2 {
  font-family: var(--fd);
  font-size: 1.5rem;
  color: #15803d;
  margin-bottom: .5rem;
}

.b-success-box p {
  color: #166534;
  font-size: .95rem;
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto .75rem;
}

.b-notice {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: .85rem 1rem;
  font-size: .88rem;
  color: #92400e;
  line-height: 1.5;
  margin-bottom: 1rem;
}

/* ═══════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════ */

.b-footer {
  background: var(--n);
  color: rgba(255,255,255,.6);
  text-align: center;
  padding: 1.25rem 1.5rem;
  font-size: 12px;
  border-top: 4px solid var(--r);
}

.b-footer a { color: rgba(255,255,255,.75); text-decoration: none; }
.b-footer a:hover { color: #fff; }

/* ═══════════════════════════════════════════════════
   REVIEW PAGE SPECIFIC
═══════════════════════════════════════════════════ */

.sub-card {
  background: #fff;
  border: 1px solid var(--b);
  border-radius: 8px;
  margin-bottom: .75rem;
  overflow: hidden;
}

.sub-card-header {
  padding: .85rem 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  cursor: pointer;
  user-select: none;
}

.sub-card-header:hover { background: var(--off); }

.sub-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-left: auto;
  white-space: nowrap;
}

.badge-pending              { background: #fef3c7; color: #92400e; }
.badge-approved             { background: #d1fae5; color: #065f46; }
.badge-submitted            { background: #dbeafe; color: #1e40af; }
.badge-rejected             { background: #fee2e2; color: #991b1b; }
.badge-send_for_approval    { background: #ede9fe; color: #5b21b6; }
.badge-rejected_by_activist { background: #fee2e2; color: #991b1b; }

.sub-card-body {
  padding: 1rem;
  border-top: 1px solid var(--b);
  display: none;
}

.sub-card-body.open { display: block; }

.sub-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--gr);
  margin-bottom: .35rem;
}

.sub-text {
  font-size: .9rem;
  line-height: 1.7;
  color: #333;
  margin-bottom: 1rem;
  white-space: pre-wrap;
}

.sub-detail-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .88rem;
  color: var(--gr);
  margin-bottom: 1rem;
}

.sub-detail-row span b { color: var(--n); }

.review-controls {
  background: var(--off);
  border: 1px solid var(--b);
  border-radius: 8px;
  padding: 1rem;
  margin-top: .5rem;
}

.review-controls .b-form-grid { margin-bottom: .75rem; }

.review-action-btns {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: .75rem;
}

.filters-bar {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  align-items: center;
}

.filter-btn {
  font-family: var(--fb);
  font-size: 12px;
  font-weight: 600;
  padding: .3rem .9rem;
  border-radius: 20px;
  border: 1.5px solid var(--b);
  background: #fff;
  cursor: pointer;
  color: var(--gr);
  transition: background .15s, border-color .15s, color .15s;
}

.filter-btn.active,
.filter-btn:hover { background: var(--n); border-color: var(--n); color: #fff; }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════ */

@media (max-width: 600px) {
  .b-header { padding: 0 1.25rem; min-height: 68px; }
  .b-brand-action { font-size: 32px; }
  .b-brand-badge { width: 48px; height: 48px; }
  .b-brand-az { font-size: 21px; }
  .b-brand-free { font-size: 13px; }

  .b-hero { padding: 2.5rem 1.25rem 2rem; }
  .b-hero h1 { font-size: 1.9rem; }

  .b-bgsec { padding: 2.25rem 1.25rem; }
  .b-sample-sec { padding: 2.25rem 1.25rem; }
  .b-form-sec { padding: 2rem 1rem 3rem; }

  .b-card { padding: 1.25rem; }

  .b-steps { flex-direction: column; border-radius: 8px; }
  .b-step { border-right: none; border-bottom: 1px solid var(--b); }
  .b-step:last-child { border-bottom: none; }

  .b-sample-quote { padding: 1.1rem 1.25rem; }
}
