/* ============================================================
   eSewak v3.6 — Multicolour theme ("Rang-patti")
   File: /assets/css/theme-mc.css
   ------------------------------------------------------------
   Har rang ek role hai:
     Customer = neela, Shop = hara, Worker = narangi, Rider = laal,
     Supervisor = teal, Admin = baingani, Haldi (gold) = brand
   - Sabhi .btn par multicolour border (rang-patti ring)
   - Hover par ring ghoomti hai + halki chamak (reduced-motion me nahi ghoomti)
   - Layout nahi badalta: ring ::before pseudo element hai
   Additive file — style.css ke baad load karein.
   ============================================================ */

:root {
  --mc-customer: #1f6feb;
  --mc-shop: #12a150;
  --mc-worker: #e8730c;
  --mc-rider: #e0294a;
  --mc-supervisor: #0fa3a3;
  --mc-admin: #7b3fe4;
  --mc-haldi: #f7b500;
  --mc-ink: #1a1b2e;
  --mc-paper: #fbfbfe;
  --mc-ring: conic-gradient(from var(--mc-a, 0deg),
      var(--mc-customer), var(--mc-supervisor), var(--mc-shop), var(--mc-haldi),
      var(--mc-worker), var(--mc-rider), var(--mc-admin), var(--mc-customer));
  --mc-band: linear-gradient(90deg,
      var(--mc-customer) 0 14.28%, var(--mc-supervisor) 0 28.56%, var(--mc-shop) 0 42.84%,
      var(--mc-haldi) 0 57.12%, var(--mc-worker) 0 71.4%, var(--mc-rider) 0 85.68%, var(--mc-admin) 0);
}

/* Ghoomne wali angle (Chrome / Edge / Safari 16.4+) — purane browser me ring static rahegi */
@property --mc-a {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
@keyframes mcSpin { to { --mc-a: 360deg; } }

/* ---------- Sabhi buttons: multicolour ring ---------- */
@supports ((mask-composite: exclude) or (-webkit-mask-composite: xor)) {
  .btn {
    position: relative;
    isolation: isolate;
    border-color: transparent !important;
    transition: transform .18s ease, box-shadow .18s ease, background .15s, color .15s;
  }
  .btn::before {
    content: "";
    position: absolute;
    inset: -1px;
    padding: 2px;
    border-radius: inherit;
    background: var(--mc-ring);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    pointer-events: none;
    z-index: 1;
    opacity: .9;
    transition: opacity .18s;
  }
  .btn:hover::before,
  .btn:focus-visible::before {
    opacity: 1;
    animation: mcSpin 2.4s linear infinite;
  }
  .btn:hover {
    transform: translateY(-1px);
    box-shadow: -3px 4px 14px -6px var(--mc-customer), 3px 4px 14px -6px var(--mc-rider);
  }
  .btn:active { transform: translateY(0); }
  .btn[disabled], .btn.disabled { transform: none; box-shadow: none; }
  .btn[disabled]::before, .btn.disabled::before { animation: none; opacity: .4; }
}
.btn:focus { outline: none; }
.btn:focus-visible { outline: 3px solid var(--mc-customer); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .btn:hover::before, .btn:focus-visible::before { animation: none; }
  .btn:hover { transform: none; }
}

/* ---------- Bhara hua multicolour button (home page ka mukhya CTA) ---------- */
.btn.btn-mc {
  color: #fff;
  font-weight: 700;
  background: linear-gradient(100deg, var(--mc-customer), var(--mc-admin) 35%, var(--mc-rider) 65%, var(--mc-worker));
  background-size: 200% 100%;
  background-position: 0% 50%;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .25);
  transition: background-position .5s ease, transform .18s ease, box-shadow .18s ease;
}
.btn.btn-mc:hover, .btn.btn-mc:focus-visible {
  color: #fff;
  background: linear-gradient(100deg, var(--mc-customer), var(--mc-admin) 35%, var(--mc-rider) 65%, var(--mc-worker));
  background-size: 200% 100%;
  background-position: 100% 50%;
}
.btn.btn-mc::before { opacity: .55; }

