/* Kolory i czcionka jak w Babciofonie (Design.kt): róż, jagoda, Atkinson Hyperlegible. Cyfry, jak w aplikacji, ze zwykłej
   czcionki systemowej, bo Atkinson przekreśla zero: unicode-range pomija 0–9, więc biorą się z następnej czcionki. */
@font-face { font-family: "Atkinson"; src: url("/fonts/atkinson_regular.ttf") format("truetype"); font-weight: 400; font-display: swap; unicode-range: U+0000-002F, U+003A-FFFF; }
@font-face { font-family: "Atkinson"; src: url("/fonts/atkinson_bold.ttf") format("truetype"); font-weight: 700; font-display: swap; unicode-range: U+0000-002F, U+003A-FFFF; }

:root {
  color-scheme: light;
  --ink: #231621;
  --muted: #6b5463;
  --berry: #ad165d;
  --blush: #f8ccdf;
  --green: #0a7f27;
  --red: #c62828;
  --amber: #b26a00;
  --card: #fff9fc;
  --line: rgba(107, 84, 99, 0.18);
  --radius: 22px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Atkinson", -apple-system, system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(#fde5f4, #ffd0e4);
  line-height: 1.35;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 6px 4px 0; }
h1 { margin: 0; font-size: 34px; letter-spacing: -0.01em; }
h2 { margin: 0 0 8px; font-size: 19px; }
h2:not(:first-child) { margin-top: 20px; }

.status { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 16px; color: var(--muted); text-align: right; }
.dot { width: 11px; height: 11px; flex: none; border-radius: 50%; background: #bba7b3; }
.status.ok .dot { background: var(--green); }
.status.bad { color: var(--red); font-weight: 700; }
.status.bad .dot { background: var(--red); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 0 var(--line), 0 6px 18px rgba(173, 22, 93, 0.07); }

.map-card { overflow: hidden; }
#map { height: 46vh; min-height: 260px; max-height: 420px; background: #f3e6ed; }
.place { margin: 0; padding: 12px 16px 14px; font-size: 16px; color: var(--muted); }
.place a { color: var(--berry); font-weight: 700; text-decoration: none; white-space: nowrap; }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fact { padding: 12px 12px 13px; display: flex; flex-direction: column; min-width: 0; }
.fact .label { font-size: 14px; color: var(--muted); }
.fact strong { font-size: 26px; font-variant-numeric: tabular-nums; font-family: -apple-system, system-ui, sans-serif; }
.fact .sub { font-size: 14px; color: var(--muted); min-height: 1.35em; }
.fact.low strong { color: var(--red); }
.fact.charging .sub { color: var(--green); font-weight: 700; }

.actions { display: flex; flex-direction: column; gap: 10px; }
.pair-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

button {
  font: inherit;
  font-size: 20px;
  font-weight: 700;
  color: var(--berry);
  background: var(--card);
  border: 2.5px solid var(--berry);
  border-radius: 999px;
  min-height: 62px;
  padding: 10px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button small { font-size: 14px; font-weight: 400; color: var(--muted); }
button.primary { background: var(--berry); color: #fff; border-color: var(--berry); min-height: 70px; font-size: 21px; }
button:active { filter: brightness(0.9); }
button:disabled { opacity: 0.5; }
button.quiet { min-height: 48px; font-size: 17px; border-width: 2px; }

.queue { list-style: none; margin: 2px 0 0; padding: 0 6px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; color: var(--muted); }
.queue .done { color: var(--green); }

.setup { padding: 16px 16px 18px; }
.setup p { margin: 0 0 10px; color: var(--muted); font-size: 16px; }
.setup .on { color: var(--green); font-weight: 700; }
.code { font-family: -apple-system, system-ui, sans-serif; font-size: 44px; font-weight: 700; letter-spacing: 0.08em; color: var(--berry); margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.buttons button { flex: 1 1 auto; }

.locked { min-height: 100vh; justify-content: center; text-align: center; }
.locked p { color: var(--muted); font-size: 18px; }

/* Pinezka telefonu na mapie. */
.pin { width: 22px; height: 22px; border-radius: 50%; background: var(--berry); border: 4px solid #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35); }
.leaflet-container { font-family: inherit; }

@media (max-width: 360px) {
  .fact strong { font-size: 22px; }
  button { font-size: 18px; }
}

/* Logowanie. */
.login { min-height: 100vh; justify-content: center; gap: 18px; padding-bottom: 20vh; }
.login h1 { text-align: center; }
.login-icon { width: 84px; height: 84px; border-radius: 22px; align-self: center; box-shadow: 0 6px 18px rgba(173, 22, 93, 0.15); }
.login form { padding: 20px 18px; display: flex; flex-direction: column; gap: 10px; }
.login label { font-size: 17px; color: var(--muted); font-weight: 700; }
.login input {
  font: inherit; font-size: 22px; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--line);
  background: #fff; color: var(--ink); width: 100%;
}
.login input:focus { outline: none; border-color: var(--berry); }
.problem { margin: 0; min-height: 1.3em; color: var(--red); font-weight: 700; font-size: 16px; }
