/* Selanim Hospital Pro — Installer (haitegemei mfumo; ni ya kujitegemea) */

/* Fonti za chapa — zile zile za mfumo, hakuna CDN. */
@font-face {
    font-family: 'Inter';
    src: url('../assets/fonts/inter-var.woff2') format('woff2');
    font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Poppins';
    src: url('../assets/fonts/poppins-700.woff2') format('woff2');
    font-weight: 700; font-style: normal; font-display: swap;
}

:root {
    --bg: #f7f8fa; --surface: #fff; --text: #12141c; --muted: #5c6373;
    --border: #e4e7ed; --brand: #8f6a05; --brand-hover: #745604;
    --gold: #f0b91b; --ink: #12141c; --sand: #fdf7e7;
    --danger: #d93636; --danger-bg: #fdecea; --warn: #c8930a; --warn-bg: #fdf7e7;
    --ok: #1f9d55; --ok-bg: #e9f6ee;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #12141c; --surface: #1b1e2a; --text: #e8eaf0; --muted: #9aa0b0;
        --border: #2b3040; --brand: #f0b91b; --brand-hover: #f7d362;
        --gold: #f0b91b; --ink: #12141c; --sand: #2e2612;
        --danger: #e56b5b; --danger-bg: #3a1f1c; --warn: #f0b91b; --warn-bg: #2e2612;
        --ok: #4cb877; --ok-bg: #16301f;
    }
}

* { box-sizing: border-box; }
body {
    margin: 0; padding: 2rem 1rem;
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 15px; line-height: 1.55;
    background: var(--bg); color: var(--text);
}
.wrap { max-width: 760px; margin: 0 auto; }

.head { display: flex; align-items: center; gap: .9rem; margin-bottom: 1.5rem; }
.head h1 { margin: 0; font-size: 1.3rem; font-family: 'Poppins', 'Inter', sans-serif; font-weight: 700; letter-spacing: -.01em; }
.head p  { margin: 0; color: var(--muted); font-size: .88rem; }
.logo { flex: 0 0 auto; display: block; }
.logo img { display: block; width: 46px; height: 46px; object-fit: contain; border-radius: 12px; }
.logo img.wide { width: auto; max-width: 220px; max-height: 56px; border-radius: 0; }