/* Safed button jiska sirf rang-patti border dikhta hai */
.btn.btn-ring {
  background: #fff;
  background-image: none;
  color: var(--mc-ink);
  font-weight: 600;
}
.btn.btn-ring:hover { background: #fff; color: var(--mc-ink); }

/* Patli rang-patti (header ke upar / section divider) */
.mc-band { height: 5px; background: var(--mc-band); }

/* ============================================================
   v3.7 — Hindi / English
   [data-l="en"] sirf English me, [data-l="hi"] sirf Hindi me dikhta hai
   (html lang attribute Lang.apply() set karta hai; head me chhota boot script bhi)
   ============================================================ */
html[lang="hi"] [data-l="en"],
html:not([lang="hi"]) [data-l="hi"] { display: none !important; }

/* Logo: English me "eSewak", Hindi me "ई-सेवक" */
.brand-logo { display: block; height: 42px; width: auto; }
.brand-pill { display: inline-flex; align-items: center; background: #fff; border-radius: 12px; padding: 3px 10px 3px 6px; line-height: 0; }
.brand-pill .brand-logo { height: 34px; }
.app-header .logo { text-decoration: none; }
@media (max-width: 560px) {
  .brand-logo { height: 34px; }
  .brand-pill .brand-logo { height: 28px; }
}

/* Bhasha badalne ka button (EN | हिं) */
.lang-sw { display: inline-flex; border-radius: 999px; padding: 3px; background: #eef0f8; gap: 2px; }
.lang-sw button {
  border: 0; background: transparent; font: inherit; font-size: .82rem; font-weight: 600; line-height: 1;
  padding: 7px 11px; border-radius: 999px; cursor: pointer; color: #4a4d68;
}
.lang-sw button.active { background: #fff; color: var(--mc-ink); box-shadow: 0 1px 4px rgba(26, 27, 46, .18); }
.lang-sw button:focus-visible { outline: 2px solid var(--mc-customer); outline-offset: 1px; }
.lang-sw.on-dark { background: rgba(255, 255, 255, .16); }
.lang-sw.on-dark button { color: #fff; }
.lang-sw.on-dark button.active { color: var(--mc-ink); }

/* ============================================================
   v3.9 — App ke rang ka halka background (login page + login ke baad)
   <body data-role-theme="shop"> … Customer neela, Shop hara, Worker narangi,
   Rider laal, Supervisor teal, Sewak (Admin) baingani
   ============================================================ */
[data-role-theme="customer"]   { --rt: #1f6feb; --rt-ink: #0d3c78; --rt-bg: #edf4ff; --rt-bg2: #d9e7ff; }
[data-role-theme="shop"]       { --rt: #12a150; --rt-ink: #0b5d2a; --rt-bg: #ebf8f0; --rt-bg2: #d2f0de; }
[data-role-theme="worker"]     { --rt: #e8730c; --rt-ink: #7a3a05; --rt-bg: #fff3e8; --rt-bg2: #ffe2c6; }
[data-role-theme="rider"]      { --rt: #e0294a; --rt-ink: #7a0d17; --rt-bg: #fdeef1; --rt-bg2: #fad5dc; }
[data-role-theme="supervisor"] { --rt: #0fa3a3; --rt-ink: #0b5552; --rt-bg: #e8f8f8; --rt-bg2: #cbefef; }
[data-role-theme="admin"]      { --rt: #7b3fe4; --rt-ink: #4b1f9c; --rt-bg: #f3eefd; --rt-bg2: #e2d6fb; }
body[data-role-theme] { background: var(--rt-bg) !important; transition: background-color .25s; }
body[data-role-theme] .dash-main,
body[data-role-theme] .dash-sidebar { border-color: var(--rt-bg2); }
body[data-role-theme] .dash-nav-item.active { border-color: var(--rt); }
body[data-role-theme] .admin-login-shell { background: linear-gradient(180deg, var(--rt-bg2), var(--rt-bg)); }
body[data-role-theme] .admin-login-card { border-top: 6px solid var(--rt); }

/* ---------------- Login page: ⚙️ type badlein + PIN / Fingerprint ---------------- */
.ls-gear {
  position: fixed; top: 12px; right: 12px; z-index: 120; width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--rt, #1f6feb); background: #fff; font-size: 1.25rem; cursor: pointer; line-height: 1;
  display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0, 0, 0, .12); transition: transform .3s;
}
.ls-gear:hover, .ls-gear:focus-visible { transform: rotate(60deg); outline: none; }
.ls-list { display: grid; gap: 8px; }
.ls-list a, .ls-list button {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 2px solid #e3e5f0;
  background: #fff; text-decoration: none; color: var(--mc-ink); font: inherit; font-weight: 600; cursor: pointer; text-align: left; width: 100%;
}
.ls-list img { width: 40px; height: 40px; border-radius: 10px; }
.ls-list small { display: block; font-weight: 400; color: #6a6d85; font-size: .78rem; }
.ls-list [aria-current="true"] { border-color: var(--rt, #1f6feb); background: var(--rt-bg, #f4f6fb); }
.ls-list a:hover, .ls-list button:hover { border-color: #b9bdd3; }

.ql-or { display: flex; align-items: center; gap: 10px; margin: 16px 0 10px; color: #6a6d85; font-size: .82rem; }
.ql-or::before, .ql-or::after { content: ""; flex: 1; height: 1px; background: #e3e5f0; }
.ql-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ql-btns .btn { padding: 11px 8px; border-radius: 12px; white-space: normal; }
.ql-btn.ql-dim { opacity: .55; }
.ql-who { margin: 8px 0 0; font-size: .8rem; color: #5a5d76; text-align: center; }
.ql-who:empty { display: none; }
.ql-pin-input { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-weight: 700; }
.ql-setup { display: grid; gap: 10px; }
.ql-card { margin-top: 14px; }
.ql-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid #eef0f5; flex-wrap: wrap; }
.ql-row-btns { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------------- v3.10: GPS geo box (Latitude / Longitude dikhte hain) ---------------- */
.geo-box {
  border: 2px dashed var(--rt, #1f6feb); border-radius: 14px; padding: 12px 14px 10px; margin: 8px 0 14px;
  background: var(--rt-bg, #f4f8ff);
}
.geo-box.has-fix { border-style: solid; }
.geo-box.bad-fix { border-color: #d93025; }
.geo-head { font-size: .9rem; margin-bottom: 6px; color: var(--mc-ink, #1d1f33); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.geo-acc { font-size: .78rem; color: #5a5d76; background: #fff; border-radius: 99px; padding: 1px 8px; }
.geo-acc:empty { display: none; }
.geo-box .input-group { margin-bottom: 8px; }
.geo-box .geo-lat, .geo-box .geo-lng { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; }
.geo-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.geo-actions .gps-btn { margin: 2px 0; }
.geo-map { font-size: .85rem; font-weight: 600; color: var(--rt-ink, #1f6feb); text-decoration: none; padding: 6px 10px; border-radius: 8px; background: #fff; border: 1px solid #dfe3ee; }
.geo-map:hover { text-decoration: underline; }
.geo-map.hidden { display: none; }
.geo-status { font-size: .8rem; margin-top: 6px; line-height: 1.4; color: #4a4d66; word-break: break-word; }
.geo-status:empty { display: none; }
.geo-status.ok { color: #137333; }
.geo-status.warn { color: #9a6700; }
.geo-status.err { color: #c5221f; }
.geo-status.busy { color: #1a56c4; }
.gps-btn.captured { background: #137333; }

/* ---------------- v3.10: Installed device par install UI nahi ---------------- */
.pwa-hidden,
html.pwa-standalone [data-pwa-hide-installed],
html.pwa-installed [data-pwa-hide-installed],
html.pwa-installed [data-pwa-install],
html.pwa-installed .pwa-install-banner,
html.pwa-standalone .pwa-install-banner { display: none !important; }
.ra-app.is-installed .ra-app-cta { background: #137333 !important; color: #fff !important; }

/* ---------------- v3.10: Profile icon (right corner) ---------------- */
.pm { position: relative; display: flex; align-items: center; margin-left: 6px; }
.pm.pm-fixed { position: fixed; top: 10px; right: 12px; z-index: 160; margin: 0; }
.pm-hide { display: none !important; }
.pm-btn {
  width: 42px; height: 42px; border-radius: 50%; padding: 2px; border: 0; cursor: pointer; flex-shrink: 0;
  background: conic-gradient(from 0deg, #ff6b00, #ffc400, #1aa64a, #1f6feb, #8e3fd8, #e8318a, #ff6b00);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .18); transition: transform .2s;
}
.pm-btn:hover, .pm-btn:focus-visible { transform: scale(1.07); outline: none; }
.pm-av {
  width: 100%; height: 100%; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: #fff; color: var(--rt-ink, #1f6feb); font-size: 1.05rem; border: 2px solid #fff; position: relative;
}
.pm-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-av.pm-busy::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 3px solid transparent;
  border-top-color: var(--rt, #1f6feb); animation: pmspin .8s linear infinite; background: rgba(255, 255, 255, .55);
}
@keyframes pmspin { to { transform: rotate(360deg); } }
.pm-panel {
  position: absolute; right: 0; top: calc(100% + 10px); width: 290px; max-width: calc(100vw - 20px);
  background: #fff; color: var(--mc-ink, #1d1f33); border-radius: 16px; z-index: 400;
  box-shadow: 0 14px 40px rgba(20, 24, 60, .22); border: 1px solid #e6e8f2; overflow: hidden; text-align: left;
}
.pm-panel[hidden] { display: none; }
.pm-head { display: flex; gap: 12px; align-items: center; padding: 14px; background: var(--rt-bg, #f4f6fb); border-bottom: 1px solid #eceef6; }
.pm-photo { position: relative; width: 64px; height: 64px; flex-shrink: 0; cursor: pointer; border-radius: 50%; padding: 2px;
  background: conic-gradient(from 0deg, #ff6b00, #ffc400, #1aa64a, #1f6feb, #8e3fd8, #e8318a, #ff6b00); }
.pm-av-lg { font-size: 1.6rem; }
.pm-cam { position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%; background: #fff;
  display: grid; place-items: center; font-size: .8rem; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.pm-who { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pm-name { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-meta { font-size: .75rem; color: #5a5d76; overflow-wrap: anywhere; }
.pm-role { align-self: flex-start; font-size: .7rem; font-weight: 700; color: #fff; background: var(--rt, #1f6feb); border-radius: 99px; padding: 1px 8px; margin-top: 2px; }
.pm-role:empty { display: none; }
.pm-items { display: grid; padding: 6px; }
.pm-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: 10px;
  font: inherit; font-size: .9rem; color: inherit; cursor: pointer; text-align: left; }
.pm-item:hover, .pm-item:focus-visible { background: var(--rt-bg, #f4f6fb); outline: none; }
.pm-item[hidden] { display: none; }
.pm-danger { color: #c5221f; }
.dash-user-avatar.pm-has-img { padding: 0; overflow: hidden; }
.dash-user-avatar.pm-has-img img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
@media (max-width: 480px) { .pm-btn { width: 38px; height: 38px; } }
body.pm-on .admin-topbar { padding-right: 64px; }
/* v3.10: Admin email settings */
.am-src { font-size: .65rem; margin-left: 4px; vertical-align: middle; }
.am-test { display: flex; gap: 8px; flex-wrap: wrap; }
.am-test .input { flex: 1; min-width: 200px; }

/* ---------------- v3.11: Pincode options (GPS ke baad) ---------------- */
.pin-suggest { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.pin-suggest:empty { display: none; }
.pin-sg-label { font-size: .75rem; color: #5a5d76; }
.pin-chip { border: 1.5px solid #d6dae8; background: #fff; border-radius: 99px; padding: 4px 10px; font: inherit; font-size: .8rem; cursor: pointer; color: var(--mc-ink, #1d1f33); }
.pin-chip small { color: #6a6d85; font-size: .68rem; }
.pin-chip:hover { border-color: var(--rt, #1f6feb); }
.pin-chip.on { border-color: #137333; background: #e8f5ec; }
.pin-sg-warn { flex-basis: 100%; font-size: .75rem; color: #9a6700; }

/* ---------------- v3.12: Admin categories ---------------- */
.cat-icons { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-ic { font-size: 1.35rem; width: 42px; height: 42px; border-radius: 10px; border: 1px solid #e3e5f0; background: #fff; cursor: pointer; }
.cat-ic:hover { border-color: var(--rt, #1f6feb); transform: scale(1.06); }
.cat-switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: .82rem; white-space: nowrap; }
.cat-switch input { width: 18px; height: 18px; }
/* v3.12: Admin — verification mode */
.otp-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin-bottom: 6px; }
.otp-mode { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 10px 34px; position: relative; border: 2px solid #e3e5f0; border-radius: 12px; cursor: pointer; background: #fff; }
.otp-mode input { position: absolute; left: 10px; top: 12px; }
.otp-mode small { color: #6a6d85; font-size: .75rem; line-height: 1.35; }
.otp-mode.on { border-color: var(--rt, #1f6feb); background: var(--rt-bg, #f4f6fb); }

/* ---------------- v3.12: Registration mobile OTP ---------------- */
.otp-box { margin-top: 8px; padding: 10px 12px; border-radius: 12px; border: 1.5px dashed var(--rt, #1f6feb); background: var(--rt-bg, #f4f8ff); display: grid; gap: 8px; }
.otp-box.done { border-style: solid; border-color: #137333; background: #eef8f1; }
.otp-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.otp-input { max-width: 170px; font-size: 1.25rem; letter-spacing: .35em; text-align: center; font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.otp-msg { font-size: .8rem; color: #4a4d66; }
.otp-msg.ok { color: #137333; }
.otp-msg.err { color: #c5221f; }
.otp-ok { color: #137333; font-weight: 600; font-size: .9rem; }
.otp-ok a { font-weight: 500; margin-left: 6px; }
.otp-badge { font-size: .68rem; background: var(--rt, #1f6feb); color: #fff; border-radius: 99px; padding: 1px 6px; vertical-align: middle; }
.otp-box .hidden { display: none !important; }
label .opt { font-weight: 400; color: #6a6d85; }
/* v3.13: WhatsApp OTP button */
.otp-wa { border-color: #25d366 !important; color: #0b6b3a !important; }
.otp-box .otp-wa:not([disabled]) { background: #e9fbef; }
