/* =========================================================
   Universal theme
   - Neutral (black / white / grey) by default, so it looks right on any site.
   - To match a client's brand, change ONE value: --brand  (or set THEME_COLOR in config.php).
   ========================================================= */
:root {
  --brand: #111827;                 /* <- the only colour you need to change */
  --brand-dark: #000000;
  --brand-soft: #f1f2f4;
  --brand-line: #dcdfe4;
  --on-brand: #ffffff;              /* text colour on top of --brand */

  --ink: #16181d;
  --muted: #646b76;
  --paper: #f6f7f9;
  --card: #ffffff;
  --line: #e4e7ec;

  --danger: #b42318;
  --danger-soft: #fdeceb;
  --info: #3b4a5e;
  --info-soft: #eef1f5;

  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, .09);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@supports (color: color-mix(in srgb, red, blue)) {
  :root {
    --brand-dark: color-mix(in srgb, var(--brand) 62%, #000);
    --brand-soft: color-mix(in srgb, var(--brand) 8%, #fff);
    --brand-line: color-mix(in srgb, var(--brand) 22%, #fff);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.6 var(--font);
  height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--brand-line); outline-offset: 2px;
}
.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 100; border-radius: 8px; }

/* ---------- Top bar ---------- */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topnav-in { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: var(--on-brand); display: grid; place-items: center;
  box-shadow: 0 4px 10px rgba(16, 24, 40, .18);
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-weight: 800; font-size: 1.08rem; letter-spacing: -.01em; }
.brand-name span { color: var(--muted); font-weight: 700; }
.brand-sub { font-size: 11.5px; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topnav nav a {
  text-decoration: none; font-weight: 600; font-size: 14.5px; color: var(--ink);
  padding: 8px 18px; border-radius: 999px; background: #fff; border: 1px solid var(--line);
  transition: background .15s, color .15s, border-color .15s;
}
.topnav nav a:hover { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

/* ---------- Breadcrumbs ---------- */
.crumbs { background: transparent; font-size: 14px; }
.crumbs .wrap { padding-top: 8px; padding-bottom: 0; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs .sep { margin: 0 8px; color: #b8bec8; }
.crumbs .cur { color: var(--ink); font-weight: 600; }

.topnav, .crumbs, .foot { flex: none; }
.main { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; padding-top: 12px; padding-bottom: 12px; }
.narrow { max-width: 680px; margin-left: auto; margin-right: auto; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; text-align: center;
  margin: 0 0 20px; padding: 32px 24px 30px; border-radius: 18px; color: var(--on-brand);
  background:
    radial-gradient(600px 300px at 85% -10%, rgba(255, 255, 255, .16), transparent 60%),
    linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: var(--shadow-md);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255, 255, 255, .13) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 80%); mask-image: linear-gradient(180deg, #000, transparent 80%);
}
.hero > * { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px;
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .26);
}
.hero-badge i { width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .22); }
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); line-height: 1.12; margin: 0 0 8px; letter-spacing: -.025em; font-weight: 800; }
.hero p { margin: 0 auto; max-width: 520px; color: rgba(255, 255, 255, .85); font-size: 1.05rem; }

/* ---------- Headings / text ---------- */
.page-h { font-size: 1.7rem; line-height: 1.25; margin: 0 0 18px; letter-spacing: -.015em; font-weight: 800; }
.page-h.tight { margin-bottom: 4px; font-size: 1.4rem; }
.sub-h { font-size: 1.1rem; margin: 30px 0 12px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Action cards ---------- */
.links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 760px) {
  .links { grid-template-columns: 1fr; gap: 10px; }
  .link-card { flex-direction: row !important; align-items: center !important; padding: 12px 14px !important; }
  .link-card .ico { width: 40px; height: 40px; border-radius: 12px; }
  .hero { padding: 22px 16px 20px !important; margin-bottom: 14px !important; }
  .hero p { font-size: .95rem; }
}
.link-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  padding: 18px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm);
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.link-card:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: var(--shadow-md); }
.link-card strong { display: block; font-size: 1.06rem; margin-bottom: 2px; }
.link-card small { color: var(--muted); font-size: 14px; line-height: 1.45; display: block; }
.ico {
  flex: none; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); border: 1px solid var(--brand-line);
}
.ico svg { width: 22px; height: 22px; }

