/* ================================================================
   MIRAS — ROYAL ISLAMIC PROFESSIONAL DESIGN
   miras.naatenabi.com | Maulana Sulaiman Barkati
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Inter:wght@300;400;500;600;700;800&family=Noto+Nastaliq+Urdu:wght@400;500;600;700&display=swap');

/* ══════════════════════════════════════════
   CSS VARIABLES — ROYAL ISLAMIC PALETTE
══════════════════════════════════════════ */
:root {
  /* Core */
  --bg-body:      #07040A;
  --bg-card:      rgba(14, 9, 18, 0.94);
  --bg-input:     rgba(8, 4, 12, 0.97);
  --bg-table-head: rgba(201, 162, 39, 0.11);
  --bg-table-alt: rgba(201, 162, 39, 0.03);
  --bg-hover:     rgba(201, 162, 39, 0.07);

  /* Orbs — very warm, subtle */
  --orb1: rgba(201, 162, 39, 0.07);
  --orb2: rgba(120, 30,  30, 0.06);
  --orb3: rgba(80,  45,  5,  0.08);

  /* Typography */
  --text-main:  #F0E6C8;
  --text-muted: #BFA06A;
  --text-dim:   #5A3E1A;

  /* Gold Palette */
  --gold:        #C9A227;
  --gold-bright: #EAC84A;
  --gold-dim:    #8B6914;
  --gold-pale:   rgba(201, 162, 39, 0.12);

  /* Crimson (Islamic accent) */
  --crimson:     #8B1A1A;
  --crimson-soft:#A83232;

  /* Utility */
  --accent:   #C9A227;
  --success:  #4A9E6E;
  --warning:  #D09030;
  --danger:   #A83232;
  --purple:   #8B6BA8;
  --teal:     #1A5C4A;

  /* Borders */
  --border:        rgba(201, 162, 39, 0.18);
  --border-strong: rgba(201, 162, 39, 0.50);
  --border-input:  rgba(140, 108, 24, 0.30);
  --border-focus:  rgba(201, 162, 39, 0.75);

  /* Effects */
  --shadow-card: 0 28px 80px rgba(0,0,0,0.85), 0 6px 24px rgba(0,0,0,0.65), inset 0 1px 0 rgba(201,162,39,0.12);
  --shadow-btn:  0 4px 24px rgba(201,162,39,0.36);
  --glass:       blur(22px) saturate(150%);

  /* Radius */
  --radius-xl: 14px; --radius-lg: 11px;
  --radius-md: 8px;  --radius-sm: 6px; --radius-xs: 4px;
  --trans: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── LIGHT THEME ── */
[data-theme="light"] {
  --bg-body:  #FBF6EC;
  --bg-card:  rgba(255, 252, 244, 0.96);
  --bg-input: rgba(248, 242, 228, 0.98);
  --bg-table-head: rgba(201,162,39,0.10);
  --bg-table-alt:  rgba(201,162,39,0.03);
  --bg-hover: rgba(201,162,39,0.07);
  --orb1: rgba(201,162,39,0.12); --orb2: rgba(139,26,26,0.06); --orb3: rgba(120,80,10,0.08);
  --text-main: #1A0E02; --text-muted: #6B4A14; --text-dim: #B0966A;
  --border: rgba(201,162,39,0.25); --border-input: rgba(139,105,20,0.22);
  --shadow-card: 0 8px 36px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.95);
  --shadow-btn:  0 4px 18px rgba(201,162,39,0.28);
}

/* ── SEPIA THEME ── */
[data-theme="sepia"] {
  --bg-body:  #100802;
  --bg-card:  rgba(24, 14, 4, 0.94);
  --bg-input: rgba(14, 8, 1, 0.97);
  --bg-table-head: rgba(201,162,39,0.10); --bg-table-alt: rgba(201,162,39,0.03);
  --bg-hover: rgba(201,162,39,0.06);
  --orb1: rgba(201,162,39,0.09); --orb2: rgba(120,50,10,0.08); --orb3: rgba(100,40,5,0.07);
  --text-main: #F5E8C4; --text-muted: #C4985A; --text-dim: #6A4820;
  --border: rgba(201,162,39,0.22); --border-input: rgba(140,100,30,0.34);
  --shadow-card: 0 24px 70px rgba(0,0,0,0.80), inset 0 1px 0 rgba(201,162,39,0.12);
}

