/* Public unsubscribe page - glass design. Fonts are self-hosted (CSP: 'self'). */
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 600; font-display: swap; src: url('/fonts/plus-jakarta-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 700; font-display: swap; src: url('/fonts/plus-jakarta-sans-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 800; font-display: swap; src: url('/fonts/plus-jakarta-sans-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Noto Nastaliq Urdu'; font-weight: 400; font-display: swap; src: url('/fonts/noto-nastaliq-urdu-arabic-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Noto Nastaliq Urdu'; font-weight: 600; font-display: swap; src: url('/fonts/noto-nastaliq-urdu-arabic-600-normal.woff2') format('woff2'); }

:root {
  --navy: #100075;
  --blue: #1b3fd6;
  --blue-dark: #12178f;
  --text: #1a1f36;
  --muted: #3f4558;
  --danger: #d0342c;
  --danger-dark: #a8231c;
  --success: #1a8a3c;
}

* { box-sizing: border-box; }
.hidden { display: none !important; }

html, body { margin: 0; }
body {
  min-height: 100vh;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(700px 380px at 12% 6%, rgba(79, 195, 247, 0.40), rgba(79, 195, 247, 0) 70%),
    radial-gradient(800px 420px at 90% 34%, rgba(47, 85, 240, 0.22), rgba(47, 85, 240, 0) 70%),
    #eef1fb;
  background-attachment: fixed;
}
button { font-family: inherit; }

.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 0 40px 36px;
}

/* ---------- Header ---------- */
.top {
  width: 100%;
  max-width: 1360px;
  padding: 22px 8px 22px;
}
.logo {
  display: inline-block;
  line-height: 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 28px -10px rgba(18, 23, 143, 0.55);
}
.logo img { display: block; width: 138px; height: auto; }

/* ---------- Banner ---------- */
.banner {
  width: 100%;
  max-width: 1360px;
  height: 270px;
  flex: none;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 28px 56px -24px rgba(18, 23, 143, 0.5);
  background: #100075 url('/img/services-banner.png') center / cover no-repeat;
}

/* ---------- Glass card ---------- */
.card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 560px;
  margin-top: -44px;
  padding: 40px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 24px;
  box-shadow: 0 30px 70px -28px rgba(18, 23, 143, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  backdrop-filter: blur(26px) saturate(170%);
  display: flex;
  flex-direction: column;
  gap: 22px;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card { background: rgba(255, 255, 255, 0.88); }
}

.eyebrow {
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(227, 246, 253, 0.9);
  color: #0a6a8c;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.intro { display: flex; flex-direction: column; gap: 12px; }
h1 { margin: 0; font-size: 32px; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; color: var(--navy); }
.sub { margin: 0; font-size: 15.5px; line-height: 1.55; color: var(--muted); }
.urdu {
  direction: rtl;
  text-align: right;
  font-family: 'Noto Nastaliq Urdu', serif;
  font-size: 14px;
  line-height: 2.1;
  color: var(--muted);
  margin: 0;
}

/* ---------- Form ---------- */
form { display: flex; flex-direction: column; gap: 18px; margin: 0; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 13px; font-weight: 700; color: var(--text); }
.input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 58px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1.5px solid rgba(16, 0, 117, 0.18);
  border-radius: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input-wrap:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(27, 63, 214, 0.14); }
.input-wrap svg { flex: none; }
.input-wrap input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
}
.input-wrap input::placeholder { color: #7a8094; }

.turnstile-box { display: flex; justify-content: center; min-height: 65px; }

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 58px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 16px 28px -10px rgba(27, 63, 214, 0.6);
}
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid rgba(16, 0, 117, 0.12);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}

.pub-msg { font-size: 14px; }
.pub-msg:empty { display: none; }

