/* Smjer "Meko i toplo" (spec 11b) za nove ekrane: prijava, ustanova, popis djece.
   Samostalna datoteka: ne ovisi o theme.css i ne mijenja ga. Sve klase imaju prefiks m-.
   Bez gradijenata, sjena i sjaja. Tekst na obojenim plohama je navy; bijeli samo na navy. */

.m-root {
  --m-white: #FFFFFF;
  --m-surface: #F3F5FA;
  --m-navy: #262E5D;
  --m-muted: #5B6290;
  --m-cyan: #2CC3F4;
  --m-cyan-card: #DFF4FD;
  --m-cyan-label: #0074AB;
  --m-lime: #D7E022;
  --m-lime-card: #F6F8CF;
  --m-lime-label: #6B7000;
  --m-line: #8A90B4;         /* rub polja: ≥ 3:1 prema bijeloj */
  --m-danger: #B42318;       /* tekst greške: ≥ 4,5:1 prema bijeloj */
  --m-danger-card: #FCE4E5;
  --m-focus: #0074AB;
  --m-radius: 16px;
  --m-head: 'Merriweather', Georgia, serif;
  --m-ui: 'Lexend', system-ui, -apple-system, sans-serif;

  margin: 0;
  min-height: 100vh;
  background: var(--m-white);
  color: var(--m-navy);
  font-family: var(--m-ui);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
.m-root.m-embedded { min-height: 0; border-radius: var(--m-radius); }  /* unutar stranice na theme.css */
.m-root *, .m-root *::before, .m-root *::after { box-sizing: border-box; }
.m-root [hidden] { display: none !important; }

.m-root :focus-visible { outline: 3px solid var(--m-focus); outline-offset: 2px; }

.m-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- okvir stranice ---------- */

.m-page { max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; }
.m-narrow { max-width: 472px; }
.m-grid { display: grid; gap: 16px; }
@media (min-width: 768px) {
  .m-page { padding: 40px 32px 64px; }
  .m-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}

/* Navy traka s bijelim logom (bijeli logo samo na navy). */
.m-band { background: var(--m-navy); padding: 14px 16px; }
.m-band-home { display: inline-flex; align-items: center; min-height: 44px; border-radius: 8px; }
.m-band-home img { display: block; height: 32px; width: auto; }
.m-band :focus-visible { outline-color: var(--m-cyan); }
@media (min-width: 768px) { .m-band { padding: 16px 32px; } }

/* Zaglavlje prijavljenog ekrana: mali sivi pozdrav i ime. */
.m-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.m-greeting { margin: 0; font-size: 14px; color: var(--m-muted); }
.m-name { margin: 2px 0 0; font-family: var(--m-head); font-weight: 700; font-size: 24px; line-height: 1.25; }

/* ---------- tekst ---------- */

.m-title { margin: 0 0 8px; font-family: var(--m-head); font-weight: 700; font-size: 28px; line-height: 1.2; text-wrap: balance; }
.m-title:focus { outline: none; }
.m-subtitle { margin: 0 0 12px; font-family: var(--m-head); font-weight: 700; font-size: 20px; line-height: 1.3; }
.m-lead { margin: 0 0 24px; color: var(--m-muted); text-wrap: pretty; }
.m-fine { margin: 24px 0 0; font-size: 13px; color: var(--m-muted); }
@media (min-width: 768px) { .m-title { font-size: 34px; } }

/* ---------- kartica i popis ---------- */

.m-card { background: var(--m-surface); border-radius: var(--m-radius); padding: 20px; }
@media (min-width: 768px) { .m-card { padding: 24px; } }

.m-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.m-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 10px 16px; background: var(--m-surface); border-radius: var(--m-radius); }
.m-row-title { font-weight: 500; }
.m-row-meta { font-size: 14px; color: var(--m-muted); }
.m-row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- gumbi (pilule) ---------- */

