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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #0f172a, #020617 55%);
  color: #f9fafb;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  padding: 0 16px;
}

/* NAV */

.nav {
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  backdrop-filter: blur(16px);
  background: linear-gradient(to bottom, rgba(15,23,42,0.9), rgba(15,23,42,0.6));
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #e5e7eb;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.logo {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: conic-gradient(from 180deg, #22c55e, #0ea5e9, #6366f1, #22c55e);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.8);
}

/* Language switcher */

.lang-switcher {
  display: inline-flex;
  gap: 6px;
}

.lang-switcher a {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 13px;
  color: #cbd5f5;
  opacity: 0.8;
}

.lang-switcher a:hover {
  opacity: 1;
}

.lang-switcher a.active {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
  color: #bbf7d0;
}

/* HERO */

.hero {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 32px 0 40px;
  text-align: center;
}

.hero-inner {
  display: grid;
  gap: 15px;
  align-items: center;
}

.hero-text h1 {
  font-size: clamp(32px, 4vw, 40px);
  line-height: 1.1;
  margin-bottom: 12px;
}

.hero-text .subtitle {
  color: #9ca3af;
  font-size: 15px;
  max-width: 420px;
  margin-bottom: 14px;
}

/* Buttons */

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  font-size: x-large;
}

.btn-primary {
  background: linear-gradient(135deg, #22c55e, #0ea5e9);
  color: #0b1120;
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.35);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

.btn-secondary {
  margin-top: 8px;
  background: transparent;
  border: 1px solid #4b5563;
  color: #e5e7eb;
}

/* Results Card */

.results-card {
  border-radius: 20px;
  padding: 18px 18px 16px;
  background: radial-gradient(circle at top left, rgba(34,197,94,0.21), rgba(15,23,42,0.95));
  border: 1px solid rgba(148, 163, 184, 0.4);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 260px;
}

.metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(15,23,42, 0.8);
}

.metric .label {
  font-size: 14px;
  color: #9ca3af;
}

.metric .value {
  font-size: 22px;
  font-weight: 600;
}

.metric .unit {
  font-size: 13px;
  color: #9ca3af;
}

/* Live box */

.live-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #e5e7eb;
  font-size: 12px;
  margin-bottom: 6px;
}

.live-box #liveCount {
  font-weight: 600;
  font-size: 14px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.15);
}

.live-box .live-text {
  opacity: 0.85;
}

/* Client info */

.client-info {
  margin-top: 6px;
  font-size: 12px;
  color: #9ca3af;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.client-info strong {
  color: #e5e7eb;
}

/* Progress Bar */

.progress-wrapper {
  width: 100%;
  
  margin: 10px 0 14px;
}

.progress-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.progress-title {
  font-size: 12px;
  color: #9ca3af;
}

.progress-percent {
  font-size: 12px;
  color: #e5e7eb;
}

.progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  overflow: hidden;
  border: 1px solid rgba(55, 65, 81, 0.9);
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #0ea5e9);
  transition: width 0.15s linear;
}

.progress-phase {
  margin-top: 4px;
  font-size: 11px;
  color: #9ca3af;
}

/* Quality */

.quality-row {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 380px;
}

.quality-tip {
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.4;
}

/* Grade badge + ألوان */

.grade-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 0 12px rgba(148, 163, 184, 0.2);
}

/* ممتاز - أخضر */
.grade-excellent {
  border: 1px solid rgba(34, 197, 94, 0.6);
  background: radial-gradient(circle at top left, rgba(34,197,94,0.22), rgba(15,23,42,0.98));
  color: #bbf7d0;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.4);
}

/* جيد - أزرق مخلوط أخضر */
.grade-good {
  border: 1px solid rgba(56, 189, 248, 0.6);
  background: radial-gradient(circle at top left, rgba(56,189,248,0.18), rgba(15,23,42,0.98));
  color: #e0f2fe;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}

/* متوسط - برتقالي */
.grade-fair {
  border: 1px solid rgba(249, 115, 22, 0.7);
  background: radial-gradient(circle at top left, rgba(249,115,22,0.18), rgba(15,23,42,0.98));
  color: #fed7aa;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.35);
}

/* ضعيف - أحمر */
.grade-poor {
  border: 1px solid rgba(248, 113, 113, 0.8);
  background: radial-gradient(circle at top left, rgba(248,113,113,0.25), rgba(15,23,42,0.98));
  color: #fee2e2;
  box-shadow: 0 0 14px rgba(248, 113, 113, 0.45);
}

/* Meta card (معلومات الاتصال) */

.meta-card {
  margin-top: 16px;
  background: radial-gradient(circle at top left, rgba(96,165,250,0.18), rgba(15,23,42,0.96));
}

.meta-header {
  font-size: 13px;
  font-weight: 600;
  color: #e5e7eb;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  padding-bottom: 4px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
}

.meta-label {
  color: #9ca3af;
}

.meta-value {
  color: #e5e7eb;
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.meta-note {
  margin-top: 6px;
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.4;
}

/* Footer */

.footer {
  border-top: 1px solid rgba(31, 41, 55, 0.9);
  padding: 12px 0 16px;
  font-size: 13px;
  color: #6b7280;
}

/* Responsive */

@media (max-width: 768px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
  }

  .hero-text .subtitle {
    margin-right: auto;
    margin-left: auto;
  }

  .results-card {
    margin: 0 auto;
  }

  .meta-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* RTL tweak */

body.lang-ar .hero-inner {
  direction: rtl;
}

body.lang-ar .metric {
  flex-direction: row-reverse;
}



#startBtn {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid #41c870;
}
#startText {
    color: #bbf7d0;
}

.lang-switcher select{
  background:#0f172a;
  border:1px solid #475569;
  color:#e2e8f0;
  padding:6px 10px;
  border-radius:6px;
  font-size:14px;
}
.lang-switcher{
  display:inline-block;
  margin-left:10px;
}