/* ══════════════════════════════════════════
   RESET & BASE
══════════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Nastaliq Urdu', serif;
  background: var(--bg-body);
  color: var(--text-main);
  line-height: 2.1;
  min-height: 100vh;
  display: flex; flex-direction: column;
  direction: rtl;
  overflow-x: hidden;
  position: relative;
}

/* ── GEOMETRIC BACKGROUND PATTERN ── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23C9A227' stroke-width='0.4' opacity='0.18'%3E%3Cpolygon points='50,10 61,35 88,35 67,57 76,82 50,65 24,82 33,57 12,35 39,35'/%3E%3Ccircle cx='50' cy='50' r='22'/%3E%3Crect x='28' y='28' width='44' height='44' transform='rotate(45 50 50)'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(ellipse 70% 55% at 15% 85%, var(--orb1) 0%, transparent 65%),
    radial-gradient(ellipse 60% 45% at 85% 15%, var(--orb2) 0%, transparent 65%),
    radial-gradient(ellipse 80% 60% at 50% 50%, var(--orb3) 0%, transparent 70%);
  background-size: 100px 100px, auto, auto, auto;
  animation: bgPulse 12s ease-in-out infinite alternate;
}
@keyframes bgPulse {
  0%   { opacity: 0.50; }
  100% { opacity: 0.80; }
}

/* ── TYPOGRAPHY ── */
.latin { font-family: 'Inter', sans-serif; direction: ltr; }
.ltr   { direction: ltr; display: inline-block; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ══════════════════════════════════════════
   HEADER
══════════════════════════════════════════ */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(7, 4, 10, 0.96);
  backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 30px rgba(0,0,0,0.60), 0 0 0 1px rgba(201,162,39,0.06);
}

/* Decorative gold line at very top */
.header::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--gold-dim) 20%, var(--gold) 50%, var(--gold-dim) 80%, transparent 100%);
}

.header-inner {
  max-width: 1300px; margin: 0 auto; padding: 12px 28px;
  display: flex; align-items: center; justify-content: space-between; flex-direction: row-reverse;
}

.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; direction: ltr; font-family: 'Inter', sans-serif;
}
.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 2px 12px rgba(201,162,39,0.40), inset 0 1px 0 rgba(255,255,255,0.15);
}
.logo-text {
  font-size: 16px; font-weight: 700;
  color: var(--text-main); letter-spacing: -0.2px;
  font-family: 'Cinzel', serif;
}
.logo-text span { color: var(--gold); }

.header-actions { display: flex; align-items: center; gap: 8px; }
.theme-btns {
  display: flex; gap: 3px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border-input);
  border-radius: 6px; padding: 3px;
}
.theme-btn {
  width: 30px; height: 30px; border: none; border-radius: 4px;
  background: transparent; cursor: pointer; font-size: 14px;
  transition: var(--trans); display: flex; align-items: center; justify-content: center;
}
.theme-btn.active { background: var(--gold); }
.theme-btn:hover:not(.active) { background: rgba(201,162,39,0.15); }

/* ══════════════════════════════════════════
   MAIN LAYOUT
══════════════════════════════════════════ */
.main {
  max-width: 1300px; margin: 0 auto; padding: 36px 28px;
  flex: 1; width: 100%; position: relative; z-index: 1;
}

/* ── HERO ── */
.hero {
  text-align: center; margin-bottom: 38px;
  animation: fadeInDown 0.7s ease both;
  position: relative;
}

/* Islamic ornamental divider */
.hero::after {
  content: '❧ ✦ ❧';
  display: block;
  color: var(--gold-dim); font-size: 16px;
  margin-top: 18px; letter-spacing: 10px; opacity: 0.6;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--gold-pale);
  border: 1px solid rgba(201,162,39,0.35);
  border-radius: 3px; padding: 5px 20px;
  font-size: 12px; font-family: 'Inter', sans-serif;
  color: var(--gold); margin-bottom: 18px;
  letter-spacing: 1.5px; text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(24px, 4.5vw, 44px);
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 45%, var(--gold-dim) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px; line-height: 1.4;
  filter: drop-shadow(0 2px 8px rgba(201,162,39,0.20));
}
.hero p { font-size: 14px; color: var(--text-muted); max-width: 680px; margin: 0 auto; direction: ltr; font-family: 'Inter', sans-serif; }

/* ── AD BANNER ── */
.ad-banner {
  background: var(--bg-card); backdrop-filter: var(--glass);
  border: 1px dashed rgba(201,162,39,0.22);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-family: 'Inter', sans-serif;
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  margin: 0 auto;
}
.ad-leaderboard { width: 100%; max-width: 728px; height: 90px; margin-bottom: 36px; }
.ad-rectangle   { width: 300px; height: 250px; margin-top: 24px; }

/* ── GRID ── */
.calc-grid {
  display: grid; grid-template-columns: 1.45fr 1fr;
  gap: 26px; align-items: start;
}