/* ---------- Forms ---------- */
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 7px; }
input[type=text], input[type=email], select, textarea {
  width: 100%; padding: 12px 14px; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid #cfd4dc; border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
input[type=text]:focus, input[type=email]:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-line);
}
input[type=file] { font: inherit; font-size: 14px; }
textarea { resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .row2 { grid-template-columns: 1fr; } .panel { padding: 20px; } }

.btn {
  display: inline-block; border: 0; cursor: pointer; font: inherit; font-weight: 700;
  background: var(--brand); color: var(--on-brand);
  padding: 12px 26px; border-radius: 10px; text-decoration: none;
  box-shadow: 0 4px 12px rgba(16, 24, 40, .18); transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { background: var(--brand-dark); transform: translateY(-1px); box-shadow: 0 8px 18px rgba(16, 24, 40, .22); }
.btn:active { transform: translateY(0); }
.btn-block { width: 100%; padding: 14px; font-size: 1rem; }

.alert { padding: 13px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 15px; border: 1px solid transparent; }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: #f6c9c5; }
.alert-success { background: #eaf6ee; color: #1e6b3a; border-color: #c4e4cf; }
.alert-info { background: var(--info-soft); color: var(--info); border-color: #d5dbe4; }

/* honeypot: off-screen */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Ticket view ---------- */
.tk-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.badges { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.badge { font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 999px; background: #eceef2; color: var(--muted); letter-spacing: .01em; }
.st-open { background: #e7eefb; color: #1f4f9a; }
.st-pending { background: #fff3dc; color: #8a5a00; }
.st-resolved { background: #e5f4ea; color: #1e6b3a; }
.st-closed { background: #eceeed; color: #555; }
.pr-high { background: #fff0e0; color: #a14b00; }
.pr-urgent { background: var(--danger-soft); color: var(--danger); }
.body-text { margin: 16px 0 0; overflow-wrap: anywhere; }

.bubble { padding: 13px 17px; border-radius: 16px 16px 16px 4px; margin-bottom: 12px; max-width: 88%; overflow-wrap: anywhere; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow-sm); }
.bubble.you { margin-left: auto; border-radius: 16px 16px 4px 16px; background: var(--brand-soft); border-color: var(--brand-line); }
.bubble .meta { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.bubble .meta strong { color: var(--ink); margin-right: 6px; }
.bubble.staff { border-left: 3px solid var(--brand); }

/* ---------- Ticket page extras ---------- */
.page-head { margin-bottom: 18px; }
.page-head .page-h { margin-bottom: 6px; }
.page-head p { margin: 0; color: var(--muted); }
.steps { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; font-size: 13px; font-weight: 600; color: var(--muted); }
.steps .dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #e6e9ee; color: var(--muted); font-size: 12px; }
.steps .on .dot, .steps .done .dot { background: var(--brand); color: var(--on-brand); }
.steps .on { color: var(--ink); }
.steps .bar { width: 28px; height: 2px; background: var(--line); border-radius: 2px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 6px 5px 14px; border-radius: 999px;
  background: var(--brand-soft); color: var(--ink); border: 1px solid var(--brand-line); font-size: 14px; font-weight: 600; margin-bottom: 16px;
}
.pill a { background: #fff; padding: 3px 12px; border-radius: 999px; font-size: 13px; text-decoration: none; font-weight: 700; color: var(--ink); border: 1px solid var(--line); }
.pill a:hover { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cat-grid .link-card { flex-direction: row; align-items: center; padding: 16px 18px; }
.cat-grid .link-card .go { margin-left: auto; color: var(--muted); }
.cat-grid .link-card .go svg { width: 18px; height: 18px; transition: transform .18s; }
.cat-grid .link-card:hover .go svg { transform: translateX(4px); color: var(--brand); }
.form-note { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--info-soft); color: var(--info); font-size: 13.5px; }
.form-note svg { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.field .hint { display: block; margin-top: 6px; font-size: 12.5px; }

/* ---------- Track page extras ---------- */
.tk-no { display: inline-block; font-weight: 700; font-size: 12.5px; padding: 3px 10px; border-radius: 8px; background: #eceef2; letter-spacing: .04em; margin-bottom: 8px; }
.tk-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0 0; font-size: 13.5px; color: var(--muted); }
.tk-meta b { color: var(--ink); font-weight: 600; }
.tk-desc { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.attach-chip { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 8px; background: #eceef2; font-size: 13px; margin: 0 6px 6px 0; }
.msg-row { display: flex; gap: 10px; margin-bottom: 14px; align-items: flex-end; }
.msg-row.you { flex-direction: row-reverse; }
.msg-row .bubble { margin: 0; max-width: calc(100% - 48px); }
.avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--brand); color: var(--on-brand); }
.msg-row.you .avatar { background: #dde1e7; color: var(--ink); }
.empty { text-align: center; padding: 22px; border: 1px dashed #c9ced6; border-radius: var(--radius); color: var(--muted); margin-bottom: 18px; background: var(--card); }
.lookup-ico { width: 56px; height: 56px; border-radius: 16px; margin-bottom: 14px; }
.lookup-ico svg { width: 26px; height: 26px; }
.reply-box { position: static; }

/* ---------- One-screen layout (no page scroll) ---------- */
.fit { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; }
.fit.center { justify-content: center; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
.fit .panel { margin-bottom: 10px; padding: 16px 18px; }
.fit .field { margin-bottom: 10px; }
.fit .field label { margin-bottom: 4px; }
.fit input[type=text], .fit input[type=email], .fit select, .fit textarea { padding: 9px 12px; }
.fit .page-h { margin-bottom: 4px; font-size: 1.45rem; }
.fit .page-head { margin-bottom: 10px; }
.fit .steps { margin-bottom: 8px; }
.fit .pill { margin-bottom: 0; }
.fit .alert { margin-bottom: 10px; padding: 8px 12px; font-size: 14px; }
.fit .sub-h { margin: 4px 0 8px; font-size: 1rem; }
.fit .empty { padding: 14px; margin-bottom: 8px; }
.fit .tk-desc { max-height: 84px; overflow-y: auto; margin-top: 10px; padding-top: 10px; }
.fit .form-note { margin-top: 10px; padding: 8px 12px; font-size: 12.5px; }
.fit .lookup-ico { margin-bottom: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.panel.grow { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.panel.grow form { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.field.grow { flex: 1; min-height: 60px; display: flex; flex-direction: column; }
.field.grow textarea { flex: 1; min-height: 40px; resize: none; }
.form-foot { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.form-foot .field { flex: 1; min-width: 200px; margin: 0; }
.form-foot .btn { padding: 11px 30px; }
.reply-row { display: flex; gap: 12px; align-items: flex-end; }
.reply-row textarea { flex: 1; resize: none; }
.reply-row .btn { flex: none; }

/* ---------- Footer ---------- */
.foot { background: #14171c; color: #a3aab5; padding: 10px 0; font-size: 13px; text-align: center; }
.foot p { margin: 0; }
.foot-powered { margin-top: 2px !important; font-size: 13px; }
.foot-powered a { color: #fff; font-weight: 700; text-decoration: none; }
.foot-powered a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* =========================================================
   public-mobile.css — mobile & tablet layer
   public.css ke BAAD load karo. Desktop par koi change nahi.
   ========================================================= */

/* ---------- Sab screens: safe areas + overflow guards ---------- */
body { overflow-x: clip; }
img, svg, video { max-width: 100%; }
.panel, .link-card, .bubble, .tk-meta, .field { min-width: 0; }
.wrap {
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.topnav { padding-top: env(safe-area-inset-top, 0px); }
.foot { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
a, button { -webkit-tap-highlight-color: transparent; }
.btn, .topnav nav a, .pill a, .link-card { touch-action: manipulation; }

/* Touch devices: hover-lift hata do (tap par atka hua dikhta hai), tap feedback do */
@media (hover: none) {
  .link-card:hover, .btn:hover, .btn:active { transform: none; }
  .link-card:hover { border-color: var(--line); box-shadow: var(--shadow-sm); }
  .link-card:active { transform: scale(.985); border-color: var(--brand); }
  .btn:active { transform: scale(.98); }
  .topnav nav a:hover { background: #fff; border-color: var(--line); color: var(--ink); }
}

/* ---------- Tablet (<= 900px) ---------- */
@media (max-width: 900px) {
  .wrap { max-width: 100%; }
  .links { gap: 12px; }
  .link-card { padding: 16px; }
  .panel { padding: 22px; }
}

/* ---------- Page scroll unlock: phones + landscape phones ----------
   One-screen lock sirf desktop ke liye; mobile par normal page scroll. */
@media (max-width: 768px), (max-height: 520px) {
  body { height: auto; min-height: 100vh; min-height: 100dvh; overflow: visible; overflow-x: clip; }
  .main { flex: 1 0 auto; min-height: auto; overflow: visible; padding-top: 14px; padding-bottom: 22px; }
  .fit, .fit.center { flex: none; min-height: 0; justify-content: flex-start; }
  .scroll { flex: none; overflow: visible; padding-right: 0; }
  .panel.grow, .panel.grow form { flex: none; }
  .field.grow { flex: none; min-height: 0; }
  .field.grow textarea { flex: none; min-height: 150px; resize: vertical; }
  .fit .tk-desc { max-height: none; overflow: visible; }
}

/* ---------- Phones (<= 600px) ---------- */
@media (max-width: 600px) {
  .wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

  /* Header */
  .topnav-in { height: 54px; gap: 10px; }
  .brand { gap: 10px; min-width: 0; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .brand-mark svg { width: 19px; height: 19px; }
  .brand-name { font-size: 1rem; white-space: nowrap; }
  .brand-sub { display: none; }
  .topnav nav a { padding: 9px 14px; font-size: 13.5px; min-height: 40px; display: inline-flex; align-items: center; white-space: nowrap; }

  /* Breadcrumbs: ek line, side-scroll */
  .crumbs { font-size: 13px; }
  .crumbs .wrap { white-space: nowrap; overflow-x: auto; scrollbar-width: none; padding-top: 8px; }
  .crumbs .wrap::-webkit-scrollbar { display: none; }
  .crumbs .sep { margin: 0 6px; }

  /* Hero + headings */
  .hero { border-radius: 14px; padding: 20px 14px 18px !important; }
  .hero h1 { font-size: 1.5rem; }
  .hero p { font-size: .95rem; }
  .hero-badge { font-size: 12px; padding: 5px 12px; }
  .page-h, .fit .page-h { font-size: 1.35rem; }
  .page-h.tight { font-size: 1.2rem; }

  /* Cards + panels */
  .panel, .fit .panel { padding: 16px; border-radius: 14px; margin-bottom: 14px; }
  .link-card strong { font-size: 1rem; }
  .cat-grid { grid-template-columns: 1fr; gap: 10px; }
  .cat-grid .link-card { padding: 14px; }

  /* Forms: 16px text (iOS zoom nahi karega) + bade tap targets */
  input[type=text], input[type=email], select, textarea,
  .fit input[type=text], .fit input[type=email], .fit select, .fit textarea {
    font-size: 16px; padding: 12px 14px; min-height: 46px; border-radius: 10px;
  }
  textarea, .fit textarea { min-height: 120px; }
  input[type=file] { width: 100%; font-size: 14px; padding: 8px 0; }
  .field, .fit .field { margin-bottom: 14px; }
  .field label, .fit .field label { margin-bottom: 6px; }
  .btn { min-height: 46px; padding: 12px 22px; }
  .form-foot { flex-direction: column; align-items: stretch; gap: 12px; }
  .form-foot .field { min-width: 0; }
  .form-foot .btn { width: 100%; }
  .reply-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .reply-row textarea { min-height: 100px; }
  .reply-row .btn { width: 100%; }

  /* Steps / pills */
  .steps { flex-wrap: wrap; gap: 6px; font-size: 12.5px; }
  .steps .bar { width: 14px; }
  .pill { flex-wrap: wrap; max-width: 100%; border-radius: 14px; padding: 6px 8px 6px 12px; }

  /* Ticket view */
  .tk-head { flex-direction: column; gap: 10px; }
  .badges { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .tk-meta { gap: 4px 14px; font-size: 13px; }
  .bubble { max-width: 94%; padding: 11px 14px; }
  .msg-row { gap: 8px; }
  .msg-row .bubble { max-width: calc(100% - 42px); }
  .avatar { width: 30px; height: 30px; font-size: 12px; }
  .empty { padding: 16px; }
  .alert, .fit .alert { font-size: 14px; }

  /* Footer */
  .foot { font-size: 12.5px; padding-top: 12px; }
}

/* ---------- Small phones (<= 380px) ---------- */
@media (max-width: 380px) {
  .brand-name { font-size: .95rem; }
  .brand-mark { width: 32px; height: 32px; }
  .topnav nav a { padding: 8px 12px; font-size: 13px; }
  .hero h1 { font-size: 1.35rem; }
  .panel, .fit .panel { padding: 14px; }
}

/* ---------- Landscape phones (kam height) ---------- */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { padding: 14px 16px !important; margin-bottom: 12px !important; }
  .hero h1 { font-size: 1.3rem; }
  .topnav-in { height: 48px; }
}