/* =====================================================================
   حاسبة الزكاة (/zakat) — Al-Maher's calculator layout (notes → today's gold
   prices → type tabs → one card → dark total card with the pay form),
   in Al-Hikma's identity. Tokens come from hikma.css; everything is scoped
   under .zc-head / .zc.
   ===================================================================== */

/* page head: the admin banner keeps its natural shape */
.zc-head .hk-pagehead__media { aspect-ratio: auto; }
.zc-head .hk-pagehead__media img { height: auto; }

.zc { padding: 32px 0 64px; }
.zc .zc__wrap { max-width: 1040px; }
.zc [hidden] { display: none !important; }
.zc p { margin: 0; }

@keyframes zc-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes zc-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(1.35); } }
@keyframes zc-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* flash (reminder saved) */
.zc-alert { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 14px 18px; border-radius: 14px; background: var(--hk-green-tint); color: var(--hk-green); font-weight: 600; }

/* ---------- source notes ---------- */
.zc-notes { display: grid; gap: 4px; margin-bottom: 16px; padding: 14px 18px; background: #fff; border: 1px solid var(--hk-line-w); border-radius: 16px; }
.zc-note { display: flex; align-items: flex-start; gap: 10px; font-size: .9rem; line-height: 1.85; color: var(--hk-muted); }
.zc-note > i { flex: 0 0 16px; margin-top: .5em; font-size: .85rem; text-align: center; color: var(--hk-gold-2); }
.zc-note #silverPriceNote, .zc-note #price-update-info { font-variant-numeric: tabular-nums; }

/* ---------- loading / error ---------- */
.zc-loading { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 16px; padding: 14px; border-radius: 14px; background: var(--hk-green-tint); color: var(--hk-green); font-size: .92rem; font-weight: 600; text-align: center; }
.zc-error { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 16px; padding: 14px 18px; border-radius: 14px; background: var(--hk-gold-tint); border: 1.5px solid var(--hk-gold); color: #6e5014; font-size: .92rem; font-weight: 600; line-height: 1.8; }
.zc-error p { flex: 1 1 260px; }
.zc-error p i { margin-inline-end: 8px; color: var(--hk-gold-2); }
.zc .zc-retry, .zc .zc-refresh { min-height: 44px; gap: 8px; }

/* ---------- today's gold prices ---------- */
.zc-gold { margin-bottom: 20px; padding: 22px; background: #fff; border: 1px solid var(--hk-line-w); border-radius: var(--hk-radius); box-shadow: var(--hk-shadow-sm); animation: zc-up .35s ease; }
.zc-gold__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.zc .zc-gold__title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.05rem; font-weight: 700; line-height: 1.5; color: var(--hk-green); }
.zc-live { flex: 0 0 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--hk-gold); animation: zc-pulse 2s infinite; }
.zc-gold__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.zc-karat { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; text-align: center; background: var(--hk-ivory); border: 1px solid var(--hk-line); border-radius: 16px; transition: border-color .2s, transform .2s; }
.zc-karat:hover { border-color: var(--hk-gold); transform: translateY(-2px); }
.zc-karat__k { font-size: .88rem; font-weight: 700; color: var(--hk-muted); }
.zc-karat__p { font-size: 1.4rem; font-weight: 800; line-height: 1.2; color: var(--hk-green); }
.zc-karat__c { font-size: .875rem; color: var(--hk-muted); }
.zc .zc-gold__src { margin-top: 12px; font-size: .875rem; color: var(--hk-muted); text-align: end; }
.zc-gold__src i { color: var(--hk-gold-2); }

/* ---------- type tabs (big icon + label) ---------- */
.zc-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 20px; }
.zc-tab {
  min-width: 100px; min-height: 92px; padding: 14px 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: #fff; border: 1.5px solid var(--hk-line-w); border-radius: var(--hk-radius); box-shadow: var(--hk-shadow-sm);
  color: var(--hk-ink); cursor: pointer; transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
}
.zc-tab:hover { border-color: var(--hk-green-2); background: var(--hk-green-tint); color: var(--hk-green); }
.zc-tab[aria-selected="true"] { background: var(--hk-green); border-color: var(--hk-green); color: #fff; box-shadow: 0 6px 18px rgba(2, 61, 57, .28); }
.zc-tab__icon { font-size: 1.7rem; line-height: 1; color: var(--hk-green); }
.zc-tab[aria-selected="true"] .zc-tab__icon { color: var(--hk-gold); }
.zc-tab__label { font-size: .95rem; font-weight: 800; line-height: 1.2; }

/* ---------- the card ---------- */
.zc-card { margin-bottom: 18px; padding: 26px; background: #fff; border: 1px solid var(--hk-line-w); border-radius: var(--hk-radius); box-shadow: var(--hk-shadow-sm); animation: zc-up .3s ease; }
.zc-empty { padding: 40px 20px; text-align: center; color: var(--hk-muted); font-size: 1rem; line-height: 1.8; }
.zc-empty > i { display: block; margin-bottom: 12px; font-size: 2.2rem; color: var(--hk-gold); animation: zc-bounce 2s infinite; }

/* fields */
.zc-label { display: block; margin: 0 0 8px; font-size: .95rem; font-weight: 700; color: var(--hk-ink); }
.zc-input { display: flex; align-items: stretch; min-height: 54px; background: #fff; border: 1.5px solid var(--hk-line-w); border-radius: 14px; overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.zc-input:focus-within { border-color: var(--hk-green); box-shadow: 0 0 0 3px rgba(208, 158, 62, .3); }
.zc-input input, .zc-input select { flex: 1 1 auto; min-width: 0; width: 100%; padding: 0 14px; border: 0; outline: 0; background: transparent; color: var(--hk-ink); font-size: 1.1rem; font-weight: 700; text-align: center; }
.zc-input input::placeholder { color: #9aa6a3; font-weight: 500; }
.zc .zc-input input:focus-visible, .zc .zc-input select:focus-visible { outline: none !important; }
.zc-input select { text-align: start; font-size: 1rem; font-weight: 600; cursor: pointer; }
.zc-input__unit { display: flex; align-items: center; flex: 0 0 auto; padding: 0 14px; background: var(--hk-ivory); border-inline-end: 1.5px solid var(--hk-line-w); color: var(--hk-green); font-size: .9rem; font-weight: 700; white-space: nowrap; }
.zc .zc-err { min-height: 1.5em; margin-top: 6px; font-size: .875rem; font-weight: 600; color: #b42318; }
.zc .zc-help { margin-top: 6px; font-size: .875rem; line-height: 1.7; color: var(--hk-muted); }
.zc-row { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 0 16px; }
.zc-manual { margin: 4px 0 8px; padding: 14px; border-radius: 14px; background: var(--hk-gold-tint); }

/* result (per type) */
.zc-result {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 12px;
  margin: 12px 0 14px; padding: 14px 18px; border-radius: 16px; background: var(--hk-gold-tint); border: 1.5px solid var(--hk-gold);
  animation: zc-up .25s ease;
}
.zc-result__label { grid-column: 1; font-size: .9rem; font-weight: 700; color: #6e5014; }
.zc-result__unit { grid-column: 1; font-size: .9rem; font-weight: 700; color: var(--hk-green-2); }
.zc-result__val { grid-column: 2; grid-row: 1 / span 2; font-size: 1.9rem; font-weight: 800; line-height: 1.1; color: var(--hk-green); }
.zc .zc-calc { min-height: 52px; margin-top: 4px; font-size: 1.02rem; }

/* stocks */
.zc-stocks__head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; padding: 16px 20px; border-radius: 16px; background: linear-gradient(135deg, var(--hk-green) 0%, var(--hk-green-2) 100%); }
.zc-stocks__icon { flex: 0 0 46px; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: rgba(255, 255, 255, .14); color: var(--hk-gold); font-size: 1.25rem; }
.zc .zc-stocks__title { margin: 0 0 2px; font-size: 1.05rem; font-weight: 800; line-height: 1.4; color: #fff; }
.zc-stocks__sub { font-size: .875rem; color: rgba(255, 255, 255, .78); }
.zc-step { margin-bottom: 16px; animation: zc-up .25s ease; }
.zc-step__row { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; cursor: pointer; }
.zc-step__n { flex: 0 0 28px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--hk-green); color: #fff; font-size: .85rem; font-weight: 800; }
.zc-step__t { font-size: .95rem; font-weight: 700; color: var(--hk-green); }
.zc .zc-status { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 12px; padding: 14px 18px; border-radius: 14px; font-size: .95rem; font-weight: 600; line-height: 1.8; animation: zc-up .25s ease; }
.zc-status > i { margin-top: .45em; }
.zc-status--none { background: var(--hk-green-tint); color: var(--hk-green); border: 1.5px solid #c9dbd8; }
.zc-status--paid { background: var(--hk-gold-tint); color: #6e5014; border: 1.5px solid var(--hk-gold); }
#stock_shares_group { animation: zc-up .25s ease; }

/* ---------- total + pay (dark card) ---------- */
.zc-total {
  position: relative; overflow: hidden; margin-bottom: 24px; padding: 36px 28px 28px; text-align: center; color: #fff;
  border-radius: 28px; background: linear-gradient(135deg, #012b28 0%, var(--hk-green) 55%, var(--hk-green-2) 100%);
  box-shadow: 0 16px 48px rgba(2, 61, 57, .22);
}
.zc-total::before { content: ""; position: absolute; top: -60px; inset-inline-end: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255, 255, 255, .05); pointer-events: none; }
.zc-total > * { position: relative; z-index: 1; }
.zc .zc-total__label { margin: 0 0 8px; font-size: 1rem; font-weight: 700; color: rgba(255, 255, 255, .78); }
.zc .zc-total__amount { margin-bottom: 4px; font-size: clamp(2.6rem, 6vw, 3.5rem); font-weight: 800; line-height: 1.1; color: #fff; }
.zc-total__amount b { font-weight: 800; }
.zc .zc-total__cur { margin-bottom: 22px; font-size: 1rem; font-weight: 700; color: var(--hk-gold); }
.zc-total__rule { margin: 0 0 22px; border: 0; border-top: 1px solid rgba(255, 255, 255, .16); opacity: 1; }
.zc-total__zero { font-size: .95rem; font-weight: 600; line-height: 1.8; color: rgba(255, 255, 255, .72); }
.zc-total__zero a { color: var(--hk-gold); }

.zc-pay { display: grid; gap: 14px; max-width: 640px; margin: 0 auto; text-align: start; animation: zc-up .3s ease; }
.zc-pay__field { display: grid; gap: 6px; margin: 0; }
.zc-pay__field > span { font-size: .92rem; font-weight: 600; color: rgba(255, 255, 255, .88); }
.zc-pay__field small { font-size: .875rem; font-weight: 400; color: rgba(255, 255, 255, .65); }
.zc-pay__field input {
  min-height: 52px; width: 100%; padding: 0 14px; border-radius: 14px; border: 1.5px solid rgba(255, 255, 255, .24);
  background: rgba(255, 255, 255, .1); color: #fff; font-size: 1rem; transition: border-color .2s, background .2s, box-shadow .2s;
}
.zc-pay__field input::placeholder { color: rgba(255, 255, 255, .5); }
.zc .zc-pay__field input:focus { outline: none; border-color: var(--hk-gold); background: rgba(255, 255, 255, .14); box-shadow: 0 0 0 3px rgba(208, 158, 62, .35); }
.zc-paym { min-width: 0; margin: 0; padding: 0; border: 0; --pay-h: 22px; }
.zc-paym legend { float: none; width: auto; margin: 0 0 8px; padding: 0; font-size: .92rem; font-weight: 600; color: rgba(255, 255, 255, .88); }
.zc-paym__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.zc-paym label { margin: 0; cursor: pointer; }
.zc-paym input { position: absolute; opacity: 0; pointer-events: none; }
.zc-paym label > span {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 6px 10px;
  border-radius: 14px; border: 2px solid transparent; background: #fff; color: var(--hk-ink); font-size: .9rem; font-weight: 700; text-align: center;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.zc-paym label:hover > span { border-color: rgba(208, 158, 62, .6); }
.zc-paym input:checked + span { border-color: var(--hk-gold); background: var(--hk-gold-tint); box-shadow: 0 0 0 3px rgba(208, 158, 62, .45); }
.zc-paym input:focus-visible + span { outline: 2px solid #fff; outline-offset: 3px; }
.zc .zc-donate { min-height: 56px; margin-top: 4px; font-size: 1.1rem; font-weight: 800; }
.zc .zc-donate i { font-size: .95em; }

/* ---------- reminder ---------- */
.zc-remind .hk-panel__title { margin-bottom: 14px; }
.zc-remind__form { display: flex; align-items: flex-end; gap: 12px; }
.zc-remind__form .hk-field { flex: 1 1 auto; }
.zc-remind__form .hk-btn { flex: 0 0 auto; min-width: 120px; min-height: 50px; }

/* ---------- phones ---------- */
@media (max-width: 767.98px) {
  .zc { padding: 20px 0 44px; }
  .zc-notes { padding: 12px 14px; }
  .zc-gold { padding: 18px 14px; }
  .zc-gold__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .zc-karat__p { font-size: 1.3rem; }
  /* four tabs on one row */
  .zc-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .zc-tab { min-width: 0; min-height: 80px; padding: 12px 4px; gap: 6px; border-radius: 16px; }
  .zc-tab__icon { font-size: 1.45rem; }
  .zc-tab__label { font-size: .875rem; }
  .zc-card { padding: 18px 16px; }
  .zc-row { grid-template-columns: 1fr; }
  .zc-result__val { font-size: 1.7rem; }
  .zc-stocks__head { padding: 14px; }
  .zc-total { padding: 28px 16px 22px; border-radius: 24px; }
  .zc-paym__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .zc-remind__form { flex-direction: column; align-items: stretch; }
}
@media (max-width: 359.98px) {
  .zc-tabs { gap: 6px; }
  .zc-paym label > span { flex-direction: column; gap: 2px; font-size: .875rem; }
}
