@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Amiri:ital,wght@0,400;0,700;1,400&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold:        #C9A84C;
  --gold-light:  #E2C97E;
  --gold-pale:   #F5E6B0;
  --gold-dark:   #8B6914;
  --red:         #C8102E;
  --red-dark:    #8B0000;
  --black:       #0A0804;
  --dark:        #111008;
  --panel:       #1A1408;
  --panel2:      #221C0A;
  --ink:         #2C200A;
  --cream:       #FAF3E0;
  --cream-dark:  #F0E4C4;
  --border:      #C9A84C;
  --text-muted:  #9A8C6A;
  --green-ok:    #1a5c1a;
}

html { scroll-behavior: smooth; }

body {
  background: var(--dark);
  font-family: 'EB Garamond', Georgia, serif;
  color: var(--cream);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── NOISE TEXTURE OVERLAY ── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 0; opacity: .5;
}

/* ══════════════════════════════
   NAVIGATION
══════════════════════════════ */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(10,8,4,.92);
  border-bottom: 1px solid rgba(201,168,76,.3);
  backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px; height: 64px;
}
.nav-brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
}
.nav-emblem { width: 36px; height: 36px; }
.nav-title {
  font-family: 'Cinzel', serif;
  font-size: 12px; letter-spacing: 2.5px;
  color: var(--gold-light); text-transform: uppercase;
  line-height: 1.3;
}
.nav-title span { display: block; font-size: 9px; color: var(--text-muted); letter-spacing: 2px; }
.nav-links {
  display: flex; gap: 32px; list-style: none;
}
.nav-links a {
  font-family: 'Cinzel', serif; font-size: 10px;
  letter-spacing: 2px; color: var(--text-muted);
  text-decoration: none; text-transform: uppercase;
  transition: color .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--gold); }
.nav-search-btn {
  background: var(--gold); color: var(--black);
  border: none; font-family: 'Cinzel', serif;
  font-size: 10px; letter-spacing: 2px; font-weight: 700;
  padding: 8px 20px; cursor: pointer; text-transform: uppercase;
  text-decoration: none; display: inline-block;
  transition: background .2s;
}
.nav-search-btn:hover { background: var(--gold-light); }

/* ══════════════════════════════
   FLAG BAR
══════════════════════════════ */
.flag-stripe {
  height: 5px;
  background: linear-gradient(180deg, #C8102E 33.33%, #fff 33.33% 66.66%, #1a1a1a 66.66%);
  position: relative; z-index: 1;
}

/* ══════════════════════════════
   HERO
══════════════════════════════ */
.hero {
  padding-top: 64px;
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  position: relative;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(201,168,76,.08) 0%, transparent 70%),
              linear-gradient(180deg, #0A0804 0%, #111008 100%);
}
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M30 2 L32 20 L50 20 L36 30 L42 48 L30 38 L18 48 L24 30 L10 20 L28 20 Z' fill='none' stroke='rgba(201,168,76,0.04)' stroke-width='1'/%3E%3C/svg%3E") repeat;
  pointer-events: none;
}
.hero-content { position: relative; z-index: 2; max-width: 820px; padding: 40px 24px; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(201,168,76,.4);
  padding: 6px 18px; margin-bottom: 32px;
  font-family: 'Cinzel', serif; font-size: 9px;
  letter-spacing: 3px; color: var(--gold); text-transform: uppercase;
  animation: fadeUp .8s ease both;
}
.hero-badge::before, .hero-badge::after { content: '✦'; font-size: 8px; }

.hero-emblem {
  width: 110px; height: 110px; margin: 0 auto 28px;
  animation: fadeUp .8s .1s ease both;
}

.hero h1 {
  font-family: 'Cinzel', serif;
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 900; letter-spacing: 3px;
  color: var(--gold-light); line-height: 1.15;
  animation: fadeUp .8s .2s ease both;
}
.hero h1 em {
  font-style: normal; color: var(--cream);
  display: block; font-size: .55em; letter-spacing: 6px;
  font-weight: 400; margin-bottom: 8px;
}
.hero-arabic {
  font-family: 'Amiri', serif; font-size: 22px;
  color: var(--text-muted); direction: rtl;
  margin-top: 10px; margin-bottom: 28px;
  animation: fadeUp .8s .3s ease both;
}
.hero-sub {
  font-size: 16px; line-height: 1.8; color: #b8a880;
  max-width: 600px; margin: 0 auto 40px;
  animation: fadeUp .8s .4s ease both;
}
.hero-actions {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
  animation: fadeUp .8s .5s ease both;
}
.btn-primary {
  background: var(--gold); color: var(--black);
  font-family: 'Cinzel', serif; font-size: 11px;
  letter-spacing: 2.5px; font-weight: 700;
  padding: 14px 32px; border: none; cursor: pointer;
  text-decoration: none; display: inline-block;
  text-transform: uppercase; transition: all .2s;
}
.btn-primary:hover { background: var(--gold-light); transform: translateY(-2px); }
.btn-outline {
  background: transparent; color: var(--gold);
  font-family: 'Cinzel', serif; font-size: 11px;
  letter-spacing: 2.5px; font-weight: 600;
  padding: 14px 32px; border: 1px solid var(--gold);
  cursor: pointer; text-decoration: none; display: inline-block;
  text-transform: uppercase; transition: all .2s;
}
.btn-outline:hover { background: rgba(201,168,76,.1); transform: translateY(-2px); }

