@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap");

:root {
  /* DGA-inspired tokens for the static Bootstrap layer. */
  --font-primary: "IBM Plex Sans Arabic", "IBMPlexSansArabic", "Segoe UI", Tahoma, Arial, sans-serif;
  --text-default: #161616;
  --text-primary-paragraph: #384250;
  --text-display: #1f2a37;
  --text-oncolor-primary: #ffffff;
  --background-neutral-50: #f9fafb;
  --background-white: #ffffff;
  --border-neutral-primary: #d2d6db;
  --border-neutral-secondary: #e5e7eb;
  --colors-base-black: #161616;
  --colors-base-white: #ffffff;
  --colors-green-900: #085d3a;
  --colors-green-800: #067647;
  --colors-green-700: #079455;
  --colors-green-50: #ecfdf3;
  --colors-blue-700: #1849a9;
  --colors-blue-50: #eff8ff;
  --colors-yellow-700: #93370d;
  --colors-yellow-50: #fffaeb;
  --colors-red-700: #912018;
  --colors-red-50: #fef3f2;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --spacing-md: 8px;
  --spacing-lg: 12px;
  --spacing-xl: 16px;
  --spacing-2xl: 20px;
  --spacing-3xl: 24px;
  --stepper-button-current: var(--colors-green-700);
  --stepper-button-completed: var(--colors-green-800);
  --stepper-button-upcomming: #9da4ae;
  --stepper-text-primary: var(--text-default);
  --stepper-text-secondary: var(--text-primary-paragraph);
  --tag-background-success-light: #ecfdf3;
  --tag-text-success: #085d3a;
  --tag-background-info-light: #eff8ff;
  --tag-text-info: #1849a9;
  --tag-background-warning-light: #fffaeb;
  --tag-text-warning: #93370d;
  --tag-background-error-light: #fef3f2;
  --tag-text-error: #912018;
  --tag-background-neutral-light: #f9fafb;
  --tag-text-neutral: #1f2a37;
  --dga-green-900: var(--colors-green-900);
  --dga-green-800: var(--colors-green-800);
  --dga-green-700: var(--colors-green-700);
  --dga-green-100: #d3f8df;
  --dga-green-50: var(--colors-green-50);
  --dga-gold: #b54708;
  --dga-ink: var(--text-default);
  --dga-muted: var(--text-primary-paragraph);
  --dga-border: var(--border-neutral-primary);
  --dga-surface: var(--background-white);
  --dga-soft: var(--background-neutral-50);
  --dga-focus: var(--colors-base-black);
}

html[lang="en"] {
  --font-primary: "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  
  color: var(--dga-ink);
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

a,
button {
  outline-offset: 4px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--dga-focus);
}

.skip-link {
  position: absolute;
  inset-block-start: 1rem;
  inset-inline-start: 1rem;
  z-index: 20;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--dga-ink);
  color: #fff;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Hero */
.app-header {
  padding: 1.5rem 0 0;
}

.app-header-card {
  background-color: var(--dga-green-900);
  background-image: linear-gradient(135deg, rgba(8, 93, 58, 0.98), rgba(6, 118, 71, 0.94));
  border-radius: var(--radius-md);
  box-shadow: 0 18px 44px rgba(17, 24, 39, 0.12);
  color: #fff;
  padding: clamp(2rem, 5vw, 4.75rem) clamp(1.25rem, 4vw, 3rem) 2rem;
}

.header-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: end;
}

.header-layout > * {
  min-width: 0;
}

.header-actions {
  display: flex;
  justify-content: flex-end;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  min-width: 7.5rem;
  padding: 0.65rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-oncolor-primary);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.language-switch:hover,
.language-switch:focus-visible {
  border-color: var(--colors-base-white);
  background: var(--colors-base-white);
  color: var(--dga-green-900);
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: #d8f5e3;
  font-weight: 700;
}

