/* MAIPF Board of Governors Election — shared base styling (design tokens,
   topbar, voter ballot page). admin.css layers on top of this for the
   admin dashboard. Plain CSS, no framework/build step, per project
   constraints. */

:root {
  /* Palette echoes MAIPF's existing navy + gold branding (seen on the
     live maipf.org site) so this reads as "MAIPF" even before the real
     logo file is dropped in — see .brand-mark below for where that goes. */
  --color-bg: #f4f5f8;
  --color-surface: #ffffff;
  --color-border: #e1e4ea;
  --color-border-strong: #c9ced8;
  --color-text: #1a1f2b;
  --color-text-muted: #64708a;
  --color-primary: #163a63;
  --color-primary-hover: #0f2847;
  --color-primary-soft: #eaf1fb;
  --color-accent: #d9a441;
  --color-accent-soft: #fbf1de;
  --color-success: #1e7a4c;
  --color-error: #b3261e;
  --color-error-soft: #fbeceb;
  --radius-sm: 8px;
  --radius-md: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.08);
  --font-sans: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.55;
}

/* --- Shared topbar (voter page, landing page, and every admin page) --- */

.topbar {
  background: linear-gradient(135deg, var(--color-primary) 0%, #0e2c4d 100%);
  padding: 0.9rem 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  max-width: 900px;
  margin: 0 auto;
  text-decoration: none;
}

/* Placeholder wordmark until the real MAIPF logo file is available — swap
   this whole element for <img src="/logo.svg" class="brand-mark" alt="MAIPF">
   and the surrounding layout/spacing keeps working unchanged. */
.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  color: var(--color-primary);
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.brand-name {
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.brand-name-sub {
  font-weight: 400;
  color: #cfd9e8;
}

/* --- Voter ballot page + landing page --- */

.ballot-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.page-heading {
  margin-bottom: 1.5rem;
}

.page-heading h1 {
  font-size: 1.4rem;
  margin: 0;
  letter-spacing: -0.01em;
}

.status-message {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  font-size: 1rem;
}

.status-message.error-message {
  border-color: #f3cbc8;
  background: var(--color-error-soft);
  color: var(--color-error);
}

fieldset {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.25rem 1.25rem;
  margin: 0 0 1.25rem;
}

legend {
  font-weight: 700;
  padding: 0 0.4rem;
}

.nominee-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 0.6rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s, border-color 0.15s;
}

.nominee-option:hover {
  background: var(--color-bg);
}

/* Modern touch: the option reads as a selectable "card" once chosen, not
   just a bare radio button — :has() is well-supported in current Chrome/
   Edge, which is what this project tests against. */
.nominee-option:has(input:checked) {
  background: var(--color-primary-soft);
  border-color: var(--color-primary);
}

.nominee-option input[type="radio"] {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  accent-color: var(--color-primary);
}

.nominee-option label {
  cursor: pointer;
  width: 100%;
}

.contact-update {
  margin-bottom: 1.25rem;
}

.contact-update label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--color-text-muted);
}

.contact-update textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.contact-update textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

#submit-btn {
  width: 100%;
  padding: 0.8rem;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.15s, transform 0.1s, box-shadow 0.15s;
}

#submit-btn:disabled {
  background: #9aa8bd;
  cursor: not-allowed;
  box-shadow: none;
}

#submit-btn:hover:not(:disabled) {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

#submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.error-message {
  color: var(--color-error);
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

@media (max-width: 400px) {
  .ballot-page {
    padding: 1.25rem 1rem 3rem;
  }
}