.scroll-hint {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-family: 'Cinzel', serif; font-size: 9px; letter-spacing: 2px;
  color: var(--text-muted); animation: pulse 2s infinite;
}
.scroll-hint::after { content: '↓'; font-size: 16px; color: var(--gold); }

/* ══════════════════════════════
   STATS BAR
══════════════════════════════ */
.stats-bar {
  background: var(--panel);
  border-top: 1px solid rgba(201,168,76,.2);
  border-bottom: 1px solid rgba(201,168,76,.2);
  display: flex; justify-content: center;
  position: relative; z-index: 2;
}
.stat-item {
  flex: 1; max-width: 220px;
  padding: 28px 20px; text-align: center;
  border-right: 1px solid rgba(201,168,76,.15);
}
.stat-item:last-child { border-right: none; }
.stat-num {
  font-family: 'Cinzel', serif; font-size: 32px;
  font-weight: 900; color: var(--gold);
  display: block; line-height: 1;
}
.stat-label {
  font-size: 11px; color: var(--text-muted);
  letter-spacing: 1.5px; margin-top: 6px;
  font-family: 'Cinzel', serif; text-transform: uppercase;
}

/* ══════════════════════════════
   SECTIONS
══════════════════════════════ */
.section {
  padding: 90px 40px;
  position: relative; z-index: 1;
}
.section-inner { max-width: 1100px; margin: 0 auto; }
.section-label {
  font-family: 'Cinzel', serif; font-size: 9px;
  letter-spacing: 4px; color: var(--gold);
  text-transform: uppercase; margin-bottom: 12px;
  display: flex; align-items: center; gap: 12px;
}
.section-label::after { content: ''; flex: 0 0 40px; height: 1px; background: var(--gold); }
.section-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(22px, 3vw, 36px); font-weight: 700;
  color: var(--gold-light); margin-bottom: 20px; line-height: 1.2;
}
.section-body {
  font-size: 15.5px; line-height: 1.9; color: #b8a880;
  max-width: 700px;
}

/* Cards grid */
.cards-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2px; margin-top: 50px;
}
.card {
  background: var(--panel);
  border: 1px solid rgba(201,168,76,.15);
  padding: 36px 32px;
  position: relative; overflow: hidden;
  transition: border-color .3s;
}
.card:hover { border-color: rgba(201,168,76,.5); }
.card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0; transition: opacity .3s;
}
.card:hover::before { opacity: 1; }
.card-icon {
  font-size: 28px; margin-bottom: 16px; display: block;
}
.card-title {
  font-family: 'Cinzel', serif; font-size: 14px;
  letter-spacing: 1.5px; color: var(--gold-light);
  margin-bottom: 12px;
}
.card-body { font-size: 14px; line-height: 1.85; color: var(--text-muted); }