/* ══════════════════════════════════════════
   CARDS
══════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden; position: relative;
  margin-bottom: 24px;
}

/* Top gold accent bar */
.card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), var(--gold), var(--gold-dim), transparent);
}

/* Subtle inner corner ornament */
.card::after {
  content: '';
  position: absolute; top: 8px; right: 8px;
  width: 20px; height: 20px;
  border-top: 1px solid rgba(201,162,39,0.25);
  border-right: 1px solid rgba(201,162,39,0.25);
  border-radius: 0 3px 0 0;
}

.card-header {
  padding: 18px 24px 14px;
  border-bottom: 1px solid rgba(201,162,39,0.12);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  background: linear-gradient(180deg, rgba(201,162,39,0.04) 0%, transparent 100%);
}

.card-title {
  font-size: 18px; color: var(--gold);
  display: flex; align-items: center; gap: 8px;
  font-weight: 600;
}

.card-body { padding: 22px 24px; }

.section-title {
  font-size: 13px; color: var(--gold);
  font-weight: 700; margin: 0 0 14px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(201,162,39,0.15);
  display: flex; align-items: center; gap: 6px;
  letter-spacing: 0.3px;
}
.section-title::before {
  content: '◆';
  font-size: 8px; color: var(--gold-dim);
}

/* ══════════════════════════════════════════
   FORM ELEMENTS
══════════════════════════════════════════ */
.input-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.input-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 8px; }
.form-group   { display: flex; flex-direction: column; gap: 6px; }
.form-group.span2 { grid-column: 1 / -1; }

.form-label {
  font-size: 12px; font-weight: 700;
  color: var(--text-muted); font-family: 'Inter', sans-serif;
  display: flex; align-items: center; gap: 5px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.ayat-ref {
  font-family: 'Inter', sans-serif; font-size: 9px;
  color: var(--gold); background: var(--gold-pale);
  border: 1px solid rgba(201,162,39,0.25);
  border-radius: 3px; padding: 1px 6px;
  direction: ltr; display: inline-block;
  letter-spacing: 0.5px;
}

.form-input {
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm); padding: 10px 13px;
  color: var(--text-main); font-family: 'Inter', sans-serif;
  font-size: 15px; direction: ltr; transition: var(--trans); width: 100%;
}
.form-input:focus {
  outline: none; border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(201,162,39,0.08), 0 0 20px rgba(201,162,39,0.06);
}
.form-input:disabled { opacity: 0.32; cursor: not-allowed; }
.form-input::placeholder { color: var(--text-dim); }

.form-select {
  background: var(--bg-input); border: 1px solid var(--border-input);
  border-radius: var(--radius-sm); padding: 10px 36px 10px 13px;
  color: var(--text-main); font-family: 'Inter', sans-serif;
  font-size: 13px; direction: ltr; width: 100%; cursor: pointer;
  appearance: none; transition: var(--trans);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%23C9A227' viewBox='0 0 16 16'%3E%3Cpath d='m7.247 4.86-4.796 5.481c-.566.647-.106 1.659.753 1.659h9.592a1 1 0 0 0 .753-1.659l-4.796-5.48a1 1 0 0 0-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 12px center;
}
.form-select:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(201,162,39,0.08); }
.form-select option { background: #0A0600; }

/* ── TOGGLE ── */
.toggle-group {
  background: var(--bg-input); border: 1px solid var(--border-input);
  border-radius: var(--radius-sm); padding: 11px 14px;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; transition: var(--trans); user-select: none;
}
.toggle-group:hover { border-color: rgba(201,162,39,0.30); background: rgba(201,162,39,0.04); }
.toggle-group.active {
  border-color: rgba(201,162,39,0.50); background: rgba(201,162,39,0.07);
  box-shadow: 0 0 16px rgba(201,162,39,0.08);
}
.toggle-label {
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  display: flex; align-items: center; gap: 5px;
}
.toggle-group.active .toggle-label { color: var(--text-main); }

.toggle-switch { position: relative; width: 38px; height: 20px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: rgba(140,108,24,0.20);
  border-radius: 20px; transition: var(--trans); cursor: pointer;
  border: 1px solid var(--border-input);
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 14px; height: 14px; left: 2px; bottom: 2px;
  background: var(--text-dim); border-radius: 50%; transition: var(--trans);
}
.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  border-color: var(--gold);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px); background: #0A0600;
}

/* ── RADIO ── */
.radio-row { display: flex; gap: 20px; flex-wrap: wrap; }
.radio-option {
  display: flex; align-items: center; gap: 7px;
  cursor: pointer; font-size: 14px; font-weight: 600;
  font-family: 'Inter', sans-serif; color: var(--text-muted);
  transition: var(--trans);
}
.radio-option:hover { color: var(--text-main); }
.radio-option input[type="radio"] { accent-color: var(--gold); width: 16px; height: 16px; cursor: pointer; }

