/* ==========================================================================
   Εκλογές Συνδέσμου Γονέων — βασικό stylesheet
   Παλέτα: βαθύ μπλε "ink" (επισημότητα) + ζεστό "χαρτί" φόντο (προσβασιμότητα)
   με πινελιά "χρυσού" για επιβεβαιωμένες ενέργειες — θυμίζει επίσημο έντυπο
   ψηφοδελτίου, όχι εταιρικό dashboard.
   ========================================================================== */

:root {
  --ink: #1B2A4A;
  --ink-light: #2E4270;
  --paper: #FAF7F0;
  --paper-line: #E4DFD3;
  --card: #FFFFFF;
  --text: #2A2A28;
  --text-muted: #6B6559;
  --gold: #B8863E;
  --gold-light: #F3E7D2;
  --danger: #A23B2E;
  --danger-light: #FBEAE6;
  --success: #3E6B4F;
  --success-light: #E8F1EA;
  --radius: 10px;
  --font-head: 'Lora', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

body { padding-bottom: 48px; }

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  margin: 0 0 8px;
}
h1 { font-size: 1.7rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }

p { margin: 0 0 16px; max-width: 62ch; }
a { color: var(--ink-light); }
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.page {
  max-width: 780px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}
body.narrow .page { max-width: 560px; }

.muted { color: var(--text-muted); }
.small { font-size: 0.88rem; }
.center { text-align: center; }

/* --------------------------- Πλαίσιο / κάρτες --------------------------- */

.card {
  background: var(--card);
  border: 1px solid var(--paper-line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.card + .card { margin-top: 0; }

.hero {
  border-bottom: 3px solid var(--ink);
  padding-bottom: 16px;
  margin-bottom: 28px;
}
.hero .school {
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

/* -------------------------------- Κουμπιά -------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  background: var(--ink);
  color: #fff;
  transition: background-color .15s ease;
}
.btn:hover { background: var(--ink-light); }
.btn:disabled { background: #C7C2B5; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-secondary:hover { background: var(--paper-line); }

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #8a3226; }

.btn-gold { background: var(--gold); }
.btn-gold:hover { background: #9c7134; }

.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

/* -------------------------------- Φόρμες -------------------------------- */

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}
.field { margin-bottom: 18px; }
.field .hint { margin-top: 6px; }

input[type="text"],
input[type="password"],
input[type="number"] {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1.05rem;
  padding: 12px 14px;
  border: 1.5px solid var(--paper-line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}
input:focus { border-color: var(--ink); }

.code-input {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: var(--font-head);
  font-size: 1.4rem;
  text-align: center;
}

/* -------------------------------- Ειδοποιήσεις -------------------------------- */

.notice {
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.95rem;
  border: 1px solid transparent;
}
.notice-success { background: var(--success-light); color: var(--success); border-color: #bfd9c9; }
.notice-error   { background: var(--danger-light);  color: var(--danger);  border-color: #e6bdb3; }
.notice-info    { background: var(--gold-light);    color: #7a5a29;        border-color: #e3cd9c; }

/* -------------------------------- Ετικέτες κατάστασης -------------------------------- */

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-draft  { background: #EDEAE0; color: var(--text-muted); }
.badge-open   { background: var(--success-light); color: var(--success); }
.badge-closed { background: #EDEAE0; color: var(--ink); }

/* -------------------------------- Ψηφοδέλτιο -------------------------------- */

.ballot-list { list-style: none; margin: 0 0 20px; padding: 0; }
.ballot-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border: 1.5px solid var(--paper-line);
  border-radius: 8px;
  margin-bottom: 10px;
  background: #fff;
  cursor: pointer;
}
.ballot-item:has(input:checked) {
  border-color: var(--ink);
  background: var(--gold-light);
}
.ballot-item input { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; }
.ballot-item .name { font-size: 1.08rem; font-weight: 500; }

.ballot-blank {
  border-top: 2px dashed var(--paper-line);
  margin-top: 18px;
  padding-top: 18px;
}

.selection-counter {
  position: sticky;
  bottom: 0;
  background: var(--paper);
  border-top: 1px solid var(--paper-line);
  padding: 14px 0 4px;
  margin-top: 8px;
}

/* -------------------------------- Πίνακες -------------------------------- */

table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--paper-line);
  font-size: 0.95rem;
}
th { color: var(--text-muted); font-weight: 600; font-size: 0.85rem; }
tr:last-child td { border-bottom: none; }

.results-bar-track {
  background: var(--paper-line);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
  margin-top: 4px;
}
.results-bar-fill { background: var(--ink); height: 100%; }
.elected .results-bar-fill { background: var(--gold); }

/* -------------------------------- Κωδικοί εκτύπωσης -------------------------------- */

.code-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.code-slip {
  border: 1.5px dashed #999;
  border-radius: 6px;
  padding: 12px 10px;
  text-align: center;
}
.code-slip .slip-label { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 4px; }
.code-slip .slip-code {
  font-family: var(--font-head);
  font-size: 1.3rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--ink);
}

/* -------------------------------- Admin μπάρα -------------------------------- */

.admin-bar { background: var(--ink); color: #fff; }
.admin-bar-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-brand { color: #fff; font-family: var(--font-head); font-weight: 600; text-decoration: none; }
.admin-bar nav a { color: #E7DEC9; margin-left: 14px; text-decoration: none; }
.admin-bar nav a:hover { color: #fff; }
.admin-user { color: #B9C3DA; margin-right: 4px; }

.breadcrumb { margin-bottom: 18px; font-size: 0.9rem; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* -------------------------------- QR / link box -------------------------------- */

.link-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  border: 1px solid var(--paper-line);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: monospace;
  font-size: 0.9rem;
  word-break: break-all;
}
.qr-box { text-align: center; margin: 16px 0; }
.qr-box img { border: 8px solid #fff; border-radius: 8px; box-shadow: 0 0 0 1px var(--paper-line); }

/* -------------------------------- Εκτύπωση -------------------------------- */

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .card { border: none; padding: 0; }
  .page { max-width: 100%; padding: 0; }
}

@media (max-width: 560px) {
  .code-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-bar-inner { flex-direction: column; align-items: flex-start; gap: 6px; }
}