/* ---------- Results ---------- */
.service-list { display: flex; flex-direction: column; gap: 14px; padding-top: 22px; border-top: 1px solid rgba(16, 0, 117, 0.12); }
.service-list-label { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; letter-spacing: -0.01em; color: var(--navy); }
.service-list-label .count {
  min-width: 26px; height: 26px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--navy); color: #fff; font-size: 13px; font-weight: 700;
}
#serviceRows { display: flex; flex-direction: column; gap: 10px; }
.service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(16, 0, 117, 0.10);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
}
.service-name { font-size: 15.5px; font-weight: 700; color: var(--text); }
.service-op { margin-top: 3px; font-size: 12.5px; font-weight: 600; color: var(--muted); }

.row-unsub-btn {
  flex: none;
  height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1.5px solid var(--danger);
  background: #fdf0ef;
  color: var(--danger-dark);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.row-unsub-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.row-unsub-btn.done { background: transparent; border-color: transparent; color: #17713a; opacity: 1; padding: 0; }

.unsub-all-btn {
  width: 100%;
  height: 56px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #b8281f 0%, var(--danger) 100%);
  color: #fff;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 16px 28px -12px rgba(184, 40, 31, 0.6);
}
.unsub-all-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.foot { margin: 22px 0 0; text-align: center; font-size: 12.5px; font-weight: 500; color: #5b6172; }

/* ---------- Popup ---------- */
.popup-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(16, 0, 117, 0.40);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 1000;
}
.popup-overlay.show { display: flex; }
.popup-box {
  width: 100%;
  max-width: 380px;
  padding: 32px 28px;
  text-align: center;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 30px 70px -20px rgba(16, 0, 117, 0.45);
  animation: popIn 0.2s ease-out;
}
@keyframes popIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.popup-icon {
  width: 56px; height: 56px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 28px; color: #fff;
}
.popup-icon.success { background: var(--success); }
.popup-icon.error { background: var(--danger); }
.popup-box h2 { margin: 0 0 8px; font-size: 18px; color: var(--navy); }
.popup-box p { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.popup-box p.urdu { text-align: center; direction: rtl; }
.popup-box button {
  margin-top: 18px;
  height: 44px;
  padding: 0 28px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .page { padding: 0 16px 28px; }
  .top { padding: 16px 4px; }
  .logo { border-radius: 14px; }
  .logo img { width: 112px; }
  .banner { height: 130px; border-radius: 20px; box-shadow: 0 20px 40px -20px rgba(18, 23, 143, 0.5); background-size: auto 100%; background-position: 60% center; }
  .card { margin-top: -18px; padding: 26px 22px; border-radius: 22px; gap: 20px; }
  h1 { font-size: 26px; }
  .sub { font-size: 14.5px; }
  .urdu { font-size: 13px; }
  .input-wrap { height: 54px; }
  .input-wrap input { font-size: 16px; }
  .btn-primary { height: 56px; font-size: 15.5px; }
  .service-row { padding: 12px 14px; }
}

/* ---------- Short desktop windows: fit the form without scrolling ---------- */
@media (min-width: 641px) and (max-height: 940px) {
  .page { padding-bottom: 14px; }
  .top { padding: 12px 8px 12px; }
  .logo { border-radius: 12px; }
  .logo img { width: 104px; }
  .banner { height: 215px; border-radius: 22px; }
  .card { margin-top: -14px; padding: 26px 38px 22px; gap: 14px; border-radius: 22px; }
  .intro { gap: 8px; }
  .eyebrow { padding: 4px 10px; font-size: 10px; }
  h1 { font-size: 26px; }
  .sub { font-size: 14px; line-height: 1.45; }
  .urdu { font-size: 13px; line-height: 1.9; }
  form { gap: 12px; }
  .field { gap: 6px; }
  .input-wrap { height: 50px; }
  .input-wrap input { font-size: 16px; }
  .turnstile-box { min-height: 65px; }
  .btn-primary { height: 50px; font-size: 15px; }
  .secure { padding-top: 12px; }
  .foot { margin-top: 10px; }
}
@media (min-width: 641px) and (max-height: 780px) {
  .banner { height: 140px; }
  .card { margin-top: -10px; padding: 18px 32px 16px; gap: 10px; }
  .eyebrow { display: none; }
  h1 { font-size: 23px; }
  .intro { gap: 4px; }
  .input-wrap, .btn-primary { height: 46px; }
  .secure { display: none; }
}