/* ── PROPERTY MODE BUTTONS ── */
.prop-mode-btns { display: flex; gap: 6px; margin-bottom: 16px; }
.prop-mode-btn {
  padding: 6px 18px; border: 1px solid var(--border-input);
  border-radius: 3px; background: transparent;
  color: var(--text-muted); font-family: 'Inter', sans-serif;
  font-size: 12px; font-weight: 600; cursor: pointer; transition: var(--trans);
  letter-spacing: 0.5px; text-transform: uppercase;
}
.prop-mode-btn.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: #0A0600; border-color: var(--gold); font-weight: 700;
}

.prop-types-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.prop-type-item {
  background: var(--bg-input); border: 1px solid var(--border-input);
  border-radius: var(--radius-sm); padding: 11px 13px; transition: var(--trans);
}
.prop-type-item:focus-within { border-color: var(--border-focus); }
.prop-type-item label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-muted);
  font-family: 'Inter', sans-serif; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 7px;
}

.prop-total-bar {
  background: rgba(201,162,39,0.07); border: 1px solid rgba(201,162,39,0.22);
  border-radius: var(--radius-sm); padding: 12px 16px; margin-top: 12px;
  display: flex; justify-content: space-between; align-items: center;
}
.prop-total-label { font-size: 13px; font-weight: 700; color: var(--gold); font-family: 'Inter', sans-serif; }
.prop-total-value { font-family: 'Inter', sans-serif; font-size: 18px; font-weight: 800; color: var(--text-main); direction: ltr; }

/* ── DEDUCTION FLOW ── */
.deduction-flow {
  margin-top: 16px; padding: 16px;
  background: rgba(201,162,39,0.04); border: 1px solid rgba(201,162,39,0.15);
  border-radius: var(--radius-md);
}
.ded-step {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; margin-bottom: 10px;
  font-family: 'Inter', sans-serif; direction: ltr;
}
.ded-step:last-child {
  margin-bottom: 0; padding-top: 12px; border-top: 1px solid rgba(201,162,39,0.15);
  font-size: 15px; font-weight: 800; color: var(--success);
}
.ded-icon { font-size: 15px; flex-shrink: 0; width: 22px; text-align: center; }
.ded-label { flex: 1; color: var(--text-muted); }
.ded-amount { color: var(--text-main); font-weight: 600; }

.wasiyat-warn {
  background: rgba(208,144,48,0.08); border: 1px solid rgba(208,144,48,0.30);
  border-radius: var(--radius-xs); padding: 9px 13px;
  font-size: 12px; color: var(--warning); margin-top: 7px;
  display: none; font-family: 'Inter', sans-serif; direction: ltr;
}

/* ══════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════ */
.btn {
  padding: 13px 22px; border: none; border-radius: var(--radius-md);
  font-size: 16px; font-weight: 700; cursor: pointer; transition: var(--trans);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  position: relative; overflow: hidden;
  font-family: 'Noto Nastaliq Urdu', serif;
  letter-spacing: 0.3px;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.20) 0%, transparent 70%);
  opacity: 0; transform: scale(0); transition: transform 0.5s, opacity 0.5s;
}
.btn:active::after { opacity: 1; transform: scale(3); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold), var(--gold-dim));
  color: #0A0600; box-shadow: var(--shadow-btn); flex: 1;
  font-weight: 800; letter-spacing: 0.5px;
  border: 1px solid rgba(201,162,39,0.50);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(201,162,39,0.50);
  filter: brightness(1.06);
}
.btn-primary:active { transform: translateY(0); }

.btn-reset {
  background: rgba(255,255,255,0.03); color: var(--text-muted);
  border: 1px solid var(--border-input);
}
.btn-reset:hover { border-color: var(--danger); color: var(--danger); transform: translateY(-1px); }

.btn-row { display: flex; gap: 12px; margin-top: 22px; }

