/* RJGC E-Services - Main Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@200;300;400;500;700;800;900&display=swap');

:root {
  --primary: #1a3a6b;
  --primary-dark: #102444;
  --accent: #c8a84b;
  --accent-light: #f0d98c;
  --bg: #f0f4fa;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #d1dae8;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #0284c7;
  --radius: 10px;
  --shadow: 0 4px 20px rgba(26, 58, 107, .12);
  --shadow-lg: 0 8px 40px rgba(26, 58, 107, .18);
}

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

body {
  font-family: 'Tajawal', sans-serif;
  direction: rtl;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

/* ========== NAVBAR ========== */
.navbar {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 20px rgba(0, 0, 0, .3);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  text-decoration: none;
}

.navbar-brand .logo-text {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}

.navbar-brand .logo-sub {
  font-size: 12px;
  opacity: .8;
  font-weight: 400;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.navbar-nav a {
  color: rgba(255, 255, 255, .85);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  transition: all .2s;
}

.navbar-nav a:hover {
  background: rgba(255, 255, 255, .15);
  color: white;
}

.navbar-nav .btn-outline-light {
  border: 1.5px solid rgba(255, 255, 255, .5);
  color: white;
  padding: 7px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s;
}

.navbar-nav .btn-outline-light:hover {
  background: rgba(255, 255, 255, .2);
  border-color: white;
}

/* ========== HERO ========== */
.hero {
  background: linear-gradient(160deg, var(--primary) 0%, #2a5298 60%, var(--primary-dark) 100%);
  color: white;
  padding: 60px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 900;
  margin-bottom: 14px;
  position: relative;
}

.hero p {
  font-size: 1.1rem;
  opacity: .85;
  max-width: 600px;
  margin: 0 auto 30px;
  position: relative;
}

.hero .hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  position: relative;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 8px;
  font-family: 'Cairo', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all .2s;
}

.btn-primary {
  background: var(--accent);
  color: var(--primary-dark);
}

.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(200, 168, 75, .4);
}

.btn-secondary {
  background: rgba(255, 255, 255, .15);
  color: white;
  border: 1.5px solid rgba(255, 255, 255, .4);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, .25);
}

.btn-dark {
  background: var(--primary);
  color: white;
}

.btn-dark:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #15803d;
}

.btn-sm {
  padding: 7px 16px;
  font-size: 13px;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* ========== CONTAINER ========== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 50px 0;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 8px;
}

.section-sub {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 15px;
}

/* ========== SERVICE CARDS ========== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.service-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  overflow: hidden;
  transition: all .25s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.service-card-icon {
  background: linear-gradient(135deg, var(--primary) 0%, #2a5298 100%);
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.service-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.service-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  line-height: 1.5;
}

.service-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  flex: 1;
}

.service-card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.service-card-footer .price {
  color: var(--success);
  font-weight: 700;
}

.service-card-footer .arrow {
  color: var(--primary);
  font-size: 18px;
}

/* ========== FORM ========== */
.form-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.form-card-header {
  background: linear-gradient(135deg, var(--primary) 0%, #2a5298 100%);
  color: white;
  padding: 24px 30px;
}

.form-card-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
}

.form-card-header p {
  font-size: 14px;
  opacity: .85;
  margin-top: 4px;
}

.form-card-body {
  padding: 30px;
}

.form-group {
  margin-bottom: 22px;
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 7px;
  font-size: 14px;
}

.form-label .required {
  color: var(--danger);
  margin-right: 3px;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: white;
  transition: border-color .2s, box-shadow .2s;
  direction: rtl;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 58, 107, .1);
}

.form-control:disabled {
  background: #f5f5f5;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%231a3a6b' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  padding-left: 35px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
}

.form-section {
  border-top: 2px solid var(--bg);
  margin-top: 28px;
  padding-top: 22px;
}

.form-section-title {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 18px;
  font-size: 15px;
}