.app-header h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.document-shell {
  padding: 2rem 0 3rem;
}

/* Wizard navigation */
.wizard-nav {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding: 0.5rem 0.25rem 0.75rem;
  scroll-snap-type: x mandatory;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.wizard-step {
  position: relative;
  flex: 1 0 9rem;
  min-width: 0;
  min-height: 5.5rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--stepper-text-secondary);
  text-align: start;
  padding: 0;
  display: flex;
  align-items: flex-start;
  scroll-snap-align: start;
  transition: color 160ms ease;
}

.wizard-step:hover {
  color: var(--stepper-text-primary);
}

.wizard-step.is-active {
  color: var(--stepper-text-primary);
}

.progress-indicator__step-content {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: var(--spacing-md);
  min-width: 0;
  width: 100%;
  padding-inline: var(--spacing-md);
}

.step-index,
.step-label .step-label--circle {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  font: 500 16px/24px var(--font-primary);
}

.step-label .step-label--circle {
  border: 2px solid var(--stepper-button-upcomming);
  color: var(--stepper-button-upcomming);
  background: var(--background-white);
}

.step-label[data-state="current"] .step-label--circle {
  border-color: var(--stepper-button-current);
  color: var(--stepper-button-current);
}

.step-label[data-state="completed"] .step-label--circle {
  border-color: var(--stepper-button-completed);
  background: var(--stepper-button-completed);
  color: var(--text-oncolor-primary);
}

.step-text {
  display: block;
  color: var(--stepper-text-primary);
  font: 500 16px/24px var(--font-primary);
  min-width: 0;
  text-align: center;
  overflow-wrap: anywhere;
}

.progress-indicator__step-connector {
  position: absolute;
  inset-block-start: 16px;
  inset-inline-start: calc(50% + 16px);
  width: calc(100% - 32px);
  height: 2px;
  background: var(--stepper-button-upcomming);
}

.wizard-step:last-child .progress-indicator__step-connector {
  display: none;
}

.progress-indicator__step-connector--active {
  background: var(--stepper-button-current);
}

.wizard-content {
  background: var(--dga-surface);
  border: 1px solid var(--dga-border);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 44px rgba(17, 24, 39, 0.07);
}

.wizard-panel {
  padding: clamp(1.25rem, 3vw, 2.5rem);
}

.wizard-panel[hidden] {
  display: none;
}

/* Document content */
.panel-kicker {
  color: var(--dga-green-700);
  font: 600 14px/20px var(--font-primary);
  margin-bottom: 0.4rem;
}

.wizard-panel>h1 {
  margin: 0;
  font: 600 clamp(1.65rem, 3vw, 2.25rem)/1.25 var(--font-primary);
  letter-spacing: 0;
}

.panel-intro {
  margin: 0.75rem 0 1.75rem;
  color: var(--text-primary-paragraph);
  font: 400 18px/28px var(--font-primary);
}

.document-section {
  padding-block: 1.35rem;
  border-top: 1px solid var(--dga-border);
}

.document-section h2 {
  display: flex;
  align-items: center;
  position: relative;
  min-height: 2.75rem;
  margin: 0 0 1rem;
  padding-block: 0.45rem;
  color: var(--text-display);
  font: 600 clamp(1.25rem, 2vw, 1.5rem)/1.25 var(--font-primary);
  letter-spacing: 0;
}

.document-section p {
  margin: 0 0 0.85rem;
  color: var(--text-primary-paragraph);
  font: 400 16px/24px var(--font-primary);
}

.content-list {
  display: grid;
  gap: 0.45rem;
  margin: 0.25rem 0 1rem;
  padding-inline-start: 1.4rem;
  list-style-position: outside;
}

.content-list li::marker {
  color: var(--text-default);
  font-size: 1.2em;
}

.document-table-wrap {
  margin: 1rem 0 1.35rem;
  border: 1px solid var(--dga-border);
  border-radius: var(--radius-md);
  background: var(--background-white);
}

