/* ===== ALHEKMA BRAND COLORS =====
   Red:   #e21a23
   Blue:  #2c3480
   Gold:  #896d4a / #c8a96e
   ================================ */

@font-face {
  font-family: 'CircularStd';
  src: url('../fonts/CircularStd-Book.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'CircularStd';
  src: url('../fonts/CircularStd-Medium.ttf') format('truetype');
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'FrutigerLTArabic';
  src: url('../fonts/FrutigerLTArabic.ttf') format('truetype');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

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

:root {
  --red:      #e21a23;
  --red-dark: #b8121a;
  --blue:     #2c3480;
  --blue-dark:#1e2460;
  --gold:     #896d4a;
  --gold-lt:  #c8a96e;
  --yellow:   #ffb600;
  --dark:     #111827;
  --gray:     #6b7280;
  --muted:    #9ca3af;
  --light:    #f5f6fa;
  --white:    #ffffff;
  --shadow:   0 8px 32px rgba(44,52,128,0.13);
  --r:        14px;
  --font-ar:  'FrutigerLTArabic', 'Cairo', 'Arial', sans-serif;
  --font-en:  'CircularStd', 'Helvetica Neue', 'Arial', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ar);
  background: var(--light);
  color: var(--dark);
  direction: rtl;
  line-height: 1.7;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

/* Apply Circular Std to all LTR / English text */
[dir="ltr"], .en-text, .caption-en, .hero-sub-en, .footer-en,
.header-title-en, .counter-lbl-en, .cert-sub, .success-en,
.pledge-en-text, .pledge-en-text p,
.sig-hint-en, .section-sub,
input[dir="ltr"], input[type="tel"] {
  font-family: 'CircularStd', 'Helvetica Neue', Arial, sans-serif;
}

/* ===========================
   HEADER
   =========================== */
.site-header {
  background: var(--blue);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 16px rgba(0,0,0,0.35);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-logo-img {
  height: 52px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.header-title {
  text-align: center;
  flex: 1;
}

.header-title h1 {
  color: var(--white);
  font-size: clamp(1rem, 3vw, 1.4rem);
  font-weight: 800;
  line-height: 1.2;
}

.header-title-en {
  color: rgba(255,255,255,0.6);
  font-size: 0.68rem;
  font-family: var(--font-en);
  letter-spacing: 0.3px;
}

.header-flag {
  height: 32px;
  width: auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ===========================
   HERO — white, centred
   =========================== */
.hero {
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(40px, 7vh, 80px) clamp(20px, 5vw, 60px);
  gap: 32px;
  border-bottom: 5px solid transparent;
  border-image: linear-gradient(90deg, var(--blue), var(--red), var(--gold)) 1;
}

/* Top text */
.hero-top-band {
  text-align: center;
  max-width: 720px;
}

.hero-heading {
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  font-weight: 900;
  color: var(--blue);
  line-height: 1.35;
  margin-bottom: 12px;
}

.hero-sub {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 4px;
}

.hero-sub-en {
  font-size: 0.84rem;
  color: var(--gray);
  font-family: var(--font-en);
}

/* Centred photo */
.hero-center {
  display: flex;
  justify-content: center;
}

.hero-photo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.hero-photo-frame {
  width: clamp(240px, 30vw, 360px);
  aspect-ratio: 3/4;
  border-radius: 20px;
  overflow: hidden;
  border: 5px solid var(--gold-lt);
  box-shadow:
    0 0 0 10px rgba(200,169,110,0.12),
    0 24px 60px rgba(44,52,128,0.18);
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.photo-caption {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.caption-ar {
  font-size: 0.88rem;
  color: var(--gold);
  font-weight: 600;
}

.caption-name {
  font-size: clamp(1.05rem, 2.5vw, 1.4rem);
  font-weight: 800;
  color: var(--blue);
  line-height: 1.3;
}

.caption-en {
  font-size: 0.75rem;
  color: var(--gray);
  font-family: var(--font-en);
}

.caption-title {
  font-size: 0.88rem;
  color: var(--blue);
  font-weight: 600;
}

/* CTA */
.hero-bottom-band { text-align: center; }

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: var(--white);
  font-family: var(--font-ar);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 14px 40px;
  border-radius: 50px;
  text-decoration: none;
  box-shadow: 0 4px 24px rgba(226,26,35,0.35);
  transition: transform 0.25s, box-shadow 0.25s;
}

.hero-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(226,26,35,0.5);
}

.cta-arrow { animation: bounce 1.5s ease-in-out infinite; }

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(5px); }
}

/* Hide unused old elements */
.hero-bg-overlay, .flag-strip, .flag-white, .flag-red,
.hero-inner, .hero-text, .hero-badge { display: none; }

/* ===========================
   PLEDGE SECTION
   =========================== */
.pledge-section {
  padding: clamp(48px, 8vh, 96px) 20px;
  background: var(--white);
}

.container {
  max-width: 960px;
  margin: 0 auto;
}

.section-label {
  display: inline-block;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 18px;
  border-radius: 50px;
  margin-bottom: 24px;
  letter-spacing: 1px;
}

.pledge-card {
  background: var(--light);
  border: 1px solid rgba(44,52,128,0.1);
  border-radius: var(--r);
  padding: clamp(24px, 5vw, 52px);
  position: relative;
  overflow: hidden;
}

.pledge-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--blue), var(--red), var(--gold));
}