/* ========== PRICE BOX ========== */
.price-box {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  border: 2px solid #a5d6a7;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 20px 0;
  display: none;
}

.price-box.show {
  display: block;
}

.price-box .price-label {
  font-size: 13px;
  color: #2e7d32;
  font-weight: 600;
}

.price-box .price-amount {
  font-size: 2rem;
  font-weight: 900;
  color: #1b5e20;
}

.price-box .price-currency {
  font-size: 14px;
  color: #2e7d32;
  margin-right: 4px;
}

.price-box.free {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border-color: #90caf9;
}

.price-box.free .price-label,
.price-box.free .price-amount {
  color: #0d47a1;
}

/* ========== ALERTS ========== */
.alert {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success {
  background: #dcfce7;
  color: #166534;
  border-right: 4px solid var(--success);
}

.alert-danger {
  background: #fee2e2;
  color: #991b1b;
  border-right: 4px solid var(--danger);
}

.alert-info {
  background: #dbeafe;
  color: #1e40af;
  border-right: 4px solid var(--info);
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
  border-right: 4px solid var(--warning);
}

/* ========== TABLE ========== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

thead {
  background: var(--primary);
  color: white;
}

th {
  padding: 14px 16px;
  text-align: right;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #f8faff;
}

/* ========== BADGES ========== */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
}

.badge-success {
  background: #dcfce7;
  color: #166534;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-info {
  background: #dbeafe;
  color: #1e40af;
}

.badge-secondary {
  background: #f1f5f9;
  color: #475569;
}

/* ========== STATS ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border-right: 4px solid var(--primary);
  text-align: center;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ========== MISC ========== */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.mb-4 {
  margin-bottom: 24px;
}

.text-muted {
  color: var(--text-muted);
}

.text-center {
  text-align: center;
}

.d-flex {
  display: flex;
}

.align-items-center {
  align-items: center;
}

.justify-content-between {
  justify-content: space-between;
}

.gap-3 {
  gap: 12px;
}

.mt-2 {
  margin-top: 8px;
}

.mt-4 {
  margin-top: 24px;
}

/* ========== AUTH ========== */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 100%);
  padding: 20px;
}

.auth-card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}

.auth-card .auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.auth-card .auth-logo h1 {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--primary);
  margin-top: 12px;
}

.auth-card .auth-logo p {
  font-size: 13px;
  color: var(--text-muted);
}

.divider {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin: 16px 0;
  position: relative;
}

.divider::before,
.divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--border);
}

.divider::before {
  right: 0;
}

.divider::after {
  left: 0;
}

/* ========== FOOTER ========== */
footer {
  background: var(--primary-dark);
  color: rgba(255, 255, 255, .7);
  text-align: center;
  padding: 24px;
  font-size: 13px;
  margin-top: 60px;
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

/* ========== INFO BOX ========== */
.info-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 13px;
  color: #1e40af;
  margin-bottom: 20px;
  line-height: 1.8;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .navbar {
    height: auto;
    padding: 12px 14px;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    position: relative;
  }

  .navbar-brand {
    justify-content: center;
  }

  .navbar-nav {
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
  }

  .navbar-nav a {
    padding: 6px 12px;
    font-size: 13px;
  }

  .hero {
    padding: 40px 16px;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .hero p {
    font-size: 0.95rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .form-card-body {
    padding: 18px 16px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card {
    padding: 16px 10px;
  }

  .stat-card .stat-value {
    font-size: 1.5rem;
  }

  .cart-page {
    grid-template-columns: 1fr;
  }

  .mgr-grid {
    grid-template-columns: 1fr !important;
  }

  .disc-grid {
    grid-template-columns: 1fr !important;
  }

  .table-wrap,
  .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 8px;
  }

  table {
    font-size: 13px;
  }

  th,
  td {
    padding: 10px 12px;
  }
}

/* ========== LOADING ========== */
.loading {
  display: none;
  text-align: center;
  padding: 30px;
  color: var(--primary);
}

.spinner {
  border: 3px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}