/* MoreLove – widok sali. Kolory z logo: niebieski #194F8B i pomarańczowy #ED9955. */
:root {
  --blue: #194F8B;
  --blue-deep: #133E6E;
  --blue-line: #2E6299;
  --orange: #ED9955;
  --orange-ink: #B7611F;
  --page: #F4F6FA;
  --ink: #1B2B40;
  --muted: #5A6A80;
  --on-blue: #DCE7F4;
  --screen: #FFF8EE;
  --wood: #C08A5A;
  --wood-dark: #8A5A33;
  --seat: #FFFFFF;
  --chip: #EAF0F7;
  --led-off: #E5484D;
  --led-on: #2FCF78;
  --display: "Poppins", "Segoe UI", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { margin: 0; min-height: 100vh; background: var(--page); color: var(--ink); font: 16px/1.5 var(--body); }
button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- nagłówek ---------- */
.top {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 24px 4px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px 40px;
}
.logo { display: block; width: clamp(220px, 30vw, 360px); height: auto; }
.brand-course { margin: 6px 0 0; color: var(--muted); font-size: 1.05rem; }

.meta { text-align: right; }
.meta p { margin: 0; }
.meta .edition { color: var(--muted); }
.meta .meeting { font: 600 1.7rem/1.2 var(--display); color: var(--blue); }
.meta .date { color: var(--ink); }
.progress { display: flex; gap: 6px; justify-content: flex-end; margin-top: 10px; }
.progress .dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #B8C6D8; }
.progress .dot.past { background: #B8C6D8; }
.progress .dot.now { background: var(--orange); border-color: var(--orange); box-shadow: 0 0 8px var(--orange); }

/* ---------- wyszukiwarka par ---------- */
main { max-width: 1320px; margin: 0 auto; padding: 8px 24px 64px; }
.finder { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 18px 0 10px; }
.finder > label { font-weight: 700; }
.finder-box { position: relative; width: min(420px, 100%); }
.finder input {
  width: 100%;
  padding: 11px 16px;
  border-radius: 999px;
  border: 2px solid #C9D4E2;
  background: #fff;
  color: var(--ink);
}
.finder input:focus { border-color: var(--blue); }
.find-hint { margin: 0; color: var(--muted); font-size: .92rem; }
.status { flex-basis: 100%; margin: 0; color: #B42328; font-size: .95rem; }
.status:empty { display: none; }

.results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(19, 62, 110, .25);
  max-height: 60vh;
  overflow-y: auto;
}
.results button {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.results button:hover, .results button:focus-visible { background: var(--chip); outline: none; }
.results .pair { display: block; font-weight: 700; }
.results .where { display: block; font-size: .88rem; color: var(--muted); }
.results .none { padding: 10px 12px; color: var(--muted); }

/* ---------- sala ---------- */
.room {
  position: relative;
  margin-top: 8px;
  padding: 0 0 28px;
  background: var(--blue-deep);
  border-radius: 28px 28px 14px 14px;
  overflow: hidden;
}
.screen {
  position: relative;
  width: min(62%, 640px);
  margin: 0 auto 40px;
  height: 52px;
  display: grid;
  place-items: center;
  background: var(--screen);
  color: #9A8A70;
  border-radius: 0 0 8px 8px;
  font: 500 1rem var(--display);
  letter-spacing: .04em;
  box-shadow: 0 0 60px 14px rgba(255, 248, 238, .2);
}
.screen::after {
  content: "";
  position: absolute;
  top: 100%;
  left: -20%;
  width: 140%;
  height: 360px;
  background: linear-gradient(to bottom, rgba(255, 248, 238, .12), rgba(255, 248, 238, 0));
  clip-path: polygon(14% 0, 86% 0, 100% 100%, 0 100%);
  pointer-events: none;
}

.columns {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
  padding: 0 24px;
}
.col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.col-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 0 6px 26px; border-bottom: 2px solid var(--orange); }
.col-label { margin: 0; font: 600 1rem/1.3 var(--display); color: #fff; }
.col-count { color: var(--on-blue); font-size: .88rem; }

.empty { grid-column: 1 / -1; margin: 24px auto; max-width: 46ch; text-align: center; color: var(--on-blue); font-size: 1.1rem; }

/* ---------- ławka ---------- */
.bench { position: relative; padding-left: 26px; border-radius: 14px; transition: opacity .2s; }
.bench-no { position: absolute; left: 0; bottom: 2px; width: 20px; text-align: center; color: var(--on-blue); font-size: .85rem; }
.seats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.plank { height: 9px; margin-top: 6px; border-radius: 3px; background: linear-gradient(to bottom, var(--wood), var(--wood-dark)); box-shadow: 0 3px 0 rgba(0, 0, 0, .25); }

.room.filtering .bench:not(.hit) { opacity: .25; }
.bench.hit .seat { box-shadow: 0 0 0 3px var(--orange), 0 0 24px rgba(237, 153, 85, .7); }

.seat { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 10px; border-radius: 12px 12px 4px 4px; background: var(--seat); color: var(--ink); }
.seat-name { font-weight: 700; font-size: 1.05rem; line-height: 1.2; overflow-wrap: anywhere; }
.seat-name.blank { color: var(--muted); font-weight: 400; }

.sbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 6px 10px; border-radius: 8px;
  border: 1.5px solid #D0D9E5; background: #fff; color: var(--ink);
  font-size: .9rem; line-height: 1.15; cursor: pointer; text-align: left;
}
.sbtn:hover { border-color: var(--blue); }
.sbtn .ico { width: 20px; height: 20px; flex: none; }

.attend { justify-content: flex-start; }
.led { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--led-off); box-shadow: 0 0 0 2px rgba(229, 72, 77, .2), 0 0 8px rgba(229, 72, 77, .7); }
.attend.on { border-color: #BFE9D2; background: #ECFAF2; font-weight: 700; }
.attend.on .led { background: var(--led-on); box-shadow: 0 0 0 2px rgba(47, 207, 120, .2), 0 0 10px rgba(47, 207, 120, .9); }
.attend.just .led { animation: pulse .9s ease-out 2; }
@keyframes pulse { 50% { transform: scale(1.6); } }

.order { display: flex; flex-direction: column; gap: 6px; }
.order-chip { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 6px 8px; border-radius: 8px; background: var(--chip); font-size: .9rem; font-weight: 700; }
.order-chip .ico { width: 24px; height: 24px; }
.sugar-badge { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px 1px 3px; border-radius: 999px; background: #fff; font-weight: 400; font-size: .82rem; }
.sugar-badge .ico { width: 16px; height: 16px; }
.order-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.order-btns .sbtn { flex: 1 1 auto; min-height: 32px; font-size: .84rem; padding: 4px 8px; }
.sbtn.done { background: var(--blue); color: #fff; border-color: var(--blue); }
.sbtn.done:hover { background: var(--blue-deep); }

/* ---------- okna dialogowe ---------- */
dialog { width: min(460px, calc(100vw - 32px)); padding: 24px; border: none; border-radius: 18px; background: #fff; color: var(--ink); box-shadow: 0 30px 80px rgba(10, 30, 60, .45); }
dialog::backdrop { background: rgba(10, 30, 60, .6); }
dialog h2 { margin: 0 0 12px; font: 600 1.4rem/1.25 var(--display); color: var(--blue); }
dialog p { margin: 0 0 18px; }
.drink-lead { margin: -6px 0 16px; font-size: 1.1rem; }
fieldset { margin: 0; padding: 0; border: none; }

.drink-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.opt { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 2px solid #D0D9E5; background: #fff; cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .ico { width: 28px; height: 28px; flex: none; }
.opt:has(input:checked) { border-color: var(--blue); background: var(--chip); font-weight: 700; }
.opt:has(input:focus-visible) { outline: 3px solid var(--orange); outline-offset: 2px; }

.sugar-opt { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; }
.sugar-opt input { position: absolute; opacity: 0; }
.sugar-opt .box { width: 24px; height: 24px; border: 2px solid var(--ink); border-radius: 6px; background: #fff; display: grid; place-items: center; }
.sugar-opt input:checked + .box { background: var(--blue); border-color: var(--blue); color: #fff; }
.sugar-opt input:checked + .box::after { content: "✓"; font-weight: 700; line-height: 1; }
.sugar-opt input:focus-visible + .box { outline: 3px solid var(--orange); outline-offset: 2px; }
.sugar-opt:has(input:disabled) { opacity: .4; cursor: not-allowed; }

.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.btn { padding: 10px 18px; border-radius: 10px; border: 2px solid var(--blue); cursor: pointer; font-weight: 700; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-deep); }
.btn.ghost { background: transparent; color: var(--blue); }
.btn.danger { background: #B42328; border-color: #B42328; color: #fff; }
.btn.danger:hover { background: #8F1B1F; }
.btn:disabled { opacity: .5; cursor: wait; }

/* ---------- instalacja aplikacji ---------- */
.install {
  max-width: 1272px; margin: 14px auto 0; padding: 14px 18px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
  background: #fff; border: 2px solid var(--orange); border-radius: 16px;
}
.install p { margin: 0; max-width: 60ch; font-weight: 700; }
.install-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ios-steps { margin: 0; padding-left: 1.3em; display: grid; gap: 10px; }
.ios-note { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--chip); font-size: .95rem; }
.ios-warn { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: #FDF1E6; border-left: 5px solid var(--orange); font-weight: 700; }
.foot { max-width: 1320px; margin: 0 auto; padding: 0 24px 32px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; color: var(--muted); font-size: .88rem; }
.link-btn { padding: 0; border: none; background: none; color: var(--blue); font-weight: 700; text-decoration: underline; cursor: pointer; }

/* ---------- komunikat o następnym spotkaniu ---------- */
.notice {
  max-width: 640px; margin: 7vh auto 48px; padding: 36px 28px; text-align: center;
  background: #fff; border-radius: 24px; border-top: 6px solid var(--orange);
  box-shadow: 0 20px 50px rgba(19, 62, 110, .12);
}
.notice-logo { display: block; width: min(300px, 80%); height: auto; margin: 0 auto 10px; }
.notice-course { margin: 0 0 24px; padding-bottom: 22px; border-bottom: 1px solid #E3E9F1; color: var(--muted); }
.notice h2 { margin: 0 0 16px; font: 600 1.6rem/1.2 var(--display); color: var(--blue); }
.notice .when { margin: 0 0 12px; font-size: 1.3rem; line-height: 1.45; }
.notice .invite { margin: 0; font: 600 1.3rem var(--display); color: var(--orange-ink); }
.notice .which { margin: 20px 0 0; color: var(--muted); }

/* ---------- podgląd administratora ---------- */
.preview-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
  padding: 12px 24px; background: #FDF1E6; border-bottom: 3px solid var(--orange);
}
.preview-bar p { margin: 0; max-width: 80ch; }
.preview-bar a { color: var(--blue); font-weight: 700; }
.preview-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.preview-actions .btn { text-decoration: none; font-size: .92rem; padding: 7px 14px; }
.preview-actions .btn.primary { color: #fff; }

.sbtn.locked { color: #8A97A8; border-style: dashed; background: #F7F9FC; }
.sbtn.locked .ico { opacity: .5; }

/* ---------- koniec edycji ---------- */
.farewell { max-width: 560px; margin: 0 auto; padding: 12vh 24px 48px; text-align: center; }
.farewell .logo { margin: 0 auto 36px; width: min(320px, 80%); }
.farewell h1 { margin: 0 0 18px; font: 600 clamp(1.3rem, 4.5vw, 1.8rem)/1.3 var(--display); color: var(--blue); }
.farewell p { margin: 0 0 14px; font-size: 1.15rem; }
.farewell .recommend { margin-top: 28px; padding-top: 22px; border-top: 3px solid var(--orange); color: var(--orange-ink); font-weight: 700; }

/* ---------- komunikaty ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px);
  width: max-content; max-width: calc(100vw - 32px); padding: 12px 20px; border-radius: 12px; background: #fff; color: var(--ink); font-weight: 700;
  box-shadow: 0 12px 40px rgba(10, 30, 60, .35); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { border-left: 6px solid var(--led-on); }
.toast.err { border-left: 6px solid var(--led-off); }

/* ---------- tablet i telefon: trzy wyraźnie oddzielone grupy ławek ---------- */
@media (max-width: 1099px) {
  .room { background: transparent; overflow: visible; border-radius: 0; padding: 0; }
  .screen { width: 80%; margin-bottom: 24px; background: var(--blue-deep); color: var(--on-blue); box-shadow: none; border-radius: 10px; }
  .screen::after { display: none; }
  .columns { grid-template-columns: 1fr; gap: 28px; padding: 0; }
  .col { padding: 0 14px 18px; background: var(--blue-deep); border-radius: 20px; overflow: hidden; }
  .col-head { margin: 0 -14px 4px; padding: 14px 18px 12px; border-bottom: 4px solid var(--orange); background: var(--blue); }
  .col-label { font-size: 1.15rem; }
  .empty { color: var(--muted); }
}
@media (max-width: 1320px) { .install { margin: 14px 24px 0; } }
@media (max-width: 640px) {
  .install { margin: 12px 12px 0; }
  .top { padding: 18px 16px 4px; }
  .meta { text-align: left; }
  .progress { justify-content: flex-start; }
  main { padding: 4px 12px 48px; }
  .bench { padding-left: 22px; }
  .seat { padding: 8px; }
  .drink-opts { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