/* ── SMALL ACTION BUTTONS ── */
.action-btns { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.btn-sm {
  padding: 7px 13px; border: none; border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 700; cursor: pointer; transition: var(--trans);
  display: flex; align-items: center; gap: 5px;
  font-family: 'Inter', sans-serif; letter-spacing: 0.4px; text-transform: uppercase;
}
.btn-sm:hover { transform: translateY(-2px); filter: brightness(1.12); }
.btn-wa    { background: #128C7E; color: #fff; }
.btn-pdf   { background: #6B4E9E; color: #fff; }
.btn-print { background: rgba(255,255,255,0.06); color: var(--text-muted); border: 1px solid var(--border-input); }
.btn-copy  { background: rgba(255,255,255,0.06); color: var(--text-muted); border: 1px solid var(--border-input); }
.btn-save  { background: var(--gold-pale); color: var(--gold); border: 1px solid rgba(201,162,39,0.30); }

/* ── FATWA BUTTON ── */
.btn-fatwa {
  background: linear-gradient(135deg, #1A0A00, #2E1500);
  color: var(--gold);
  border: 1px solid rgba(201,162,39,0.45);
  font-weight: 700; font-size: 13px; border-radius: var(--radius-sm);
  padding: 10px 18px; cursor: pointer; transition: var(--trans);
  display: flex; align-items: center; gap: 7px;
  font-family: 'Inter', sans-serif; letter-spacing: 0.5px;
  text-transform: uppercase;
}
.btn-fatwa:hover {
  box-shadow: 0 4px 20px rgba(201,162,39,0.35);
  transform: translateY(-2px);
  border-color: var(--gold);
  background: linear-gradient(135deg, #2E1500, #1A0A00);
}

/* ── LANG TOGGLE ── */
.lang-btns { display: flex; gap: 4px; }
.lang-btn {
  padding: 3px 11px; border: 1px solid var(--border-input); border-radius: 3px;
  background: transparent; color: var(--text-muted);
  font-size: 11px; font-family: 'Inter', sans-serif;
  cursor: pointer; transition: var(--trans);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.lang-btn.active { background: var(--gold); color: #0A0600; border-color: var(--gold); font-weight: 700; }

/* ══════════════════════════════════════════
   RESULTS PANEL
══════════════════════════════════════════ */
.results-card { position: sticky; top: 74px; }

.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 12px; border-radius: 3px;
  font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase;
}
.s-normal { background: rgba(74,158,110,0.14); color: #4A9E6E; border: 1px solid rgba(74,158,110,0.30); }
.s-awl    { background: rgba(168,50,50,0.14);  color: #C05050; border: 1px solid rgba(168,50,50,0.30); }
.s-radd   { background: rgba(201,162,39,0.12); color: var(--gold); border: 1px solid rgba(201,162,39,0.30); }

.result-summary {
  background: rgba(201,162,39,0.05); border: 1px solid rgba(201,162,39,0.15);
  border-radius: var(--radius-sm); padding: 14px 18px; margin: 14px 0;
  font-size: 14px; text-align: center; color: var(--text-muted);
}
.empty-state { padding: 20px 10px; }
.empty-icon  { font-size: 40px; opacity: 0.30; margin-bottom: 10px; }

.chart-wrap { position: relative; height: 260px; margin: 14px 0; }

/* ══════════════════════════════════════════
   TABLE
══════════════════════════════════════════ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid rgba(201,162,39,0.15); margin: 14px 0; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  background: rgba(201,162,39,0.09); color: var(--gold);
  font-weight: 700; padding: 10px 13px; text-align: right; white-space: nowrap;
  border-bottom: 1px solid rgba(201,162,39,0.18);
  font-family: 'Inter', sans-serif; font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase;
}
thead th:not(:last-child) { border-left: 1px solid rgba(201,162,39,0.07); }
tbody tr { transition: var(--trans); animation: rowIn 0.4s ease both; }
tbody tr:nth-child(even) { background: var(--bg-table-alt); }
tbody tr:hover { background: var(--bg-hover); }
tbody td { padding: 10px 13px; text-align: right; border-bottom: 1px solid rgba(201,162,39,0.05); }
tbody td:not(:last-child) { border-left: 1px solid rgba(201,162,39,0.04); }
tbody tr:last-child td { border-bottom: none; }
@keyframes rowIn { from { opacity:0; transform:translateY(5px); } to { opacity:1; transform:none; } }

.td-frac { font-family:'Inter',sans-serif; font-weight:800; color:var(--gold); direction:ltr; text-align:center; }
.td-pct  { font-family:'Inter',sans-serif; color:var(--text-muted); direction:ltr; text-align:center; }
.td-amt  { font-family:'Inter',sans-serif; font-weight:700; color:var(--success); direction:ltr; }
.td-pp   { font-family:'Inter',sans-serif; font-size:11px; color:var(--text-muted); direction:ltr; }
.td-ref  { font-family:'Inter',sans-serif; font-size:10px; color:var(--gold-dim); direction:ltr; opacity:0.9; }

/* ── VERIFY ── */
.verify-box {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(74,158,110,0.08); border: 1px solid rgba(74,158,110,0.22);
  border-radius: 3px; padding: 3px 12px;
  font-family:'Inter',sans-serif; font-size:11px; color: var(--success);
  text-transform: uppercase; letter-spacing: 0.4px;
}
.verify-box.err { background:rgba(168,50,50,0.08); border-color:rgba(168,50,50,0.22); color:var(--danger); }

/* ── PER PERSON ── */
.pp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.pp-item {
  background: var(--bg-input); border: 1px solid var(--border-input);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.pp-name { font-size: 12px; color: var(--text-muted); margin-bottom: 3px; font-family:'Inter',sans-serif; }
.pp-amt  { font-family:'Inter',sans-serif; font-size:16px; font-weight:800; color:var(--gold); direction:ltr; }
.pp-sub  { font-family:'Inter',sans-serif; font-size:10px; color:var(--text-dim); direction:ltr; }

/* ── STEPS ── */
.step-item {
  display: flex; gap: 12px; margin-bottom: 13px;
  direction: rtl; animation: rowIn 0.4s ease both;
}
.step-num {
  width: 24px; height: 24px; flex-shrink: 0; margin-top: 4px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: #0A0600; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Inter', sans-serif; font-weight: 800; font-size: 11px;
}
.step-txt  { font-size: 13px; line-height: 2; }
.step-ayat {
  font-family:'Inter',sans-serif; font-size:10px; color:var(--gold);
  background:var(--gold-pale); border:1px solid rgba(201,162,39,0.20);
  border-radius:3px; padding:1px 7px;
  direction:ltr; display:inline-block; margin-top:3px;
  letter-spacing: 0.4px;
}

/* ── HAJB ── */
.hajb-item {
  background: rgba(168,50,50,0.06); border: 1px solid rgba(168,50,50,0.22);
  border-radius: var(--radius-xs); padding: 8px 12px;
  font-size: 12px; color: #D08080; margin-bottom: 6px;
  display: flex; align-items: flex-start; gap: 7px; font-family: 'Inter', sans-serif;
}

/* ── AWL / RADD ── */
.info-box  { border-radius: var(--radius-sm); padding: 11px 15px; font-size: 13px; margin: 10px 0; }
.info-awl  { background:rgba(168,50,50,0.06); border:1px solid rgba(168,50,50,0.22); color:#D08080; }
.info-radd { background:var(--gold-pale); border:1px solid rgba(201,162,39,0.22); color:var(--gold); }

/* ── HISTORY ── */
.hist-section { margin-top:18px; padding-top:14px; border-top:1px solid rgba(201,162,39,0.12); }
.hist-title   { font-size:13px; color:var(--gold); font-weight:700; margin-bottom:10px; display:flex; align-items:center; gap:5px; font-family:'Inter',sans-serif; letter-spacing:0.5px; text-transform:uppercase; }
.hist-item {
  background:var(--bg-input); border:1px solid var(--border-input); border-radius:var(--radius-sm);
  padding:9px 13px; margin-bottom:7px; cursor:pointer; transition:var(--trans);
  font-family:'Inter',sans-serif; font-size:12px;
}
.hist-item:hover { border-color:var(--gold); background:var(--bg-hover); }
.hist-date    { color:var(--text-dim); font-size:10px; margin-bottom:3px; }
.hist-preview { color:var(--text-muted); }

/* ══════════════════════════════════════════
   FAQ
══════════════════════════════════════════ */
.faq-section { max-width:1300px; margin:50px auto; padding:0 28px; position:relative; z-index:1; }
.faq-title {
  font-size:24px; color:var(--gold); text-align:center; margin-bottom:8px;
}
.faq-sub {
  text-align: center; color: var(--text-muted); font-family:'Inter',sans-serif;
  font-size:13px; margin-bottom:28px; direction: ltr;
}
.faq-divider {
  text-align: center; color: var(--gold-dim); margin-bottom:28px;
  letter-spacing:12px; font-size:14px; opacity:0.5;
}
.faq-item {
  border: 1px solid rgba(201,162,39,0.14); border-radius:var(--radius-md); margin-bottom:8px;
  overflow:hidden; background:var(--bg-card); backdrop-filter:var(--glass); transition:var(--trans);
}
.faq-item:hover { border-color:rgba(201,162,39,0.28); }
.faq-q {
  padding:16px 22px; cursor:pointer; font-size:15px; font-weight:600;
  display:flex; justify-content:space-between; align-items:center; gap:10px;
  transition:var(--trans);
}
.faq-q:hover { background:rgba(201,162,39,0.04); }
.faq-icon { font-size:18px; color:var(--gold); font-family:'Inter',sans-serif; flex-shrink:0; transition:var(--trans); }
.faq-a {
  max-height:0; overflow:hidden; transition:max-height 0.4s ease, padding 0.3s;
  font-size:14px; line-height:2.2; color:var(--text-muted);
}
.faq-a.open { max-height:500px; padding:0 22px 18px; }

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
.footer {
  background: rgba(7,4,10,0.98);
  border-top: 1px solid rgba(201,162,39,0.15);
  padding: 54px 28px 22px;
  margin-top: auto; direction: ltr;
  font-family: 'Inter', sans-serif;
  position: relative; z-index: 1;
}
.footer::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), var(--gold), var(--gold-dim), transparent);
}
.footer-brand {
  text-align: center; margin-bottom: 44px;
}
.footer-brand-name {
  font-family: 'Cinzel', serif; font-size: 22px; font-weight: 700;
  color: var(--gold); margin-bottom: 6px;
}
.footer-brand-sub {
  font-size: 12px; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase;
}
.footer-divider {
  text-align: center; color: var(--gold-dim); letter-spacing: 12px;
  font-size: 13px; opacity: 0.4; margin: 14px 0 40px;
}

.footer-grid {
  max-width: 1300px; margin: 0 auto 40px;
  display: grid; grid-template-columns: repeat(4,1fr); gap: 38px;
}
.footer-col h4 {
  font-size: 11px; color: var(--gold); margin-bottom: 16px;
  padding-bottom: 8px; border-bottom: 1px solid rgba(201,162,39,0.22);
  font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a {
  color: var(--text-muted); text-decoration: none; font-size: 13px;
  display: flex; align-items: center; gap: 7px; transition: var(--trans);
}
.footer-col a:hover { color: var(--gold); transform: translateX(4px); }

.footer-bottom {
  max-width: 1300px; margin: 0 auto; text-align: center;
  padding-top: 20px; border-top: 1px solid rgba(201,162,39,0.10);
  color: var(--text-dim); font-size: 12px; line-height: 1.9;
}
.footer-bottom a { color: var(--gold); text-decoration: none; }

/* ══════════════════════════════════════════
   FATWA MODAL
══════════════════════════════════════════ */
.fatwa-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 600;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 30px 20px; overflow-y: auto;
  animation: fadeInDown 0.3s ease;
}
.fatwa-doc {
  background: #FFFDF0; border: 3px double #8B6914;
  border-radius: 4px; max-width: 700px; width: 100%;
  padding: 0; color: #1A0E00; direction: rtl;
  font-family: 'Noto Nastaliq Urdu', serif;
  box-shadow: 0 40px 100px rgba(0,0,0,0.80);
  position: relative; overflow: hidden;
}
.fatwa-doc::before {
  content: ''; position: absolute; inset: 10px;
  border: 1px solid rgba(139,105,20,0.25); pointer-events: none; z-index: 0;
}
.fatwa-top-bar {
  background: linear-gradient(135deg, #1A0A00, #2A1400, #1A0A00);
  border-bottom: 2px solid #8B6914;
  padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between; direction: ltr;
}
.fatwa-top-bar .site-name {
  font-family: 'Cinzel', serif; font-size: 13px; font-weight: 700;
  color: #C9A227; letter-spacing: 1px;
}
.fatwa-close {
  background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.20);
  color: #fff; border-radius: 50%; width: 28px; height: 28px;
  font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s;
}
.fatwa-close:hover { background: rgba(200,50,50,0.4); }
.fatwa-inner { padding: 28px 34px; position: relative; z-index: 1; }
.fatwa-bismillah { text-align:center; font-size:32px; color:#1A0A00; margin-bottom:6px; }
.fatwa-title-line {
  text-align: center; border-top: 2px solid #8B6914; border-bottom: 2px solid #8B6914;
  padding: 8px 0; margin: 10px 0 20px;
}
.fatwa-title-line h2 { font-size:22px; color:#1A0A00; font-weight:700; line-height:1.6; }
.fatwa-title-line p  { font-size:12px; font-family:'Inter',sans-serif; direction:ltr; color:#5a4010; margin-top:2px; }
.fatwa-meta {
  background:rgba(26,10,0,0.05); border:1px solid rgba(139,105,20,0.25);
  border-radius:3px; padding:14px 18px; margin-bottom:20px;
  font-size:15px; line-height:2.4;
}
.fatwa-meta-row { display:flex; align-items:baseline; gap:8px; }
.fatwa-meta-label { font-weight:700; color:#1A0A00; min-width:80px; font-family:'Inter',sans-serif; font-size:12px; text-transform:uppercase; letter-spacing:0.5px; }
.fatwa-meta-val { color:#3A1E00; }
.fatwa-body { font-size:15px; line-height:2.5; color:#1A0E00; margin-bottom:20px; text-align:justify; }
.fatwa-rule-box {
  background:rgba(26,10,0,0.06); border-right:4px solid #8B6914;
  padding:12px 16px; margin:14px 0; font-size:14px; line-height:2.2; color:#2A1400;
  font-style:italic;
}
.fatwa-results-table { width:100%; border-collapse:collapse; margin:16px 0; font-size:13px; font-family:'Inter',sans-serif; direction:ltr; }
.fatwa-results-table th { background:#1A0A00; color:#C9A227; padding:9px 12px; text-align:center; font-weight:700; font-size:11px; letter-spacing:0.5px; text-transform:uppercase; }
.fatwa-results-table td { padding:8px 12px; border:1px solid #d4c088; text-align:center; color:#1A0E00; }
.fatwa-results-table tr:nth-child(even) td { background:rgba(201,162,39,0.06); }
.fatwa-footer-section {
  border-top:2px solid rgba(139,105,20,0.35); margin-top:24px; padding-top:20px;
  display:flex; align-items:flex-end; justify-content:space-between; flex-wrap:wrap; gap:20px;
}
.fatwa-signature { font-size:15px; line-height:2.4; }
.fatwa-sig-line   { width:200px; border-bottom:1px solid #8B6914; margin:16px 0 6px; height:40px; }
.fatwa-sig-name   { font-size:18px; font-weight:700; color:#1A0A00; }
.fatwa-sig-title  { font-size:12px; color:#5a4010; font-family:'Inter',sans-serif; }
.fatwa-sig-masjid { font-size:12px; color:#5a4010; font-family:'Inter',sans-serif; }
.fatwa-muhar { width:130px; height:130px; object-fit:contain; opacity:0.88; filter:drop-shadow(0 2px 6px rgba(0,0,0,0.25)); }
.fatwa-action-row {
  background:#1A0A00; border-top:2px solid #8B6914;
  padding:14px 28px; display:flex; gap:10px; justify-content:center; direction:ltr;
}
.fatwa-btn {
  padding:9px 22px; border:none; border-radius:4px;
  font-family:'Inter',sans-serif; font-size:12px; font-weight:700;
  cursor:pointer; transition:0.2s; display:flex; align-items:center; gap:6px;
  text-transform:uppercase; letter-spacing:0.5px;
}
.fatwa-btn:hover { transform:translateY(-1px); filter:brightness(1.1); }
.fatwa-btn-print { background:linear-gradient(135deg,#C9A227,#8B6914); color:#0A0600; }
.fatwa-btn-pdf   { background:#6B4E9E; color:#fff; }
.fatwa-btn-close { background:rgba(255,255,255,0.10); color:rgba(255,255,255,0.70); border:1px solid rgba(255,255,255,0.15); }

/* ══════════════════════════════════════════
   PRINT CERTIFICATE
══════════════════════════════════════════ */
#cert-area { display: none; }
.cert-header { text-align:center; border-bottom:3px double #8B6914; padding-bottom:15px; margin-bottom:20px; }
.cert-title  { font-size:26px; color:#8B6914; font-weight:700; font-family:'Cinzel',serif; }
.cert-meta   { font-family:'Inter',sans-serif; font-size:12px; color:#666; margin-top:4px; }

/* ══════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════ */
@keyframes fadeInDown { from { opacity:0; transform:translateY(-14px); } to { opacity:1; transform:none; } }
@keyframes fadeInUp   { from { opacity:0; transform:translateY(14px);  } to { opacity:1; transform:none; } }
.animate-in { animation: fadeInUp 0.55s ease both; }

/* ══════════════════════════════════════════
   PRINT
══════════════════════════════════════════ */
@media print {
  .header, .footer, .ad-banner, .action-btns, .btn-row,
  .faq-section, .hist-section, .hero, .card:first-of-type,
  #fatwa-trigger, .lang-btns { display: none !important; }
  body { background: #fff; color: #000; }
  #cert-area { display: block !important; }
  .results-card { position: static; }
  * { box-shadow: none !important; backdrop-filter: none !important; }
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width:1060px) { .calc-grid { grid-template-columns:1fr; } .results-card { position:static; } }
@media (max-width:768px)  {
  .main { padding:18px 14px; } .card-body { padding:16px 16px; }
  .input-grid { grid-template-columns:1fr; }
  .input-grid-3 { grid-template-columns:1fr 1fr; }
  .footer-grid { grid-template-columns:1fr 1fr; }
  .pp-grid { grid-template-columns:1fr; }
}
@media (max-width:480px)  {
  .input-grid-3 { grid-template-columns:1fr; }
  .footer-grid  { grid-template-columns:1fr; }
  .prop-types-grid { grid-template-columns:1fr; }
  .hero h1 { font-size:22px; }
}