/* ── DIVIDER ── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,.4), transparent);
  margin: 0 40px;
}

/* ── REVOCATION SECTION ── */
.revocation-box {
  background: linear-gradient(135deg, rgba(139,0,0,.15), rgba(139,0,0,.05));
  border: 1px solid rgba(200,16,46,.3);
  border-left: 4px solid var(--red);
  padding: 40px 44px;
  position: relative;
}
.revocation-box .rev-title {
  font-family: 'Cinzel', serif; font-size: 18px;
  color: #e87070; margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.revocation-box p { font-size: 15px; line-height: 1.9; color: #b8a880; margin-bottom: 14px; }
.revocation-box ul { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.revocation-box ul li {
  font-size: 13.5px; color: #b8a880; padding: 10px 14px;
  background: rgba(139,0,0,.1); border: 1px solid rgba(200,16,46,.2);
  display: flex; align-items: center; gap: 8px;
}
.revocation-box ul li::before { content: '✕'; color: var(--red); font-size: 10px; flex-shrink: 0; }

/* ══════════════════════════════
   SEARCH PAGE
══════════════════════════════ */
.search-page {
  padding-top: 64px; min-height: 100vh;
  background: radial-gradient(ellipse 60% 50% at 50% 20%, rgba(201,168,76,.06) 0%, transparent 60%);
}
.search-hero {
  text-align: center; padding: 80px 40px 60px;
  border-bottom: 1px solid rgba(201,168,76,.15);
}
.search-hero h1 {
  font-family: 'Cinzel', serif; font-size: clamp(24px, 4vw, 42px);
  font-weight: 900; color: var(--gold-light); margin-bottom: 12px;
}
.search-hero p { font-size: 15px; color: var(--text-muted); margin-bottom: 40px; }

.search-box-wrap {
  max-width: 640px; margin: 0 auto;
  position: relative;
}
.search-box-wrap input {
  width: 100%; padding: 18px 60px 18px 24px;
  background: var(--panel); border: 1px solid rgba(201,168,76,.4);
  border-bottom: 2px solid var(--gold);
  color: var(--cream); font-family: 'Cinzel', serif;
  font-size: 14px; letter-spacing: 2px;
  outline: none; transition: border-color .2s;
}
.search-box-wrap input::placeholder { color: var(--text-muted); font-size: 12px; letter-spacing: 1.5px; }
.search-box-wrap input:focus { border-color: var(--gold-light); }
.search-box-wrap button {
  position: absolute; right: 0; top: 0; bottom: 0;
  background: var(--gold); border: none;
  width: 56px; cursor: pointer; font-size: 18px;
  transition: background .2s;
}
.search-box-wrap button:hover { background: var(--gold-light); }

.search-hints {
  display: flex; gap: 10px; justify-content: center;
  margin-top: 16px; flex-wrap: wrap;
}
.search-hint-tag {
  font-family: 'Cinzel', serif; font-size: 9px; letter-spacing: 1.5px;
  color: var(--text-muted); border: 1px solid rgba(201,168,76,.2);
  padding: 5px 12px; cursor: pointer; transition: all .2s;
}
.search-hint-tag:hover { border-color: var(--gold); color: var(--gold); }

.search-results { max-width: 900px; margin: 0 auto; padding: 60px 40px; }

/* Error state */
.search-error {
  text-align: center; padding: 60px 20px;
  display: none;
}
.search-error .err-icon { font-size: 48px; display: block; margin-bottom: 20px; }
.search-error h3 {
  font-family: 'Cinzel', serif; font-size: 20px;
  color: var(--red); margin-bottom: 10px;
}
.search-error p { color: var(--text-muted); font-size: 14px; }

/* Empty state */
.search-empty {
  text-align: center; padding: 80px 20px;
}
.search-empty .empty-icon { font-size: 56px; display: block; margin-bottom: 24px; opacity: .4; }
.search-empty h3 {
  font-family: 'Cinzel', serif; font-size: 16px;
  color: var(--text-muted); letter-spacing: 2px;
}

/* ══════════════════════════════
   PROFILE CARD
══════════════════════════════ */
.profile-result { display: none; }

.profile-header-card {
  background: var(--panel);
  border: 1px solid rgba(201,168,76,.3);
  border-top: 4px solid var(--gold);
  padding: 36px 40px;
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 32px; align-items: start;
  margin-bottom: 2px;
}
.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; flex-shrink: 0;
  border: 2px solid var(--gold);
}
.profile-name {
  font-family: 'Cinzel', serif; font-size: 22px;
  font-weight: 700; color: var(--gold-light); margin-bottom: 6px;
}
.profile-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.profile-meta-item {
  font-family: 'Cinzel', serif; font-size: 9.5px;
  letter-spacing: 1.5px; color: var(--text-muted);
  display: flex; align-items: center; gap: 5px;
}
.profile-meta-item strong { color: var(--cream); }
.pardon-status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(26,92,26,.3); border: 1px solid rgba(26,92,26,.6);
  color: #6dba6d; font-family: 'Cinzel', serif;
  font-size: 10px; letter-spacing: 2px; padding: 6px 16px;
  text-transform: uppercase;
}
.pardon-status-badge::before { content: '●'; font-size: 8px; }
.profile-ids { text-align: right; }
.profile-id-item {
  font-family: 'Cinzel', serif; font-size: 9px;
  letter-spacing: 1.5px; color: var(--text-muted);
  margin-bottom: 6px;
}
.profile-id-item strong { color: var(--gold); font-size: 12px; display: block; }

