/* Euro Jet Awards – voting app */
:root {
  --navy: #0f2340;
  --navy-2: #1b3a63;
  --gold: #c9a227;
  --gold-soft: #f6efd6;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1c2430;
  --muted: #677386;
  --line: #e1e6ee;
  --green: #1f8a4c;
  --red: #c0392b;
  --amber: #c98a12;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15,35,64,.06), 0 4px 16px rgba(15,35,64,.06);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; color-scheme: light; }
/* phones: no double-tap zoom delay, no grey tap flash on custom controls */
a, button, label, input, select, textarea { touch-action: manipulation; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--navy-2); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; color: var(--navy); }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }
code { background: #eef1f6; padding: .1em .35em; border-radius: 4px; font-size: .92em; }
code.secret { display: inline-block; padding: .5em .7em; font-size: 1rem; user-select: all; word-break: break-all; }
pre { background: #eef1f6; padding: 1em; border-radius: 8px; overflow: auto; }

.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
main.wrap { padding-top: 28px; padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
.narrow { max-width: 440px; margin: 0 auto; }
main.narrow { padding-top: 40px; }

/* Top bar */
.topbar { background: var(--navy); color: #fff; padding-top: env(safe-area-inset-top, 0px); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 650; font-size: 1.05rem; letter-spacing: .01em; }
.brand small { font-weight: 500; color: var(--gold); text-transform: uppercase; font-size: .7rem; letter-spacing: .08em; margin-left: 4px; }
.brand-logo { display: block; height: 42px; width: auto; }
.login-logo { display: block; height: 64px; width: auto; margin: 0 0 18px; }
.usernav { display: flex; align-items: center; gap: 18px; font-size: .9rem; flex-wrap: wrap; }
.usernav a { color: #fff; opacity: .9; text-decoration: none; }
.usernav a:hover { opacity: 1; text-decoration: underline; }
.usernav .who { color: #b9c6da; }
.subnav { display: flex; gap: 4px; overflow-x: auto; }
.subnav a { color: #c9d4e5; text-decoration: none; padding: 10px 14px; font-size: .92rem; border-bottom: 3px solid transparent; white-space: nowrap; }
.subnav a:hover { color: #fff; }
.subnav a.active { color: #fff; border-bottom-color: var(--gold); }

/* Cards & layout */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px; }
.card.center { text-align: center; }
.big-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 2rem; margin: 0 auto 16px; }
.two-col { display: grid; grid-template-columns: 360px 1fr; gap: 20px; align-items: start; }
.form-card { position: sticky; top: 16px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } .form-card { position: static; } }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack label { font-weight: 600; font-size: .9rem; margin-top: 6px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.top-gap { margin-top: 14px; }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: .875rem; }
.right { text-align: right; }

/* Forms */
input[type=text], input[type=email], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; font: inherit; color: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.row input[type=text] { width: auto; flex: 1; min-width: 160px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
textarea { resize: vertical; }
.code-input { font-size: 1.6rem; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
label.inline { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; }
.photo-row { display: flex; gap: 14px; align-items: center; }
.copybox { font-size: .8rem; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--navy); cursor: pointer; text-decoration: none; line-height: 1.2;
}
.btn:hover { border-color: var(--navy-2); }
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-primary:hover { background: var(--navy-2); }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); background: #fdf1ef; }
.btn-small { padding: 6px 10px; font-size: .85rem; border-radius: 8px; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; font-size: .95rem; }
.alert-ok { background: #edf8f1; border-color: #bfe3cc; color: #145c33; }
.alert-info { background: #eef4fc; border-color: #c8daf2; color: #1d4677; }
.alert-warn { background: #fdf6e7; border-color: #f0dcae; color: #7a5208; }
.alert-error { background: #fdf0ee; border-color: #f2c7c0; color: #8f2a1f; }

/* Ballot */
.intro { margin-bottom: 20px; }
.intro p { max-width: 720px; }
.category { border: 0; padding: 0; margin: 0 0 32px; min-width: 0; }
.category legend { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; padding: 0 0 14px; border-bottom: 2px solid var(--line); margin-bottom: 16px; }
.cat-name { font-size: 1.35rem; font-weight: 700; color: var(--navy); }
.pill { background: var(--gold-soft); color: #7a5f0c; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; text-transform: uppercase; letter-spacing: .04em; }
.counter { margin-left: auto; font-size: .9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.full { color: var(--green); font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.cand { position: relative; }
.cand-check { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cand-card {
  display: flex; flex-direction: column; height: 100%; background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); border: 2px solid transparent; cursor: pointer; overflow: hidden; position: relative;
  transition: border-color .12s, transform .12s, box-shadow .12s;
}
@media (hover: hover) { .cand-card:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(15,35,64,.12); } }
.cand-card { -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
.cand-card:active { transform: scale(.985); }
.cand-check:focus-visible + .cand-card { outline: 3px solid var(--gold); outline-offset: 2px; }
.cand-check:checked + .cand-card { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.25), var(--shadow); }
.cand.is-disabled .cand-card { opacity: .45; cursor: not-allowed; transform: none; }
.cand-photo { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #e6ebf2; }
.cand-photo.avatar-initials { display: grid; place-items: center; font-size: 3rem; font-weight: 700; color: #8796ad; }
.cand-body { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.cand-name { font-weight: 700; color: var(--navy); }
.cand-desc { font-size: .875rem; color: var(--muted); }
.tick {
  position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255,255,255,.9); color: transparent; font-weight: 700;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: background .12s;
}
.cand-check:checked + .cand-card .tick { background: var(--gold); color: var(--navy); }
.submitbar {
  position: sticky; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 5; margin-top: 8px; padding: 12px 16px;
  background: var(--card); border-radius: var(--radius); box-shadow: 0 6px 28px rgba(15,35,64,.18);
  display: flex; justify-content: center;
}

/* Admin */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.stat-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat-value { font-size: 1.35rem; font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.stat-sub { font-size: .85rem; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--green); } .dot-amber { background: var(--amber); } .dot-grey { background: #a3adbd; }
.results { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 0 20px; }
.ranking { list-style: none; padding: 0; margin: 0; }
.ranking li { display: grid; grid-template-columns: 26px 36px minmax(0, 1fr) 90px 34px; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ranking li:last-child { border-bottom: 0; }
.ranking li.inactive { opacity: .55; }
.rank { color: var(--muted); font-variant-numeric: tabular-nums; }
.r-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-votes { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--navy); }
.bar { height: 8px; background: #edf0f5; border-radius: 99px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--gold); border-radius: 99px; }
.avatar-sm, .avatar-md { border-radius: 50%; object-fit: cover; background: #e6ebf2; flex: none; }
.avatar-sm { width: 36px; height: 36px; }
.avatar-md { width: 64px; height: 64px; }
.avatar-initials.avatar-sm, .avatar-initials.avatar-md { display: grid; place-items: center; font-weight: 700; color: #8796ad; font-size: .8rem; }
.avatar-initials.avatar-md { font-size: 1.2rem; }
.cand-admin { list-style: none; padding: 0; margin: 0 0 8px; }
.cand-admin li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cand-admin li.inactive { opacity: .55; }
.ca-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ca-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 2px solid var(--line); padding: 8px 6px; }
.table td { border-bottom: 1px solid var(--line); padding: 8px 6px; vertical-align: middle; word-break: break-word; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters a { padding: 4px 10px; border-radius: 99px; text-decoration: none; border: 1px solid var(--line); }
.filters a.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.danger-zone { border: 1px solid #f2c7c0; }
@media (max-width: 560px) {
  h1 { font-size: 1.45rem; }
  .card { padding: 18px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .cand-photo.avatar-initials { font-size: 2.2rem; }
  .counter { margin-left: 0; width: 100%; }
  .ranking li { grid-template-columns: 22px 32px minmax(0, 1fr) 30px; }
  .ranking .bar { display: none; }
  .usernav .who { display: none; }
}

/* bar widths (inline styles are blocked by CSP) */
.w0{width:0%}
.w5{width:5%}
.w10{width:10%}
.w15{width:15%}
.w20{width:20%}
.w25{width:25%}
.w30{width:30%}
.w35{width:35%}
.w40{width:40%}
.w45{width:45%}
.w50{width:50%}
.w55{width:55%}
.w60{width:60%}
.w65{width:65%}
.w70{width:70%}
.w75{width:75%}
.w80{width:80%}
.w85{width:85%}
.w90{width:90%}
.w95{width:95%}
.w100{width:100%}

/* Import page */
.stats.compact { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stats.compact .stat { box-shadow: none; border: 1px solid var(--line); padding: 12px 14px; }
.report-list { margin: 0 0 16px; padding-left: 20px; font-size: .9rem; max-height: 320px; overflow: auto; }
.report-list li { padding: 2px 0; }
.report-list.bad li::marker { color: var(--red); }
.report-list.warn li::marker { color: var(--amber); }
.ok-text { color: var(--green); font-weight: 600; }
.steps { padding-left: 20px; display: flex; flex-direction: column; gap: 10px; margin: 0 0 16px; }
.table-wrap { overflow-x: auto; }

/* ---- Phones & touch screens (iOS / Android) ---- */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn-small { min-height: 40px; padding: 8px 12px; }
  .filters a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; }
  .subnav a { padding: 12px 14px; }
  .usernav a { padding: 8px 0; }
  label.inline input { width: 20px; height: 20px; }
}
@media (max-width: 560px) {
  .copybox, .row input[type=text] { font-size: 16px; }   /* iOS zooms into fields smaller than 16 px */
  .btn-lg { width: 100%; padding: 12px 20px; }
  .submitbar { padding: 6px; border-radius: 14px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  .subnav { flex-wrap: wrap; overflow: visible; }
  .subnav a { padding: 10px 10px; }
  .cand-admin li { flex-wrap: wrap; }
  .cand-admin .ca-body { flex-basis: calc(100% - 48px); }
  .ca-actions { width: 100%; justify-content: flex-start; padding-left: 48px; }
  .voters-table th:nth-child(2), .voters-table td:nth-child(2) { display: none; }  /* hide name column in voter list */
  .two-col { gap: 0; }
  .photo-row { flex-wrap: wrap; }
  .brand { font-size: .98rem; }
  .intro p { font-size: .95rem; }
}
@media (max-width: 360px) {
  .grid { gap: 10px; }
  .cand-body { padding: 10px 10px 12px; }
  .cand-name { font-size: .95rem; }
  .tick { width: 30px; height: 30px; top: 8px; right: 8px; }
  .card { padding: 16px; }
  .brand-logo { height: 32px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .submitbar { position: static; box-shadow: none; }
}

/* ---- Ballot: one page per category ---- */
.stepper { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.stepper li { background: var(--card); border-radius: 12px; border: 2px solid transparent; box-shadow: var(--shadow); min-width: 0; color: var(--muted); }
.stepper-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; height: 100%; color: inherit; text-decoration: none; }
a.stepper-item:hover .stepper-name { text-decoration: underline; }
.stepper-no { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: var(--line); color: var(--navy); }
.stepper-name { font-size: .9rem; font-weight: 600; line-height: 1.2; min-width: 0; overflow-wrap: anywhere; }
.stepper li.is-current { border-color: var(--gold); color: var(--navy); }
.stepper li.is-current .stepper-no { background: var(--gold); }
.stepper li.is-done .stepper-no { background: var(--navy); color: #fff; }
.step-no { display: block; width: 100%; margin: 0; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.review { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px; }
.review .step-no { margin-bottom: 6px; }
.review-list { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.review-cat { border-top: 1px solid var(--line); padding-top: 14px; }
.review-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.review-head h3 { margin: 0; }
.review-names { margin: 8px 0 0; padding-left: 20px; }
.review-names li { padding: 2px 0; font-weight: 600; color: var(--navy); }
.review-names li.muted { font-weight: 400; color: var(--muted); list-style: none; margin-left: -20px; }
.ballot .submitbar { justify-content: space-between; align-items: center; gap: 12px; }
.ballot .submitbar .js-back { order: 1; }
.ballot .submitbar .step-hint { order: 2; flex: 1; text-align: center; font-size: .92rem; color: var(--muted); min-width: 0; }
.ballot .submitbar .js-next, .ballot .submitbar .js-submit { order: 3; margin-left: auto; }
.step-hint.ok { color: var(--green); font-weight: 600; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
@media (max-width: 720px) {
  .stepper { gap: 6px; }
  .stepper-item { flex-direction: column; justify-content: flex-start; text-align: center; gap: 6px; padding: 8px 4px; }
  .stepper-name { font-size: .72rem; }
}
@media (max-width: 560px) {
  .ballot .submitbar { flex-wrap: wrap; gap: 6px; }
  .ballot .submitbar .step-hint { order: 0; flex-basis: 100%; font-size: .85rem; padding-top: 2px; }
  .ballot .submitbar .step-hint:empty { display: none; }
  .ballot .submitbar .btn-lg { width: auto; flex: 1; }
  .ballot .submitbar .js-back { flex: 0 0 auto; }
  .review { padding: 16px; }
}
@media (max-width: 380px) {
  .stepper-name { display: none; }
}
