/* DaleelyOS – simple, large, mobile-first. Main colour can be changed in one place (--brand). */
:root {
  --brand: #0E7C74; --brand-dark: #0a5c56; --bg: #f5f7f7; --card: #fff; --text: #1d2a2a; --muted: #6b7b7b;
  --good: #1e8e3e; --warn: #b26a00; --bad: #c62828; --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
  font-size: 17px; color: var(--text); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
#app { flex: 1; display: flex; flex-direction: column; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 16px;
  background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 2; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.1rem; }
.club { font-weight: 400; opacity: .9; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.top .link { color: #fff; border-color: rgba(255,255,255,.5); }
main { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 16px; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 12px; }
.card { background: var(--card); border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07); }
.narrow { max-width: 440px; margin-inline: auto; }
.center { text-align: center; }
h1 { font-size: 1.35rem; margin: 0 0 12px; }
h2 { font-size: 1.1rem; margin: 16px 0 8px; }
label { display: block; margin: 10px 0; font-weight: 600; }
input, select { display: block; width: 100%; margin-top: 6px; padding: 12px; font-size: 1rem; border: 1px solid #cfd8d8;
  border-radius: 10px; background: #fff; }
input:focus, select:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
button { font: inherit; padding: 12px 18px; border-radius: 10px; border: none; background: var(--brand); color: #fff;
  font-weight: 600; cursor: pointer; margin-top: 8px; }
button:disabled { opacity: .6; }
button.link { background: transparent; color: var(--brand); border: 1px solid transparent; padding: 6px 10px; margin: 0; }
form > button[type=submit] { width: 100%; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: start;
  background: #f0f5f5; color: var(--text); padding: 14px; border-radius: 10px; margin: 8px 0; }
button.row { flex-direction: column; align-items: flex-start; }
.muted { color: var(--muted); }
.error { color: var(--bad); font-weight: 600; }
.ok { color: var(--good); font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.tile { background: #f0f5f5; border-radius: 12px; padding: 14px; border-inline-start: 5px solid var(--brand); }
.tile .v { font-size: 1.5rem; font-weight: 700; }
.tile .l { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.tile.good { border-color: var(--good); } .tile.warn { border-color: var(--warn); } .tile.bad { border-color: var(--bad); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid #eef2f2; }
.qr { width: 200px; height: 200px; display: block; margin: 10px auto; }
.secret { display: block; word-break: break-all; background: #f0f5f5; padding: 8px; border-radius: 8px; margin-bottom: 8px; }
.qrbox svg { width: 220px; height: 220px; }
.bigcode { font-size: 2.4rem; font-weight: 800; letter-spacing: .15em; margin: 8px 0; font-family: ui-monospace, monospace; }

/* stage 2 */
.inline { display: flex; gap: 8px; align-items: center; }
.inline.wrap { flex-wrap: wrap; }
.inline.between { justify-content: space-between; margin: 8px 0 20px; }
.inline input, .inline select { margin-top: 0; }
.inline button { margin-top: 0; white-space: nowrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card.sub, .sub { background: #f7fafa; border-radius: 12px; padding: 12px; margin: 8px 0; box-shadow: none; }
h3 { font-size: 1rem; margin: 6px 0; }
.row.col { flex-direction: column; align-items: stretch; }
.rowline { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.row.small { padding: 8px 10px; font-size: .95rem; }
.small { font-size: .9rem; }
.badge { background: var(--brand); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: .8rem; }
.badge.off { background: #9aa8a8; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: auto; margin: 0; }
button.link.danger, a.link.danger { color: var(--bad); }
a.link { color: var(--brand); text-decoration: none; font-weight: 600; padding: 6px 10px; }
a.button { display: inline-block; text-decoration: none; padding: 12px 18px; border-radius: 10px; font-weight: 600; margin-top: 8px; }
a.button.wa { background: #25D366; color: #fff; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; }
.tab { background: #e3eded; color: var(--text); margin: 0; white-space: nowrap; }
.tab.on { background: var(--brand); color: #fff; }
.tabs.main .tab { flex: 1; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; }
.stepdot { background: #e3eded; border-radius: 999px; padding: 4px 12px; font-size: .9rem; }
.stepdot.on { background: var(--brand); color: #fff; } .stepdot.done { background: #cfe8e5; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } .inline:not(.between) { flex-wrap: wrap; } }
.badge button.x { background: transparent; color: #fff; padding: 0 2px; margin: 0; font-size: .9rem; line-height: 1; }

/* stage 3 – reception */
textarea { display: block; width: 100%; margin-top: 6px; padding: 12px; font: inherit; border: 1px solid #cfd8d8; border-radius: 10px; }
input[type=search] { margin-top: 0; }
.receipt { white-space: pre-wrap; background: #f0f5f5; padding: 14px; border-radius: 10px; font-family: inherit; line-height: 1.7; }
.card > .inline > input[type=search] { flex: 1; }

/* home button in the header */
.top button.homebtn { background: transparent; color: #fff; padding: 4px 6px; margin: 0; font-size: 1.1rem; display: flex; align-items: center; gap: 6px; }
.homeicon { font-size: 1.4rem; line-height: 1; }

/* stage 4 – door screen */
button.big { font-size: 1.3rem; padding: 18px 28px; width: 100%; }
.door { text-align: center; }
.doorhead { font-size: 1.1rem; margin-bottom: 6px; }
.doorhint { font-size: 1.4rem; font-weight: 700; margin: 8px 0 12px; }
.camwrap { max-width: 560px; margin: 0 auto; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.camwrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.camwrap video.mirror { transform: scaleX(-1); }
.doortype { max-width: 560px; margin: 14px auto 0; }
.doortype input { font-size: 1.3rem; letter-spacing: .08em; text-align: center; flex: 1; }
.doorresult { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; text-align: center; padding: 24px; }
.doorresult.ok { background: var(--good); } .doorresult.no { background: var(--bad); }
.doorbig { font-size: 7rem; line-height: 1; font-weight: 800; }
.doortitle { font-size: 2.4rem; font-weight: 800; margin-top: 10px; }
.doorname { font-size: 2rem; margin-top: 8px; }
.doorline { font-size: 1.4rem; margin-top: 8px; opacity: .95; }

/* door: code field on its own full-width line, button under it */
.door form.doortype { flex-direction: column; align-items: stretch; gap: 10px; }
.door form.doortype input { width: 100%; min-height: 56px; }
.door form.doortype button { width: 100%; }