/* Info panels */
.profile-panels {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 2px; margin-bottom: 2px;
}
.info-panel {
  background: var(--panel);
  border: 1px solid rgba(201,168,76,.15);
  padding: 28px 32px;
}
.info-panel-title {
  font-family: 'Cinzel', serif; font-size: 10px;
  letter-spacing: 2.5px; color: var(--gold);
  text-transform: uppercase; margin-bottom: 20px;
  padding-bottom: 10px; border-bottom: 1px solid rgba(201,168,76,.2);
  display: flex; align-items: center; gap: 8px;
}
.info-row {
  display: flex; justify-content: space-between;
  align-items: flex-start; padding: 9px 0;
  border-bottom: 1px solid rgba(201,168,76,.08);
  gap: 16px;
}
.info-row:last-child { border-bottom: none; }
.info-key {
  font-family: 'Cinzel', serif; font-size: 9px;
  letter-spacing: 1px; color: var(--text-muted);
  flex-shrink: 0; padding-top: 2px;
}
.info-val { font-size: 13px; color: var(--cream); text-align: right; font-weight: 500; }
.info-val.warn { color: #e87070; }
.info-val.ok { color: #6dba6d; }

/* Financial notice */
.financial-notice {
  background: linear-gradient(135deg, rgba(139,0,0,.12), rgba(139,0,0,.04));
  border: 1px solid rgba(200,16,46,.25);
  border-left: 4px solid var(--red);
  padding: 20px 28px; margin-bottom: 2px;
  display: flex; align-items: flex-start; gap: 16px;
}
.financial-notice .fn-icon { font-size: 22px; flex-shrink: 0; }
.financial-notice .fn-text { font-size: 13px; line-height: 1.7; color: #b8a880; }
.financial-notice .fn-text strong { color: #e87070; }

/* Conditions note */
.conditions-note {
  background: rgba(201,168,76,.06);
  border: 1px solid rgba(201,168,76,.25);
  border-left: 4px solid var(--gold);
  padding: 20px 28px; margin-bottom: 24px;
  font-size: 13px; line-height: 1.7; color: #b8a880;
}
.conditions-note strong { color: var(--gold-light); }

/* Documents section */
.docs-section { margin-top: 6px; }
.docs-title {
  font-family: 'Cinzel', serif; font-size: 11px;
  letter-spacing: 3px; color: var(--gold);
  text-transform: uppercase; margin-bottom: 16px;
  display: flex; align-items: center; gap: 12px;
  padding: 20px 0 16px;
  border-top: 1px solid rgba(201,168,76,.2);
}
.docs-title::after { content: ''; flex: 1; height: 1px; background: rgba(201,168,76,.2); }
.doc-tabs {
  display: flex; gap: 2px; margin-bottom: 2px;
}
.doc-tab {
  flex: 1; background: var(--panel2);
  border: 1px solid rgba(201,168,76,.15);
  border-bottom: none; padding: 12px 20px;
  font-family: 'Cinzel', serif; font-size: 9.5px;
  letter-spacing: 1.5px; color: var(--text-muted);
  cursor: pointer; text-align: center; text-transform: uppercase;
  transition: all .2s;
}
.doc-tab.active {
  background: var(--panel); color: var(--gold);
  border-color: rgba(201,168,76,.4);
  border-bottom: 1px solid var(--panel);
}
.doc-tab:hover:not(.active) { color: var(--gold-light); }
.doc-pane {
  background: var(--panel);
  border: 1px solid rgba(201,168,76,.3);
  display: none;
}
.doc-pane.active { display: block; }
.doc-pane iframe {
  width: 100%; height: 820px; border: none;
  display: block;
}

/* ══════════════════════════════
   FOOTER
══════════════════════════════ */
footer {
  background: var(--panel);
  border-top: 1px solid rgba(201,168,76,.2);
  padding: 40px;
  display: grid; grid-template-columns: 1fr auto;
  gap: 40px; align-items: center;
  position: relative; z-index: 2;
}
.footer-brand {
  font-family: 'Cinzel', serif; font-size: 11px;
  letter-spacing: 2px; color: var(--gold-light); margin-bottom: 8px;
}
.footer-sub { font-size: 12px; color: var(--text-muted); line-height: 1.7; }
.footer-arabic {
  font-family: 'Amiri', serif; font-size: 18px;
  color: var(--text-muted); direction: rtl;
}

/* ══════════════════════════════
   ANIMATIONS
══════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: .5; }
  50%       { opacity: 1; }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.fade-in { animation: fadeUp .6s ease both; }

/* ══════════════════════════════
   RESPONSIVE
══════════════════════════════ */
@media (max-width: 768px) {
  nav { padding: 0 20px; }
  .nav-links { display: none; }
  .section { padding: 60px 20px; }
  .profile-header-card { grid-template-columns: 1fr; }
  .profile-panels { grid-template-columns: 1fr; }
  .profile-ids { text-align: left; }
  .revocation-box ul { grid-template-columns: 1fr; }
  footer { grid-template-columns: 1fr; }
  .doc-tabs { flex-direction: column; }
}
