/* ==========================================================================
   Stepper + Callout
   ========================================================================== */

/* ---------- Stepper ---------- */
/* الشكل يتحدد بعرض المساحة اللي فيها الخطوات (container query) مو بعرض الشاشة */
.ui-stepper-wrap {
  container-type: inline-size;
}

.ui-stepper {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ui-stepper__step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  line-height: var(--leading-xs);
  color: var(--color-text-muted);
}

.ui-stepper__num {
  display: inline-grid;
  place-items: center;
  inline-size: 2rem;
  block-size: 2rem;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--color-surface-muted);
  color: var(--color-text-subtle);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
}

.ui-stepper__step.is-done .ui-stepper__num {
  background: var(--color-primary);
  color: var(--color-on-primary);
}

.ui-stepper__step.is-current .ui-stepper__num {
  background: var(--color-secondary);
  color: var(--gray-0);
  box-shadow: 0 0 0 4px var(--color-secondary-subtle);
}

/* مرحلة انرفضت (مثل رفض الموارد البشرية) */
.ui-stepper__step.is-rejected .ui-stepper__num {
  background: var(--color-danger);
  color: var(--gray-0);
}

.ui-stepper__step.is-rejected .ui-stepper__label {
  font-weight: var(--weight-bold);
  color: var(--color-danger);
}

.ui-stepper__step.is-current .ui-stepper__label {
  font-weight: var(--weight-bold);
  color: var(--color-text);
}

/* أفقي لما تكون المساحة 36rem أو أكثر: خط بين كل خطوتين */
@container (min-width: 36rem) {
  .ui-stepper {
    flex-direction: row;
    align-items: center;
    gap: var(--space-3);
  }

  .ui-stepper__step {
    flex: 1;
    min-inline-size: 0;
  }

  .ui-stepper__step:last-child {
    flex: 0 0 auto;
  }

  .ui-stepper__label {
    white-space: nowrap;
  }

  /* الخط الواصل للخطوة التالية */
  .ui-stepper__step:not(:last-child)::after {
    content: "";
    flex: 1;
    min-inline-size: var(--space-4);
    block-size: 2px;
    border-radius: var(--radius-full);
    background: var(--color-border);
  }

  .ui-stepper__step.is-done:not(:last-child)::after {
    background: var(--color-primary);
  }
}

/* ---------- Callout ---------- */
.ui-callout {
  --tone: var(--color-info);
  --tone-bg: var(--color-info-subtle);
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--tone-bg);
  color: var(--tone);
  font-size: var(--text-xs);
  line-height: var(--leading-xs);
}

.ui-callout--warning { --tone: var(--orange-800); --tone-bg: var(--color-secondary-subtle); }
.ui-callout--danger  { --tone: var(--red-700);    --tone-bg: var(--color-danger-subtle); }
.ui-callout--success { --tone: var(--green-700);  --tone-bg: var(--color-success-subtle); }

.ui-callout__text {
  flex: 1;
  margin: 0;
}

.ui-callout__help {
  display: inline-flex;
  color: inherit;
  opacity: .8;
}

.ui-callout__help:hover {
  color: inherit;
  opacity: 1;
}

/* ---------- Request tracker (widget) ---------- */
.ui-tracker__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.ui-tracker__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
