/* Lodge officer elections -- mobile first, large tap targets, no framework. */

:root {
  --navy: #10204a;
  --navy-soft: #1b2f63;
  --gold: #b48a2d;
  --gold-light: #d9b357;
  --cream: #f7f4ec;
  --ink: #1d2330;
  --muted: #5d6579;
  --line: #d8d2c4;
  --white: #fff;
  --green: #1f6b47;
  --red: #96271f;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 32, 74, 0.14), 0 6px 18px rgba(16, 32, 74, 0.07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* -- header ------------------------------------------------------------- */

.site-header {
  background: var(--navy);
  color: var(--cream);
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.emblem { width: 34px; height: 34px; color: var(--gold); flex: none; }

.site-header h1 {
  font-size: 1.05rem;
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.site-header .subtitle {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  color: #b9c2dc;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-header .spacer { flex: 1; }

.whoami {
  font-size: 0.8rem;
  text-align: right;
  color: #b9c2dc;
  line-height: 1.3;
}

.whoami strong { color: var(--cream); display: block; font-size: 0.92rem; }

.linkish {
  background: none;
  border: 0;
  color: var(--gold);
  font: inherit;
  font-size: 0.78rem;
  text-decoration: underline;
  padding: 0;
  cursor: pointer;
}

/* -- layout ------------------------------------------------------------- */

main { max-width: 34rem; margin: 0 auto; padding: 1rem 1rem 3rem; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem;
  margin-bottom: 1rem;
}

.progress {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

h2.office-title {
  margin: 0 0 1rem;
  font-size: 1.6rem;
  line-height: 1.2;
  color: var(--navy);
}

.field { margin-bottom: 1.15rem; }

.field > label,
.field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.readonly-value {
  background: #eef0f6;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem 0.9rem;
  font-size: 1.05rem;
  color: var(--ink);
  min-height: 3rem;
}

.readonly-value.empty { color: var(--muted); font-style: italic; }

input[type="search"],
input[type="password"],
select {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  padding: 0.75rem 0.8rem;
  border: 1px solid #aeb3c2;
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  min-height: 3rem;
}

input[type="search"] { margin-bottom: 0.5rem; }

select:focus,
input:focus { outline: 3px solid rgba(180, 138, 45, 0.45); outline-offset: 1px; }

.hint { font-size: 0.8rem; color: var(--muted); margin: 0.4rem 0 0; }

/* -- member picker ------------------------------------------------------ */
/* A type-to-pick name list. Built by static/js/member-picker.js over the
   plain <select> in the markup, which is what a phone without JS falls back
   to -- so every rule here is additive. */

.picker { position: relative; }

.picker-box { position: relative; }

.picker-input {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  padding: 0.75rem 2.6rem 0.75rem 0.8rem;
  border: 1px solid #aeb3c2;
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  min-height: 3rem;
}

.picker-input.chosen {
  border-color: var(--navy);
  box-shadow: inset 0 0 0 1px var(--navy);
  font-weight: 600;
}

.picker-clear {
  position: absolute;
  top: 0;
  right: 0;
  width: 2.6rem;
  height: 100%;
  min-height: 3rem;
  background: none;
  border: 0;
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.picker-clear:hover { color: var(--red); }

.picker-list {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
  max-height: 17rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--white);
  border: 1px solid #aeb3c2;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.picker-option {
  padding: 0.8rem 0.9rem;
  font-size: 1.05rem;
  min-height: 3rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  border-bottom: 1px solid #eceadf;
}

.picker-option:last-child { border-bottom: 0; }

.picker-option.active,
.picker-option:hover {
  background: var(--navy);
  color: var(--cream);
}

.picker-empty {
  padding: 0.9rem;
  font-size: 0.95rem;
  color: var(--muted);
  font-style: italic;
}

/* -- buttons ------------------------------------------------------------ */

.btn {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.9rem 1rem;
  min-height: 3.25rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.btn-primary { background: var(--navy); color: var(--cream); }
.btn-primary:hover { background: var(--navy-soft); }

.btn-next { background: var(--gold); color: #2b2003; border-color: #93701f; }
.btn-next:hover { background: #c79a35; }

.btn:disabled,
.btn[aria-disabled="true"] {
  background: #e3e0d7;
  color: #8b8f9c;
  border-color: var(--line);
  cursor: not-allowed;
  box-shadow: none;
}

/* -- status / messages -------------------------------------------------- */

.messages { list-style: none; margin: 0 0 1rem; padding: 0; }

.messages li {
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  border: 1px solid;
}

.messages .success { background: #e7f3ec; border-color: #b6d8c4; color: var(--green); }
.messages .info    { background: #e9eefa; border-color: #c2cfeb; color: var(--navy); }
.messages .error   { background: #fbeceb; border-color: #e8c2bf; color: var(--red); }

#advance { margin-top: 1.4rem; }

.status {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--muted); flex: none; }
.dot.open { background: var(--green); animation: pulse 1.8s ease-in-out infinite; }
.dot.closed { background: var(--red); }
.dot.waiting { background: var(--gold); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.recorded {
  background: #e7f3ec;
  border: 1px solid #b6d8c4;
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.15rem;
}

.recorded .field-label { color: var(--green); }
.recorded .name { font-size: 1.3rem; font-weight: 600; color: var(--ink); }

.waiting-note {
  text-align: center;
  color: var(--muted);
  padding: 0.5rem 0 0.25rem;
  font-size: 0.95rem;
}

.ballot-track {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.ballot-track span {
  flex: 1 1 auto;
  height: 0.35rem;
  border-radius: 2px;
  background: #ded9cc;
  min-width: 0.8rem;
}

.ballot-track span.done { background: var(--navy); }
.ballot-track span.active { background: var(--gold); }

@media (min-width: 40rem) {
  .site-header { padding: 1.1rem 2rem; }
  main { padding-top: 1.75rem; }
  h2.office-title { font-size: 1.9rem; }
}
