/* Erikoislääkäriksi-sovellus. Värit ja mitat pasiaj.com/studysta
   (xpost src/pasiaj.com/study/src/styles.css), jotta sovellukset tuntuvat
   samalta perheeltä. */

:root {
  --bg: #f5f7f2;
  --surface: #ffffff;
  --surface-2: #eaf0e9;
  --text: #18233b;
  --muted: #56657a;
  --line: #dce5df;
  --accent: #d8f26b;
  --accent-ink: #18233b;
  --progress: #74ad78;
  --panel: #182a4a;
  --panel-ink: #ffffff;
  --panel-dim: #cfdbef;
  --good: #1f8a4c;
  --good-bg: #e2f4e8;
  --bad: #c2412d;
  --bad-bg: #fbe6e1;
  --radius: 20px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121a28;
    --surface: #1e293b;
    --surface-2: #2b3a49;
    --text: #f0f4f4;
    --muted: #b7c3c9;
    --line: #405160;
    --accent-ink: #172234;
    --progress: #8cc48f;
    --panel: #24344e;
    --panel-ink: #f0f4f4;
    --panel-dim: #b9c6d8;
    --good: #4cc27d;
    --good-bg: #183a28;
    --bad: #ff7a63;
    --bad-bg: #3d1f1b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.screen {
  max-width: 560px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.muted { color: var(--muted); }
.pieni { font-size: 0.85rem; }
.lataa { margin: auto; }

/* ---------- ylätunniste ---------- */
.ylä { display: flex; align-items: center; gap: 12px; margin: 8px 0 22px; }
.merkki {
  flex: none; width: 48px; height: 48px; border-radius: 13px;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em;
}
.ylä h1 { margin: 0; font-size: 1.45rem; letter-spacing: -0.02em; line-height: 1.1; }
.ylä p { margin: 2px 0 0; }
.ylä .välit { flex: 1; min-width: 0; }
.ylä .välit p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.osio { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin: 26px 0 10px; font-weight: 650; }

/* ---------- kortit ---------- */
.kortti {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px;
}
.kortti + .kortti { margin-top: 10px; }
.kortti h2 { margin: 0 0 4px; font-size: 1.15rem; }
.kortti p { margin: 6px 0 0; }

.polku { display: flex; gap: 14px; align-items: center; }
.polku-ikoni {
  flex: none; width: 46px; height: 46px; border-radius: 12px;
  background: var(--surface-2); display: grid; place-items: center; font-weight: 800;
}
.polku-teksti { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.polku-nimi { font-weight: 650; }
.merkintä { align-self: flex-start; font-size: 0.75rem; font-weight: 650; background: var(--surface-2); color: var(--muted); padding: 3px 9px; border-radius: 99px; }

.palkki { display: block; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.palkki i { display: block; height: 100%; width: 0; background: var(--progress); border-radius: 99px; }

.tyhjä { text-align: center; padding: 26px 18px; }
.tyhjä .iso { font-size: 2.2rem; line-height: 1; margin-bottom: 8px; }

.paneeli { background: var(--panel); color: var(--panel-ink); border: none; }
.paneeli p { color: var(--panel-dim); }

/* ---------- napit ja lomakkeet ---------- */
.nappi {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  border: 1px solid transparent; background: var(--accent); color: var(--accent-ink);
  border-radius: 14px; padding: 14px 18px; min-height: 52px; font-weight: 650; font-size: 1.05rem;
}
.nappi:disabled { opacity: 0.45; cursor: default; }
.nappi.toissijainen { background: var(--surface); border-color: var(--line); color: var(--text); }
.linkki { background: none; border: none; color: var(--muted); text-decoration: underline; padding: 8px; font-size: 0.9rem; min-height: 44px; }

form { display: grid; gap: 10px; }
label { font-size: 0.85rem; font-weight: 650; color: var(--muted); }
input, select {
  width: 100%; min-width: 0; padding: 13px 14px; border-radius: 12px; min-height: 52px;
  border: 1.5px solid var(--line); background: var(--bg); color: var(--text); font-size: 1rem;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
input[inputmode="numeric"] { font-size: 1.6rem; letter-spacing: 0.35em; text-align: center; font-variant-numeric: tabular-nums; }
.virhe { color: var(--bad); margin: 0; min-height: 1.3em; font-size: 0.92rem; }

.kirjaudu { margin: auto 0; padding: 24px 0; }
.kirjaudu .ylä { margin-bottom: 26px; }

.ohje ol { margin: 8px 0 0; padding-left: 20px; }
.ohje li { margin: 4px 0; }

.alalaita { margin-top: auto; padding-top: 28px; text-align: center; }