.pledge-basmala {
  text-align: center;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 2px;
  margin-bottom: 28px;
}

.pledge-body {
  border-right: 4px solid var(--blue);
  padding-right: 24px;
  margin-bottom: 24px;
}

.pledge-body p {
  font-size: clamp(0.95rem, 2vw, 1.12rem);
  line-height: 2;
  color: var(--dark);
  margin-bottom: 14px;
}

.pledge-body p:last-child { margin-bottom: 0; }

.pledge-en-text {
  border-right: 4px solid var(--gold);
  padding-right: 24px;
  direction: ltr;
  text-align: left;
}

.pledge-en-text p {
  font-size: 0.9rem;
  line-height: 1.9;
  color: var(--gray);
  font-family: var(--font-en);
}

/* ===========================
   FORM SECTION
   =========================== */
.form-section {
  padding: clamp(48px, 8vh, 96px) 20px;
  background: linear-gradient(180deg, #eef1fb 0%, var(--light) 100%);
}

.section-title {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 4px;
}

.section-sub {
  color: var(--gray);
  font-family: var(--font-en);
  font-size: 0.9rem;
  margin-bottom: 36px;
}

/* Steps bar */
.steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 0;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.4;
  transition: opacity 0.3s;
}

.step-item.active { opacity: 1; }
.step-item.done   { opacity: 0.85; }

.step-num {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: var(--blue);
  background: var(--white);
  transition: all 0.3s;
}

.step-item.active .step-num {
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(44,52,128,0.3);
}

.step-item.done .step-num {
  background: #10b981;
  border-color: #10b981;
  color: var(--white);
}

.step-lbl {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--blue);
}

.step-line {
  width: clamp(40px, 10vw, 100px);
  height: 2px;
  background: linear-gradient(90deg, rgba(44,52,128,0.4), rgba(44,52,128,0.1));
  margin-bottom: 22px;
}

/* Form card */
.form-card {
  background: var(--white);
  border-radius: var(--r);
  padding: clamp(24px, 5vw, 48px);
  box-shadow: var(--shadow);
  border: 1px solid rgba(44,52,128,0.07);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-group label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--blue);
}

.field-group input,
.field-group select {
  padding: 12px 16px;
  border: 1.5px solid #dde1f0;
  border-radius: 10px;
  font-family: var(--font-ar);
  font-size: 0.97rem;
  color: var(--dark);
  background: var(--light);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.field-group input:focus,
.field-group select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(44,52,128,0.1);
  background: var(--white);
}

.field-group input.err-field { border-color: var(--red); }

.ferr {
  font-size: 0.75rem;
  color: var(--red);
  font-weight: 500;
  min-height: 16px;
}

.req { color: var(--red); }

/* Consent */
.consent-row {
  background: #f0f4ff;
  border: 1px solid rgba(44,52,128,0.12);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 28px;
}

.check-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.check-wrap input[type="checkbox"] { display: none; }

.chk {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border: 2px solid var(--blue);
  border-radius: 6px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: all 0.2s;
}

.check-wrap input:checked ~ .chk {
  background: var(--blue);
  border-color: var(--blue);
}

.check-wrap input:checked ~ .chk::after {
  content: '✓';
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 700;
}

.check-text {
  font-size: 0.9rem;
  color: var(--dark);
  line-height: 1.6;
}

/* Buttons */
.btn-row {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 30px;
  border-radius: 50px;
  font-family: var(--font-ar);
  font-size: 0.97rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: transform 0.22s, box-shadow 0.22s, background 0.22s;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: var(--white);
  box-shadow: 0 4px 16px rgba(226,26,35,0.35);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(226,26,35,0.45); }

.btn-secondary {
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(44,52,128,0.28);
}

.btn-secondary:hover { transform: translateY(-2px); background: var(--blue-dark); }

.btn-outline {
  background: transparent;
  color: var(--blue);
  border: 2px solid var(--blue);
}

.btn-outline:hover { background: var(--blue); color: var(--white); }

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(16,185,129,0.3);
}

.btn-success:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16,185,129,0.4); }

.btn-outline-sm {
  padding: 8px 22px;
  font-size: 0.85rem;
  background: transparent;
  color: var(--blue);
  border: 1.5px solid var(--blue);
  border-radius: 50px;
  cursor: pointer;
  font-family: var(--font-ar);
  font-weight: 600;
  transition: all 0.2s;
}

.btn-outline-sm:hover { background: var(--blue); color: var(--white); }

/* ===========================
   SIGNATURE PAD
   =========================== */
.sig-hint {
  text-align: center;
  font-size: 0.97rem;
  color: var(--dark);
  margin-bottom: 4px;
}