.document-table {
  min-width: 44rem;
  max-width: 100%;
  margin: 0;
  font-size: 0.95rem;
}

.document-table thead th {
  padding-block: 0.85rem;
  line-height: 1.35;
  background: var(--background-neutral-50);
  color: var(--text-default);
  border-color: var(--border-neutral-secondary);
  font-weight: 600;
  vertical-align: middle;
}

.document-table tbody td {
  border-color: var(--dga-border);
  color: var(--text-primary-paragraph);
  vertical-align: top;
}

.document-table tbody tr:nth-child(even) td {
  background: var(--background-neutral-50);
}

.document-table .table-index-cell {
  width: 4rem;
  color: var(--text-default);
  font-weight: 600;
  text-align: center;
  vertical-align: middle;
}

.electronic-services-table thead th:nth-child(n + 3):nth-child(-n + 5),
.electronic-services-table tbody td:nth-child(n + 3):nth-child(-n + 5) {
  text-align: center;
}

.priority-matrix-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.35rem;
  border: 1px solid var(--dga-border);
  border-radius: var(--radius-md);
  background: var(--dga-surface);
}

.priority-matrix {
  width: 100%;
  min-width: 42rem;
  border-collapse: separate;
  border-spacing: 0;
  text-align: center;
}

.priority-matrix th,
.priority-matrix td {
  padding: 1rem;
  border-inline-start: 1px solid var(--dga-border);
  border-block-start: 1px solid var(--dga-border);
  vertical-align: middle;
}

.priority-matrix thead th {
  border-block-start: 0;
  background: var(--background-neutral-50);
  color: var(--text-default);
  font-weight: 600;
}

.priority-matrix th:first-child,
.priority-matrix td:first-child {
  border-inline-start: 0;
}

.priority-matrix tbody th {
  background: var(--background-neutral-50);
  color: var(--text-default);
  font-weight: 600;
  text-align: start;
}

.priority-badge,
.unavailable-pill {
  min-width: 7rem;
  min-height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: var(--radius-full);
  padding: 0 var(--spacing-xl);
  font: 500 14px/20px var(--font-primary);
  line-height: 1.2;
}

.priority-urgent {
  background: var(--tag-background-error-light);
  color: var(--tag-text-error);
  border: 1px solid transparent;
}

.priority-high {
  background: var(--tag-background-warning-light);
  color: var(--tag-text-warning);
  border: 1px solid transparent;
}

.priority-medium {
  background: var(--tag-background-info-light);
  color: var(--tag-text-info);
  border: 1px solid transparent;
}

.priority-low {
  background: var(--tag-background-success-light);
  color: var(--tag-text-success);
  border: 1px solid transparent;
}

.unavailable-pill {
  background: var(--tag-background-neutral-light);
  color: var(--tag-text-neutral);
  border: 1px dashed var(--border-neutral-primary);
  cursor: not-allowed;
}

.unavailable-pill span {
  width: 1.45rem;
  height: 1.45rem;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-full);
  background: var(--border-neutral-primary);
  color: var(--text-primary-paragraph);
  font: 700 0.9rem/1 Arial, sans-serif;
}

.unavailable-pill.unavailable-icon {
  min-width: 0;
  width: auto;
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  gap: 0;
}

.unavailable-pill.unavailable-icon span {
  width: 1.45rem;
  height: 1.45rem;
}