/* Utepe wa gold — accent moja ya ukurasa (uwiano 60/30/10 wa chapa) */
.wrap::before {
    content: ""; display: block; height: 5px; width: 74px;
    background: var(--gold); border-radius: 3px; margin-bottom: 1.25rem;
}
.lang { margin-left: auto; display: flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.lang a { padding: .3rem .6rem; color: var(--muted); text-decoration: none; font-weight: 700; font-size: .8rem; }
.lang a.on { background: var(--brand); color: #fff; }

.steps { display: flex; list-style: none; margin: 0 0 1.25rem; padding: 0; gap: .25rem; flex-wrap: wrap; }
.steps li { flex: 1 1 0; min-width: 90px; text-align: center; font-size: .72rem; color: var(--muted); }
.steps .n {
    display: grid; place-items: center; width: 28px; height: 28px; margin: 0 auto .25rem;
    border-radius: 50%; border: 2px solid var(--border); font-weight: 700; font-size: .8rem;
}
.steps li.now .n  { border-color: var(--brand); background: var(--brand); color: #fff; }
.steps li.now     { color: var(--brand); font-weight: 700; }
.steps li.past .n { border-color: var(--ok); color: var(--ok); }

.panel {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; padding: 1.75rem;
    box-shadow: 0 2px 12px rgba(16,24,40,.06);
}
.panel h2 { margin: 0 0 .3rem; font-size: 1.15rem; font-family: 'Poppins', 'Inter', sans-serif; font-weight: 700; }
.muted { color: var(--muted); font-size: .88rem; margin-top: 0; }
.hint  { color: var(--muted); font-size: .78rem; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.row .small-field { max-width: 130px; }
.field { margin-bottom: .9rem; }
.field label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: .25rem; }
input[type=text], input[type=password], input[type=email], select {
    width: 100%; padding: .55rem .7rem;
    border: 1px solid var(--border); border-radius: 7px;
    background: var(--surface); color: var(--text); font: inherit; font-size: .92rem;
}
input:focus, select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(13,124,102,.15); }

.check { display: flex; gap: .55rem; align-items: flex-start; margin: 1rem 0; cursor: pointer; font-size: .9rem; }
.check input { width: 18px; height: 18px; margin-top: .15rem; accent-color: var(--brand); }

.actions { display: flex; gap: .6rem; margin-top: 1.5rem; align-items: center; flex-wrap: wrap; }
.btn {
    display: inline-block; padding: .55rem 1.1rem;
    border: 1px solid var(--border); border-radius: 7px;
    background: var(--surface); color: var(--text);
    font: inherit; font-size: .92rem; font-weight: 500; cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; margin-left: auto; }
.btn.primary:hover { background: var(--brand-hover); }
.btn.big { padding: .75rem 1.6rem; font-size: 1rem; }

.alert { padding: .7rem .9rem; border-radius: 8px; margin: .75rem 0; font-size: .88rem; border-left: 3px solid; }
.alert.err  { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.alert.warn { background: var(--warn-bg);   color: var(--warn);   border-color: var(--warn); }

.checks { list-style: none; margin: 1rem 0 0; padding: 0; }
.checks li {
    display: flex; align-items: center; gap: .6rem;
    padding: .5rem .2rem; border-bottom: 1px solid var(--border); font-size: .88rem;
}
.checks .mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .75rem; flex: 0 0 auto; }
.checks li.ok  .mark { background: var(--ok-bg); color: var(--ok); }
.checks li.bad .mark { background: var(--danger-bg); color: var(--danger); }
.checks li.bad .label { color: var(--danger); font-weight: 600; }
.checks .hint { margin-left: auto; color: var(--muted); font-size: .75rem; font-family: ui-monospace, Consolas, monospace; }

.lang-cards { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; margin: 1.25rem 0; }
.lang-card {
    display: flex; flex-direction: column; align-items: center; gap: .2rem;
    padding: 1.4rem 1rem; border: 2px solid var(--border); border-radius: 12px;
    text-decoration: none; color: var(--text);
}
.lang-card:hover { border-color: var(--brand); }
.lang-card.on { border-color: var(--brand); background: rgba(13,124,102,.06); }
.lang-card .flag { font-size: 1.9rem; }
.lang-card .muted { font-size: .78rem; margin: 0; }

.seed-box { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; margin: 1rem 0; }
.seed-list { list-style: none; margin: .6rem 0 0; padding: 0; font-size: .88rem; }
.seed-list li { padding: .18rem 0; color: var(--muted); }

.done { text-align: center; padding: 1rem 0; }
.done .tick {
    width: 66px; height: 66px; margin: 0 auto 1rem;
    border-radius: 50%; background: var(--ok-bg); color: var(--ok);
    display: grid; place-items: center; font-size: 2rem; font-weight: 800;
}
.done .actions { justify-content: center; }
.done .btn.primary { margin-left: 0; }

.foot { text-align: center; color: var(--muted); font-size: .78rem; margin-top: 1.5rem; }

@media (max-width: 560px) {
    .row { grid-template-columns: 1fr; }
    .row .small-field { max-width: none; }
    .lang-cards { grid-template-columns: 1fr; }
    .panel { padding: 1.2rem; }
}

/* ---- Chapa ya hospitali (hatua 4) ---- */

fieldset.brand {
    border: 1px solid #dfe5ec;
    border-radius: 8px;
    padding: .9rem 1rem 1rem;
    margin: 1rem 0;
}
fieldset.brand legend {
    padding: 0 .45rem;
    font-weight: 600;
    font-size: .9rem;
}
fieldset.brand .muted { margin-top: 0; }
fieldset.brand input[type="file"] { font-size: .85rem; }

.preview {
    margin-top: .5rem;
    display: grid;
    place-items: center;
    background: #f6f8fa;
    border: 1px dashed #cbd4de;
    border-radius: 6px;
    overflow: hidden;
}
.preview:empty { display: none; }
.preview img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.preview-logo    { width: 100%; max-width: 300px; height: 100px; }
.preview-favicon { width: 48px; height: 48px; }

.logo img { display: block; }

/* ---- Icons (sprite ile ile ya mfumo) ---- */

.icon {
    width: 1.15em;
    height: 1.15em;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -.17em;
}
.steps .n .icon { width: 1em; height: 1em; }
.tick .icon { width: 2.2em; height: 2.2em; stroke-width: 1.5; }
.check .mark .icon, li .icon { vertical-align: -.15em; }

/* ---------- Nenosiri na bendera — docs/007.md §7, §9 ---------- */

.pw-wrap { position: relative; display: block; }
.pw-wrap > input { width: 100%; }
.pw-wrap.js-on > input { padding-right: 2.4rem; }

.pw-wrap .pw-toggle {
    position: absolute;
    top: 50%;
    right: .35rem;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
}
.pw-wrap .pw-toggle:hover { color: #111827; background: rgba(0, 0, 0, .06); }

.flag-box { position: relative; display: block; }
.flag-box > select { width: 100%; padding-left: 2.2rem; }
.flag-box > img {
    position: absolute;
    top: 50%;
    left: .6rem;
    transform: translateY(-50%);
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .18);
    pointer-events: none;
}

.swatch-row { display: flex; align-items: center; gap: .6rem; }
.swatch-row input[type="color"] {
    width: 54px; height: 34px; padding: 2px; cursor: pointer;
    border: 1px solid var(--border); border-radius: 7px; background: var(--surface);
}
.swatch-row code { font-size: .82rem; color: var(--muted); }
.btn.small { padding: .32rem .6rem; font-size: .8rem; }