.sig-hint-en {
  text-align: center;
  font-size: 0.8rem;
  color: var(--gray);
  font-family: var(--font-en);
  margin-bottom: 18px;
}

.sig-box {
  position: relative;
  border: 2px dashed rgba(200,169,110,0.6);
  border-radius: var(--r);
  background: #0d3b7a;
  overflow: hidden;
  margin-bottom: 14px;
}

.sig-watermark {
  color: rgba(255,255,255,0.2) !important;
}

#signatureCanvas {
  display: block;
  width: 100%;
  height: 200px;
  cursor: crosshair;
  touch-action: none;
}

.sig-watermark {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(44,52,128,0.2);
  font-size: 0.82rem;
  pointer-events: none;
  white-space: nowrap;
}

.sig-clear-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 28px;
}

/* ===========================
   CERTIFICATE
   =========================== */
.cert-card { text-align: center; }

.cert-title {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 4px;
}

.cert-sub {
  color: var(--gray);
  font-family: var(--font-en);
  font-size: 0.82rem;
  margin-bottom: 24px;
}

.cert-wrap {
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
  margin-bottom: 28px;
  background: #0d3b7a;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

#certCanvas {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 9/16;
}

.cert-btn-row { justify-content: center; }

/* ===========================
   SUCCESS
   =========================== */
.success-card {
  background: var(--white);
  border-radius: var(--r);
  padding: clamp(36px, 7vw, 72px) clamp(24px, 5vw, 56px);
  text-align: center;
  box-shadow: var(--shadow);
  max-width: 620px;
  margin: 0 auto;
}

.success-check {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: var(--white);
  font-size: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 8px 32px rgba(16,185,129,0.35);
  animation: pop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

.success-card h3 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 4px;
}

.success-en {
  color: var(--gray);
  font-family: var(--font-en);
  font-size: 0.88rem;
  margin-bottom: 12px;
}

.success-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--red);
  margin-bottom: 20px;
}

.success-msg {
  font-size: 0.97rem;
  line-height: 1.9;
  color: var(--dark);
  margin-bottom: 32px;
}

.success-btns {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===========================
   COUNTER
   =========================== */
.counter-section {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  padding: clamp(48px, 8vh, 80px) 20px;
}

.counter-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
}

.counter-item {
  flex: 1;
  min-width: 160px;
  text-align: center;
  padding: 20px 16px;
}

.counter-num {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 900;
  color: var(--gold-lt);
  line-height: 1;
  margin-bottom: 8px;
}

.counter-lbl-ar {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}

.counter-lbl-en {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  font-family: var(--font-en);
}

.counter-div {
  width: 1px;
  height: 72px;
  background: rgba(255,255,255,0.15);
  flex-shrink: 0;
}

/* ===========================
   FOOTER
   =========================== */
.site-footer {
  background: var(--dark);
  color: var(--white);
  padding: clamp(32px, 5vh, 56px) 20px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 32px;
  flex-wrap: wrap;
}

.footer-logo {
  height: 64px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.85;
}

.footer-text p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.7;
}

.footer-en {
  font-family: var(--font-en);
  font-size: 0.78rem !important;
  color: rgba(255,255,255,0.4) !important;
}

.footer-flag {
  height: 36px;
  width: auto;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 18px 0;
  text-align: center;
}

.footer-bottom p {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
}

/* ===========================
   UTILITIES
   =========================== */
.hidden { display: none !important; }

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 768px) {
  /* Header */
  .header-inner { padding: 10px 14px; }
  .header-logo-img { height: 40px; }
  .header-flag { height: 26px; }

  /* Hero */
  .hero { gap: 24px; padding: 32px 16px 40px; }
  .hero-photo-frame { width: clamp(200px, 60vw, 280px); }
  .hero-heading { font-size: clamp(1.5rem, 5vw, 2rem); }

  /* Pledge */
  .pledge-body { border-right: none; border-top: 4px solid var(--blue); padding-right: 0; padding-top: 20px; }
  .pledge-en-text { border-right: none; border-top: 4px solid var(--gold); padding-right: 0; padding-top: 20px; }

  /* Form grid → 1 col */
  .form-grid { grid-template-columns: 1fr; gap: 16px; }

  /* Steps */
  .step-line { width: 30px; }

  /* Buttons */
  .btn-row { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
  .btn-outline-sm { width: auto; }

  /* Counter */
  .counter-div { display: none; }
  .counter-grid { gap: 4px; }
  .counter-item { min-width: 120px; }

  /* Footer */
  .footer-inner { flex-direction: column; text-align: center; align-items: center; }
  .footer-flag-wrap { display: none; }
}

@media (max-width: 480px) {
  .hero-photo-frame { width: clamp(160px, 60vw, 220px); }
  .pledge-card { padding: 20px 16px; }
  .form-card { padding: 20px 16px; }
  .cert-btn-row { flex-direction: column; align-items: center; }
  .success-card { padding: 32px 16px; }
}

@media (max-width: 360px) {
  .steps-bar { gap: 2px; }
  .step-num { width: 36px; height: 36px; font-size: 0.85rem; }
  .step-line { width: 16px; }
}