.m-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px;
  font: inherit; font-weight: 500; font-size: 16px; line-height: 1.2; text-decoration: none;
  cursor: pointer; transition: background-color .15s ease;
}
.m-btn-primary { background: var(--m-navy); color: var(--m-white); }
.m-btn-primary:hover { background: #343D73; }
.m-btn-secondary { background: var(--m-cyan); color: var(--m-navy); }
.m-btn-secondary:hover { background: #5AD2F7; }
.m-btn-ghost { background: transparent; color: var(--m-navy); }
.m-btn-ghost:hover { background: var(--m-surface); }
.m-btn-danger { background: var(--m-danger-card); color: var(--m-navy); }
.m-btn-danger:hover { background: #F8CDD0; }
.m-btn:disabled { opacity: .6; cursor: default; }
.m-btn-block { display: flex; width: 100%; }
.m-btn-small { min-height: 44px; padding: 0 16px; font-size: 14px; }
.m-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* Preklopnik dvaju načina (npr. Prijava / Registracija). */
.m-switch { display: flex; gap: 4px; padding: 4px; margin: 0 0 16px; background: var(--m-surface); border-radius: 999px; }
.m-switch-btn { flex: 1; min-height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--m-navy); font: inherit; font-weight: 500; cursor: pointer; transition: background-color .15s ease; }
.m-switch-btn[aria-pressed="true"] { background: var(--m-navy); color: var(--m-white); }

/* ---------- čipovi ---------- */

.m-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.m-chip {
  position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  border: 1.5px solid var(--m-muted); border-radius: 999px; background: var(--m-white); color: var(--m-navy);
  font: inherit; font-weight: 500; cursor: pointer; transition: background-color .15s ease;
}
.m-chip:not(.is-selected):hover { background: var(--m-cyan-card); }
.m-chip.is-selected, .m-chip[aria-pressed="true"] { background: var(--m-navy); border-color: var(--m-navy); color: var(--m-white); }
.m-chip input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.m-chip:has(input:focus-visible) { outline: 3px solid var(--m-focus); outline-offset: 2px; }
@supports not selector(:has(*)) {
  .m-chip:focus-within { outline: 3px solid var(--m-focus); outline-offset: 2px; }
}

/* ---------- obrazac ---------- */

.m-form { display: grid; gap: 18px; }
.m-field { margin: 0; padding: 0; border: 0; min-width: 0; }
.m-label { display: block; padding: 0; margin: 0 0 6px; font-weight: 500; font-size: 15px; }
.m-hint { margin: -2px 0 8px; font-size: 14px; color: var(--m-muted); }
.m-input {
  display: block; width: 100%; min-height: 48px; padding: 10px 14px;
  border: 1.5px solid var(--m-line); border-radius: 12px; background: var(--m-white); color: var(--m-navy);
  font: inherit; font-size: 16px;
}
.m-input[aria-invalid="true"] { border-color: var(--m-danger); border-width: 2px; }
.m-error { margin: 6px 0 0; font-size: 14px; color: var(--m-danger); }
.m-error:empty { display: none; }

/* ---------- obavijest i potvrda ---------- */

.m-notice { margin: 0; padding: 12px 16px; border-radius: 12px; background: var(--m-cyan-card); color: var(--m-navy); }
.m-notice-error { background: var(--m-danger-card); }
.m-confirm { padding: 16px; border-radius: var(--m-radius); background: var(--m-danger-card); color: var(--m-navy); }
.m-confirm p { margin: 0; }

/* ---------- pregled ustanove ---------- */

.m-section { margin: 32px 0 0; display: grid; gap: 12px; }
.m-section > * { margin: 0; }
.m-back { margin: 0 0 12px -16px; }
.m-row-link { flex: 1; min-width: 0; display: grid; gap: 2px; padding: 6px 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 8px; }
.m-row-link:hover .m-row-title { text-decoration: underline; }
.m-invite { display: grid; gap: 12px; }
.m-invite .m-actions { margin-top: 0; }
.m-invite-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.m-code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 20px; font-weight: 500; letter-spacing: .08em; }
.m-status { font-size: 14px; color: var(--m-cyan-label); font-weight: 500; }
.m-status:empty { display: none; }
.m-linkbox { font-size: 14px; }
.m-errorbar { padding-bottom: 0; }

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