.document-end-note {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  background: var(--dga-green-50);
  color: var(--dga-green-900);
  font-weight: 600;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

.wizard-actions .btn {
  min-width: 8rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.btn-success {
  --bs-btn-bg: var(--colors-green-800);
  --bs-btn-border-color: var(--colors-green-800);
  --bs-btn-hover-bg: var(--colors-green-900);
  --bs-btn-hover-border-color: var(--colors-green-900);
}

.btn-outline-success {
  --bs-btn-color: var(--colors-green-800);
  --bs-btn-border-color: var(--colors-green-800);
  --bs-btn-hover-bg: var(--colors-green-800);
  --bs-btn-hover-border-color: var(--colors-green-800);
}

.step-status {
  color: var(--dga-muted);
  font-weight: 600;
}

/* Responsive stack for phones */
@media (max-width: 767.98px) {
  .app-header-card {
    padding: 1.75rem 1.25rem;
  }

  .app-header h1 {
    font-size: clamp(1.8rem, 8vw, 2.15rem);
  }

  .header-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .header-actions {
    justify-content: flex-start;
  }

  html[dir="rtl"] .app-header > .container,
  html[dir="rtl"] .document-shell > .container {
    direction: ltr;
  }

  html[dir="rtl"] .wizard-content,
  html[dir="rtl"] .wizard-actions {
    direction: rtl;
  }

  html[dir="rtl"] .app-header-card,
  html[dir="rtl"] .wizard-nav {
    direction: ltr;
  }

  html[dir="rtl"] .app-header-card {
    padding: 1.75rem 1.25rem;
  }

  html[dir="rtl"] .header-layout > :first-child,
  html[dir="rtl"] .wizard-nav .step-text {
    direction: rtl;
    text-align: right;
  }

  html[dir="rtl"] .header-layout > :first-child {
    text-align: center;
  }

  html[dir="rtl"] .app-header h1 {
    font-size: clamp(1.35rem, 6.4vw, 1.55rem);
    line-height: 1.35;
  }

  html[dir="rtl"] .wizard-nav .step-text {
    text-align: left;
  }

  html[dir="rtl"] .header-actions {
    justify-content: center;
  }

  .wizard-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow-x: visible;
    padding: 0;
    scroll-snap-type: none;
  }

  .wizard-step {
    flex: 0 0 auto;
    width: 100%;
    min-height: 4.5rem;
    scroll-snap-align: none;
  }

  .progress-indicator__step-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    gap: var(--spacing-md);
    padding: 0.5rem var(--spacing-md);
  }

  html[dir="rtl"] .progress-indicator__step-content {
    flex-direction: row;
    padding: 0.5rem var(--spacing-md);
  }

  .step-text {
    flex: 1 1 auto;
    text-align: start;
  }

  .progress-indicator__step-connector {
    inset-block-start: calc(0.5rem + 32px);
    inset-inline-start: calc(var(--spacing-md) + 15px);
    width: 2px;
    height: calc(100% - 32px);
  }

  html[dir="rtl"] .progress-indicator__step-connector {
    inset-inline-start: calc(var(--spacing-md) + 15px);
    inset-inline-end: auto;
  }

  .wizard-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .wizard-actions .btn {
    flex: 1 1 8rem;
  }

  .step-status {
    flex: 1 0 100%;
    text-align: center;
    order: -1;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .app-header {
    padding: 0 0 1rem;
  }

  .app-header-card {
    background: #fff;
    box-shadow: none;
    color: #000;
    padding: 0;
  }

  .panel-intro,
  .panel-kicker {
    color: #000;
  }

  .wizard-nav,
  .wizard-actions,
  .skip-link {
    display: none !important;
  }

  .document-shell {
    padding: 0;
  }

  .wizard-content {
    border: 0;
    box-shadow: none;
  }

  .wizard-panel,
  .wizard-panel[hidden] {
    display: block !important;
    padding: 0 0 1rem;
    break-after: page;
  }

  .document-section {
    break-inside: avoid;
  }

  .document-table {
    min-width: 0;
    font-size: 0.8rem;
  }

  .document-table thead th {
    background: #e8e8e8 !important;
    color: #000 !important;
  }

  .priority-matrix {
    min-width: 0;
  }

  .priority-matrix thead th {
    background: #e8e8e8 !important;
    color: #000 !important;
  }
}
