/* Public pages (registration, card lookup, voting). Built for phones first. */
:root {
  --udom: #18618c;
  --udom-dark: #0f4565;
  --udom-soft: #e9f2f7;
  --accent: #f7941d;
  --ink: #18242f;
  --muted: #647587;
  --line: #e2e8ee;
}

html { -webkit-text-size-adjust: 100%; }

html { background: #f2f5f8; }

body.public-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: #f2f5f8;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

/* Header: the invitation card's letterhead (logo left, regulator logo right, name between)
   on our blue. It stays fixed at the top, with the curved shape fixed beneath it. */
.public-bar {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1030;
  background: linear-gradient(135deg, var(--udom-dark), var(--udom) 70%, #2a86bb);
  color: #fff;
  padding: calc(9px + env(safe-area-inset-top)) 14px 9px;
  transition: box-shadow .2s;
}
.public-bar.scrolled { box-shadow: 0 4px 14px rgba(15, 69, 101, .25); }
.public-bar .bar { max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.public-bar img { width: 50px; height: 50px; border-radius: 50%; background: #fff; padding: 3px; object-fit: contain; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.public-bar .mid { flex: 1; min-width: 0; text-align: center; }
.public-bar .org { font-size: 1.02rem; font-weight: 800; color: #fff; letter-spacing: .04em; line-height: 1.15; }
.public-bar .motto { font-size: .68rem; font-style: italic; color: rgba(255, 255, 255, .82); line-height: 1.3; }
.public-bar h1 { color: #ffd08a; font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin: 3px 0 0; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }


/* The curved blue shape is fixed too, right under the bar. It sits behind the cards:
   the first card overlaps it, and cards scroll over it before passing under the bar. */
.public-curve {
  position: -webkit-sticky;
  position: sticky;
  top: calc(var(--bar-h, 68px) - 1px);
  z-index: 1;
  flex-shrink: 0;
  height: 58px;
  background: linear-gradient(135deg, var(--udom-dark), var(--udom) 70%, #2a86bb);
  border-radius: 0 0 26px 26px;
  border-bottom: 3px solid var(--accent);
}
.public-footer { position: relative; z-index: 2; }

.public-shell { position: relative; z-index: 2; width: 100%; max-width: 520px; margin: -46px auto 0; padding: 0 14px 8px; flex: 1 0 auto; }
.public-shell.wide { max-width: 860px; }

.public-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(15, 69, 101, .09);
  padding: 20px 18px;
  margin-bottom: 14px;
}

/* Meeting facts: icon rows */
.meeting-facts { list-style: none; margin: 0; padding: 0; }
.meeting-facts li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.meeting-facts li:first-child { padding-top: 0; }
.meeting-facts li:last-child { border-bottom: 0; padding-bottom: 0; }
.meeting-facts .ico { width: 38px; height: 38px; border-radius: 11px; background: var(--udom-soft); color: var(--udom); display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0; }
.meeting-facts small { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; line-height: 1.2; }
.meeting-facts strong { font-size: .98rem; color: var(--ink); }

/* Step progress */
.steps { margin: 0 0 18px; }
.steps .label { display: flex; justify-content: space-between; align-items: baseline; font-size: .82rem; color: var(--muted); margin-bottom: 8px; }
.steps .label strong { color: var(--ink); font-size: 1.05rem; }
.steps .track { display: flex; gap: 6px; }
.steps .track span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.steps .track span.on { background: var(--udom); }

/* Forms: large touch targets, 16px+ text so phones do not zoom */
.public-card .form-label { font-weight: 600; font-size: .92rem; margin-bottom: 8px; color: var(--ink); }
.public-card .form-control, .public-card .form-select, .public-card .input-group-text {
  min-height: 54px;
  font-size: 1.05rem;
  border: 1.5px solid #cdd7e0;
  border-radius: 13px;
  padding: .7rem 1rem;
}
.public-card .form-control.big { font-size: 1.5rem; font-weight: 700; letter-spacing: .08em; text-align: center; }
.public-card .form-control.big::placeholder { font-weight: 400; letter-spacing: 0; font-size: 1rem; color: #9aa8b6; }
/* One clean focus state: the whole field turns blue, no half-drawn rings */
.public-card .form-control, .public-card .form-select { outline: 0 !important; box-shadow: none !important; transition: border-color .15s, background-color .15s; -webkit-appearance: none; appearance: none; }
.public-card .form-control:focus, .public-card .form-select:focus { border-color: var(--udom) !important; border-width: 2px; background: #fbfdfe; box-shadow: none !important; }

/* Prefix + input behave as a single field */
.public-card .input-group { border: 1.5px solid #cdd7e0; border-radius: 13px; background: #fff; overflow: hidden; flex-wrap: nowrap; transition: border-color .15s; }
.public-card .input-group .input-group-text { border: 0 !important; border-radius: 0 !important; background: var(--udom-soft); color: var(--udom-dark); font-weight: 700; min-height: 51px; }
.public-card .input-group > .form-control { border: 0 !important; border-radius: 0 !important; min-height: 51px; padding-left: .8rem; background: transparent; }
.public-card .input-group:focus-within { border-color: var(--udom); box-shadow: inset 0 0 0 .5px var(--udom); }
.public-card .is-invalid, .public-card .has-error .form-control { border-color: #d64545 !important; }
.public-card .help-block, .public-card .invalid-feedback { color: #c0392b; font-size: .85rem; margin-top: 6px; display: block; }
.public-card .form-text { font-size: .85rem; color: var(--muted); margin-top: 8px; }
.public-card .select2-container--default .select2-selection--single { min-height: 54px; border-radius: 13px; border-color: #cdd7e0; }
.public-card .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 51px; font-size: 1.05rem; padding-left: 1rem; }
.public-card .select2-container--default .select2-selection--single .select2-selection__arrow { height: 52px; }

.btn-udom, .btn-udom-outline {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 54px; border-radius: 14px; font-weight: 700; font-size: 1.05rem; padding: .7rem 1rem;
}
.btn-udom { background: var(--udom); border: 0; color: #fff; box-shadow: 0 8px 18px rgba(24, 97, 140, .28); }
.btn-udom:hover, .btn-udom:focus, .btn-udom:active { background: var(--udom-dark) !important; color: #fff !important; }
.btn-udom:disabled { background: var(--udom); color: #fff; opacity: .7; }
.btn-udom-outline { background: #fff; border: 1.5px solid #cdd7e0; color: var(--udom-dark); }
.btn-udom-outline:hover, .btn-udom-outline:active { background: var(--udom-soft) !important; color: var(--udom-dark) !important; border-color: var(--udom) !important; }
.btn-udom.sm, .btn-udom-outline.sm { width: auto; min-height: 40px; font-size: .9rem; padding: .4rem .9rem; border-radius: 11px; box-shadow: none; }

/* Tappable link rows */
.link-rows { list-style: none; margin: 0; padding: 0; }
.link-rows a, .link-rows button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 2px; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: .98rem; text-align: left; text-decoration: none; }
.link-rows li:last-child a, .link-rows li:last-child button { border-bottom: 0; }
.link-rows .ico { width: 38px; height: 38px; border-radius: 11px; background: var(--udom-soft); color: var(--udom); display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0; }
.link-rows .go { margin-left: auto; color: #a3b1bf; font-size: 1.1rem; }
.link-rows small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
.link-rows a:active, .link-rows button:active { background: var(--udom-soft); }

.detail-list { margin: 0 0 18px; }
.detail-list div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: .96rem; }
.detail-list div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); font-weight: 400; }
.detail-list dd { margin: 0; font-weight: 700; text-align: right; }

.who { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.who .avatar { width: 50px; height: 50px; border-radius: 50%; background: var(--udom); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; flex-shrink: 0; }
.who strong { display: block; font-size: 1.08rem; line-height: 1.25; }
.who small { color: var(--muted); }

.public-note { background: var(--udom-soft); border-radius: 13px; padding: 13px 14px; font-size: .93rem; color: var(--udom-dark); }
.card-title-sm { font-size: 1.12rem; font-weight: 700; margin: 0 0 4px; }
.card-sub { color: var(--muted); font-size: .93rem; margin: 0 0 16px; }
/* Footer: help row and copyright, resting at the bottom of the screen on short pages */
.public-footer { flex-shrink: 0; margin-top: 10px; padding: 0 14px calc(14px + env(safe-area-inset-bottom) + var(--kb, 0px) + var(--scroll-room, 0px)); }
.public-footer .inner { max-width: 520px; margin: 0 auto; }
.public-footer .help { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); font-weight: 600; font-size: .98rem; text-align: left; }
.public-footer .help:active { background: var(--udom-soft); }
.public-footer .help .ico { width: 38px; height: 38px; border-radius: 11px; background: var(--udom-soft); color: var(--udom); display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0; }
.public-footer .help small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
.public-footer .help .go { margin-left: auto; color: #a3b1bf; font-size: 1.1rem; }
.public-footer p { text-align: center; color: var(--muted); font-size: .78rem; margin: 12px 0 0; }
.meeting-intro { font-size: .95rem; color: #3c4a5a; }
.meeting-intro p:last-child { margin-bottom: 0; }
.about { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.about h2 { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--udom); margin: 0 0 6px; }

.vote-choice { display: block; width: 100%; min-height: 58px; padding: .9rem 1rem; border-radius: 14px; border: 2px solid var(--line); background: #fff; font-weight: 700; font-size: 1.1rem; margin-bottom: 10px; }
.vote-choice:hover, .vote-choice:active { border-color: var(--udom); background: var(--udom-soft); }
.vote-choice.yes { color: #1a7f4b; }
.vote-choice.no { color: #c0392b; }
.vote-choice.abstain { color: var(--muted); }

/* Dialogs slide up from the bottom on phones */
body.public-page .modal-dialog { margin-top: 1.5rem; }
body.public-page .modal-footer .btn { min-height: 48px; }
@media (max-width: 575.98px) {
  body.public-page .modal-dialog { margin: 0; position: fixed; left: 0; right: 0; bottom: var(--kb, 0px); max-width: none; transition: bottom .2s, transform .3s; }
  body.public-page .modal-content { border-radius: 22px 22px 0 0; border: 0; padding-bottom: env(safe-area-inset-bottom); max-height: calc(88dvh - var(--kb, 0px)); overflow-y: auto; }
  body.public-page .modal.fade .modal-dialog { transform: translateY(40px); }
  body.public-page .modal.show .modal-dialog { transform: none; }
  body.public-page .modal-footer { flex-direction: column-reverse; align-items: stretch; }
  body.public-page .modal-footer .btn { width: 100%; }
}

@media (min-width: 576px) {
  .public-bar .org { font-size: 1.2rem; }
  .public-bar h1 { font-size: .82rem; }
  .public-bar img { width: 58px; height: 58px; }
  .public-card { padding: 26px 26px; }
}

/* Fields rendered by Yii forms */
.public-card .form-group { margin-bottom: 16px; }
.public-card .form-group > label, .public-card .control-label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 8px; color: var(--ink); }


.ready-badge { width: 64px; height: 64px; border-radius: 50%; background: #e3f6ec; color: #1a7f4b; font-size: 2rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }

.btn-udom.disabled, .btn-udom-outline.disabled { pointer-events: none; opacity: .85; }

html { scroll-padding-top: 112px; }
body.public-page { overflow-x: clip; }


/* Alerts (SweetAlert) must show above an open modal, not behind it */
.swal2-container {
    z-index: 9999 !important;
}
