/* Fonevia — theme-aware styles. Light/Dark via [data-theme], accent via [data-accent]. */
* { box-sizing: border-box; }
:root {
  --amber: #f59e0b;
  --radius: 14px;
}
html[data-theme="light"] {
  --bg: #f6f7f9; --surface: #ffffff; --surface2: #eef1f5; --text: #131a24;
  --muted: #5b6b7f; --border: #d9e0e9; --shadow: 0 6px 24px rgba(15, 30, 50, .08);
}
html[data-theme="dark"] {
  --bg: #0d1219; --surface: #161e29; --surface2: #1e2938; --text: #e8eef5;
  --muted: #94a6bb; --border: #2b3a4e; --shadow: 0 6px 24px rgba(0, 0, 0, .45);
}
html[data-accent="green"] { --accent: #16a34a; --accent-soft: rgba(22,163,74,.12); }
html[data-accent="blue"] { --accent: #2563eb; --accent-soft: rgba(37,99,235,.12); }
html[data-accent="purple"] { --accent: #7c3aed; --accent-soft: rgba(124,58,237,.14); }

body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Nastaliq Urdu", Arial, sans-serif;
  line-height: 1.45;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* header */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
.topbar-in { max-width: 1180px; margin: 0 auto; padding: .6rem 1rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.wordmark { font-size: 1.7rem; font-weight: 800; color: var(--text); letter-spacing: -.5px; }
.wordmark:hover { text-decoration: none; }
.wordmark .via { color: var(--amber); }
.wordmark.small { font-size: 1.25rem; }
.mainnav { display: flex; gap: .25rem; flex-wrap: wrap; flex: 1; }
.mainnav a { padding: .4rem .7rem; border-radius: 999px; color: var(--text); font-weight: 600; font-size: .95rem; }
.mainnav a.active, .mainnav a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.authbox { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.prefbar { max-width: 1180px; margin: 0 auto; padding: 0 1rem .6rem; display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.pref { display: flex; align-items: center; gap: .45rem; font-size: .9rem; font-weight: 600; }
.pref select { max-width: 190px; }
.themebox { margin-inline-start: auto; }
.chipbtn { border: 1px solid var(--border); background: var(--surface2); color: var(--text); border-radius: 999px; padding: .3rem .6rem; cursor: pointer; }
.accentdots { display: inline-flex; gap: .35rem; }
.dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.dot.on { border-color: var(--text); }

/* layout */
.view { max-width: 1180px; margin: 0 auto; padding: 1.2rem 1rem 3rem; min-height: 55vh; }
.footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer-in { max-width: 1180px; margin: 0 auto; padding: 1.4rem 1rem; }
.supportline a { font-weight: 700; }

/* generic controls */
input, select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font: inherit;
}
label.f { display: block; margin: .6rem 0; font-weight: 600; font-size: .92rem; }
label.f input, label.f select, label.f textarea { margin-top: .3rem; font-weight: 400; }
.btn {
  display: inline-block; border: 0; cursor: pointer; font: inherit; font-weight: 700;
  background: var(--accent); color: #fff; padding: .6rem 1.1rem; border-radius: 10px;
}
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn.ghost { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn.amber { background: var(--amber); color: #201503; }
.btn.danger { background: #dc2626; }
.btn.small { padding: .35rem .7rem; font-size: .88rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.notice { border: 1px solid var(--border); border-inline-start: 4px solid var(--amber); background: var(--surface); border-radius: 10px; padding: .8rem 1rem; margin: 1rem 0; }
.error { border: 1px solid #dc2626; background: rgba(220,38,38,.08); color: inherit; border-radius: 10px; padding: .7rem 1rem; margin: .8rem 0; }
.ok { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 10px; padding: .7rem 1rem; margin: .8rem 0; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.tbl th, table.tbl td { text-align: start; padding: .5rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
table.tbl th { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.scrollx { overflow-x: auto; }

/* listings */
.phone-card { overflow: hidden; display: flex; flex-direction: column; padding: 0; }
.phone-card img.main { width: 100%; height: 190px; object-fit: cover; background: var(--surface2); }
.phone-card .body { padding: .8rem .9rem 1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.price { font-size: 1.2rem; font-weight: 800; }
.price .approx { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); }
.strike { text-decoration: line-through; color: var(--muted); font-weight: 600; font-size: .95rem; }
.badge { display: inline-block; padding: .14rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 800; letter-spacing: .02em; }
.badge.verified { background: var(--amber); color: #201503; }
.badge.kyc { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent); }
.badge.grey { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }
.badge.red { background: rgba(220,38,38,.12); color: #dc2626; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.gallery img { width: 100%; height: 130px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.spec { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .5rem .9rem; margin: .8rem 0; }
.spec div b { display: block; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* stats + tabs */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .8rem; margin: 1rem 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem; }
.stat b { display: block; font-size: 1.35rem; }
.stat span { color: var(--muted); font-size: .85rem; font-weight: 600; }
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin: 1rem 0; }
.tabs a { padding: .45rem .85rem; border-radius: 999px; background: var(--surface2); color: var(--text); font-weight: 700; border: 1px solid var(--border); }
.tabs a.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tabs a:hover { text-decoration: none; }
.pill { font-size: .78rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; background: var(--surface2); border: 1px solid var(--border); }
.steps { display: flex; gap: .4rem; flex-wrap: wrap; margin: .8rem 0; }
.steps .step { padding: .4rem .7rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface2); font-size: .85rem; font-weight: 700; color: var(--muted); }
.steps .step.done { background: var(--accent); border-color: var(--accent); color: #fff; }
.checkline { display: flex; gap: .55rem; align-items: flex-start; margin: .45rem 0; font-weight: 600; }
.checkline input { width: auto; margin-top: .25rem; }
.hero { padding: 1.4rem 0 .4rem; }
.hero h1 { margin: .2rem 0; font-size: 1.9rem; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .6rem; margin: 1rem 0; }
[dir="rtl"] .mainnav, [dir="rtl"] .row { direction: rtl; }

@media (max-width: 640px) {
  .wordmark { font-size: 1.4rem; }
  .hero h1 { font-size: 1.5rem; }
  .pref select { max-width: 140px; }
  .phone-card img.main { height: 170px; }
}
