:root {
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --background-body: #020617;
  --background-card: #020617;
  --border-color: rgba(148, 163, 184, 0.3);
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --radius-lg: 16px;
  --shadow-md: 0 18px 45px rgba(15,23,42,0.8);
}

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

body.bg-body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #020617 0, #020617 40%, #020617 100%);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

.site-header {
  border-bottom: 1px solid rgba(148,163,184,0.3);
  background: radial-gradient(circle at top, rgba(37,99,235,0.15), transparent);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.logo {
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text-primary);
  text-decoration: none;
}

.logo span {
  color: var(--primary-color);
}

.main-nav {
  display: flex;
  align-items: center;
}

.main-nav a {
  margin-left: 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
}

.main-nav a:hover {
  color: var(--primary-color);
}

.page-container {
  flex: 1;
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.page-title {
  font-size: 1.8rem;
  margin: 0 0 0.5rem;
}

.page-subtitle {
  margin: 0 0 2rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.card {
  background: linear-gradient(135deg, rgba(15,23,42,0.95), rgba(15,23,42,0.85));
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
}

.card h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
  background: rgba(15,23,42,0.75);
  color: var(--text-primary);
  outline: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary-color);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 15px 30px rgba(37,99,235,0.4);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-full {
  width: 100%;
}

.alert {
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.alert-error {
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.6);
  color: #fecaca;
}

.result-highlight {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-color);
}

.site-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  padding: 3rem 0 2rem;
  font-size: 0.95rem;
  color: #94a3b8;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  text-align: center;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.footer-inner > p:first-child {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.9;
  width: 100%;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 400px;
}

.footer-links a {
  display: block;
  padding: 0.9rem 1.5rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  text-decoration: none;
  color: #cbd5e1;
  font-weight: 500;
  transition: all 0.3s ease;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-links a:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  transform: translateY(-2px);
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: column;
    gap: 2rem;
  }

  .footer-links {
    flex-direction: row;
    gap: 1.5rem;
    width: auto;
    max-width: none;
  }

  .footer-links a {
    min-width: 120px;
  }
}

a {
  color: #60a5fa; 
  text-decoration: none;
  transition: all 0.25s ease;
}

a:hover {
  color: #93c5fd; 
  text-shadow: 0 0 6px rgba(147,197,253,0.6);
}

a:active {
  color: #2563eb; 
}

a:visited {
  color: #7dd3fc; 
}

/* =============== القائمة الأفقية في الجوال =============== */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .main-nav {
    display: flex;
    flex-wrap: nowrap;              /* مهم: لا تلتف للأسفل */
    overflow-x: auto;
    white-space: nowrap;
    gap: 0.75rem;
    padding: 0.75rem 0;
    scroll-behavior: smooth;
    width: 100%;
    background: rgba(2,6,23,0.6);
    border-top: 1px solid rgba(148,163,184,0.15);
    border-bottom: 1px solid rgba(148,163,184,0.15);
  }

  .main-nav a {
    flex: 0 0 auto;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.2s;
  }

  .main-nav a:hover {
    background: var(--primary-color);
    color: #fff;
  }

  /* إخفاء شريط التمرير */
  .main-nav::-webkit-scrollbar {
    display: none;
  }
  .main-nav {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
}


/* ===== روابط سريعة داخل الكروت ===== */
.quick-links {
  background: linear-gradient(135deg, rgba(15,23,42,0.97), rgba(15,23,42,0.9));
}

.quick-links h2 {
  color: #fff;
  margin-bottom: 1rem;
}

.link-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.link-list li {
  margin-bottom: 0.5rem;
}

.link-list a {
  display: block;
  color: #e5e7eb; /* رمادي فاتح مريح للقراءة */
  text-decoration: none;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.link-list a:hover {
  background: rgba(37, 99, 235, 0.15);
  color: #ffffff;
  transform: translateX(-3px);
}
