/* Parsa — "we filter between the light and darkness of the Internet" */
:root {
  --bg: #fdf7ec;          /* warm glow */
  --bg2: #f4ead6;
  --card: #ffffff;
  --ink: #2c3e57;         /* tagline navy */
  --muted: #6d7d92;
  --line: #e8dfcd;
  --brand: #4f74a0;       /* curtain blue */
  --brand-deep: #36577f;
  --brand-ink: #ffffff;
  --sky: #dcebf8;         /* wordmark light blue */
  --sky-ink: #3c6893;
  --gold: #e2ab3f;        /* stars */
  --gold-bg: #fdf0d2;
  --blush: #f3a891;       /* cheeks */
  --ok: #2f8a63; --ok-bg: #e2f4ea;
  --bad: #c2483a; --bad-bg: #fde8e3;
  --warn: #9a6a07; --warn-bg: #fff1cf;
  --radius: 22px; --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(44,62,87,.06), 0 8px 24px rgba(79,116,160,.08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111a28; --bg2: #172235; --card: #1a2638; --ink: #e8eef7; --muted: #9fb0c6; --line: #2a3a52;
    --brand: #7fa6d4; --brand-deep: #a9c6e8; --brand-ink: #0e1724; --sky: #22344f; --sky-ink: #b9d4f0;
    --gold: #f0c160; --gold-bg: #3a2f15; --ok: #6fd3a1; --ok-bg: #173226; --bad: #ff9a8c; --bad-bg: #3a1f1c;
    --warn: #f3c062; --warn-bg: #352a12;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111a28; --bg2: #172235; --card: #1a2638; --ink: #e8eef7; --muted: #9fb0c6; --line: #2a3a52;
  --brand: #7fa6d4; --brand-deep: #a9c6e8; --brand-ink: #0e1724; --sky: #22344f; --sky-ink: #b9d4f0;
  --gold: #f0c160; --gold-bg: #3a2f15; --ok: #6fd3a1; --ok-bg: #173226; --bad: #ff9a8c; --bad-bg: #3a1f1c;
  --warn: #f3c062; --warn-bg: #352a12;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 "Nunito", ui-rounded, "SF Pro Rounded", system-ui, sans-serif; }
body { background: radial-gradient(1200px 500px at 50% -120px, var(--gold-bg), transparent 70%), var(--bg); min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, .display { font-family: "Baloo 2", "Nunito", ui-rounded, system-ui, sans-serif; }
.wrap { max-width: 760px; margin: 0 auto; padding: 12px 16px 90px; }

header.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand img { width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 0 0 4px var(--gold-bg), 0 0 18px rgba(226,171,63,.45); }
.brand .name { font-family: "Baloo 2", system-ui, sans-serif; font-weight: 800; font-size: 26px; color: var(--brand); letter-spacing: .3px; line-height: 1; }
.brand .tag { font-size: 12px; color: var(--muted); line-height: 1.2; }
header.top .row { gap: 2px; flex-wrap: nowrap; }
header.top .btn.small.ghost { padding: 6px 9px; text-decoration: none; }

.sub { color: var(--muted); font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card h2 { font-size: 20px; margin: 0 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; }
.card h2 .sub { font-weight: 400; font-family: "Nunito", system-ui, sans-serif; }
.card h2 .ico { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: var(--sky); color: var(--sky-ink); margin-right: 8px; flex: none; }
.card h2 .ttl { display: flex; align-items: center; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }

.btn { border: 2px solid var(--line); background: var(--card); padding: 9px 16px; border-radius: 999px; cursor: pointer; font-weight: 700; white-space: nowrap; transition: transform .06s ease, filter .15s; }
.btn:hover { filter: brightness(.97); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.sky { background: var(--sky); color: var(--sky-ink); border-color: var(--sky); }
.btn.gold { background: var(--gold); color: #3a2a06; border-color: var(--gold); }
.btn.danger { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn.small { padding: 6px 12px; font-size: 14px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn:disabled { opacity: .5; cursor: default; }

input[type=text], input[type=password], input[type=email], input:not([type]), select, textarea {
  width: 100%; padding: 11px 14px; border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
textarea { min-height: 90px; resize: vertical; font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
label.f { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 4px; font-weight: 700; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--bg2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.sky { background: var(--sky); color: var(--sky-ink); }
.pill.gold { background: var(--gold-bg); color: var(--warn); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* big switch */
.kill { text-align: center; padding: 22px 18px; background: linear-gradient(180deg, var(--gold-bg), var(--card) 70%); }
.kill .state { font-size: 16px; color: var(--muted); margin-bottom: 12px; }
.kill .state b { color: var(--ink); }
.kill .big { width: 100%; max-width: 440px; padding: 18px; font-size: 21px; font-weight: 800; border-radius: 999px; border: 0; cursor: pointer; letter-spacing: .3px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-family: "Baloo 2", system-ui, sans-serif; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.kill .big.off { background: var(--brand-deep); color: #fff; }
.kill .big.on { background: var(--gold); color: #3a2a06; }
.kill.is-off { background: linear-gradient(180deg, #2c3e57, #3e5779); color: #fff; border-color: #2c3e57; }
.kill.is-off .state, .kill.is-off .state b, .kill.is-off .sub, .kill.is-off .sub b { color: #e6eef9; }
.kill .opts { margin-top: 10px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* toggle switch */
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(20px); }

/* network chips (on/off per Wi-Fi) */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 2px solid var(--line); background: var(--card); color: var(--muted); border-radius: 999px; padding: 4px 11px; font-size: 13px; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.chip.on::before { content: "✓"; font-size: 12px; }

.list > .item { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px dashed var(--line); }
.list > .item:first-child { border-top: 0; }
.item .t { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .d { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.wrapitem { flex-wrap: wrap; }
.wrapitem .left { flex: 1; min-width: 170px; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; }
.btns { display: flex; gap: 6px; flex-wrap: wrap; }
.slot { padding: 8px 0; border-top: 1px dashed var(--line); }
.slot:first-of-type { border-top: 0; }
.slot .line { display: flex; gap: 10px; align-items: center; }
.slot .n { width: 26px; height: 26px; border-radius: 50%; background: var(--sky); color: var(--sky-ink); font-weight: 800; display: grid; place-items: center; font-size: 13px; flex: none; }
.slot .chips { margin: 6px 0 0 36px; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 13px; word-break: break-all; }
.code { background: var(--bg); border: 2px dashed var(--line); border-radius: var(--radius-sm); padding: 12px; }
.notice { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.sky { background: var(--sky); color: var(--sky-ink); }
.highlight { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-bg), var(--shadow); }

/* Wi-Fi network tiles */
.nets { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.net { border: 2px solid var(--line); border-radius: 18px; padding: 14px; background: var(--bg); }
.net.main { border-color: var(--brand); }
.net .ssid { font-family: "Baloo 2", system-ui, sans-serif; font-weight: 800; font-size: 19px; display: flex; align-items: center; gap: 8px; word-break: break-all; }
.net .ssid svg { flex: none; color: var(--brand); }
.net .pw { display: flex; gap: 6px; align-items: center; margin: 8px 0; }
.net .pw input { font-family: ui-monospace, Menlo, monospace; font-size: 14px; padding: 8px 10px; }
.net.fiber { border-style: dashed; background: transparent; }

.login { max-width: 400px; margin: 4vh auto 0; text-align: center; }
.login img.logo { width: min(300px, 80vw); height: auto; display: block; margin: 0 auto 14px; background: #fff; border-radius: 28px; padding: 6px; box-shadow: var(--shadow); }
.login form { text-align: left; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 700; z-index: 50; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.hidden { display: none !important; }
details > summary { cursor: pointer; font-weight: 800; list-style: none; font-family: "Baloo 2", system-ui, sans-serif; font-size: 18px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: " ▸"; color: var(--muted); }
details[open] > summary::after { content: " ▾"; }
.modal { position: fixed; inset: 0; background: rgba(28,40,60,.5); display: grid; place-items: center; padding: 16px; z-index: 40; }
.modal .card { width: 100%; max-width: 540px; max-height: 90vh; overflow: auto; }
.qr { background: #fff; padding: 10px; border-radius: 14px; display: inline-block; }
.qr img { display: block; width: 200px; height: 200px; image-rendering: pixelated; }
.foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 26px; }
.foot .l { color: var(--gold); font-weight: 800; } .foot .dk { color: var(--ink); font-weight: 800; }
@media (max-width: 520px) {
  .brand .tag { display: none; }
  .kill .big { font-size: 19px; padding: 16px; }
  .card { padding: 16px; }
}

a { color: var(--brand); }
