/* Hajj Badal — client portal design system */

@property --case-progress {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

:root {
  /* Brand palette */
  --hb-teal: #239ab4;
  --hb-teal-rgb: 35, 154, 180;
  --hb-magenta: #ed187b;
  --hb-magenta-rgb: 237, 24, 123;
  --hb-gold: #b8860b;
  --hb-gold-rgb: 184, 134, 11;
  --hb-cream: #eae8e0;
  --hb-cream-rgb: 234, 232, 224;

  /* Semantic tokens */
  --hb-bg: var(--hb-cream);
  --hb-bg-accent: #dedcd4;
  --hb-surface: #fafaf8;
  --hb-surface-elevated: #ffffff;
  --hb-primary: var(--hb-teal);
  --hb-primary-hover: #1e8ba3;
  --hb-primary-muted: rgba(var(--hb-teal-rgb), 0.1);
  --hb-highlight: var(--hb-magenta);
  --hb-highlight-hover: #c9146a;
  --hb-highlight-muted: rgba(var(--hb-magenta-rgb), 0.1);
  --hb-accent: var(--hb-gold);
  --hb-accent-soft: rgba(var(--hb-gold-rgb), 0.16);
  --hb-text: #1c2428;
  --hb-text-muted: #5c656b;
  --hb-border: rgba(28, 36, 40, 0.1);
  --hb-danger: #c41e56;
  --hb-success: #1a8496;
  --hb-radius: 14px;
  --hb-radius-sm: 10px;
  --hb-shadow: 0 4px 24px rgba(var(--hb-teal-rgb), 0.08);
  --hb-shadow-lg: 0 14px 44px rgba(var(--hb-teal-rgb), 0.12);
  --hb-font-display: "Cormorant Garamond", Georgia, serif;
  --hb-font-body: "DM Sans", system-ui, sans-serif;
  --hb-font-arabic: "El Messiri", "Noto Naskh Arabic", serif;
  --hb-nav-height: 72px;
  --hb-transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --hb-gradient-brand: linear-gradient(
    135deg,
    var(--hb-highlight) 0%,
    var(--hb-primary) 48%,
    var(--hb-accent) 100%
  );
}

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

html {
  scroll-behavior: smooth;
}

body.portal-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--hb-font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--hb-text);
  background-color: var(--hb-bg);
  background-image:
    radial-gradient(ellipse 110% 70% at 95% -15%, rgba(var(--hb-teal-rgb), 0.14), transparent 52%),
    radial-gradient(ellipse 70% 55% at -5% 105%, rgba(var(--hb-magenta-rgb), 0.08), transparent 48%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(var(--hb-gold-rgb), 0.1), transparent 55%);
  -webkit-font-smoothing: antialiased;
}

.portal-body .text-success {
  color: var(--hb-success) !important;
}

body.portal-body.rtl {
  font-family: var(--hb-font-arabic);
  direction: rtl;
}

.portal-shell {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

@media (min-width: 768px) {
  .portal-shell {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* —— Navigation —— */
/* Reset Bootstrap link styles inside the portal nav */
.portal-nav a {
  text-decoration: none !important;
}

.portal-nav a:hover,
.portal-nav a:focus-visible {
  text-decoration: none !important;
}

.portal-nav {
  position: relative;
  z-index: 100;
  margin-bottom: 1.75rem;
}

.portal-nav--app {
  position: sticky;
  top: 0;
  margin-bottom: 2rem;
  padding-top: 0.65rem;
  padding-bottom: 0.35rem;
  background: linear-gradient(180deg, var(--hb-bg) 70%, transparent);
}

.portal-nav__bar {
  position: relative;
  background: var(--hb-surface-elevated);
  border: 1px solid rgba(var(--hb-teal-rgb), 0.16);
  border-radius: calc(var(--hb-radius) + 4px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 10px 36px rgba(var(--hb-teal-rgb), 0.1);
  overflow: hidden;
}

.portal-nav__bar::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 4px;
  height: 100%;
  background: var(--hb-gradient-brand);
  border-radius: 4px 0 0 4px;
  opacity: 0.9;
}

.portal-nav--minimal .portal-nav__bar::before {
  opacity: 0.65;
}

.portal-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
  padding: 0.65rem 1rem 0.65rem 1.15rem;
}

.portal-nav__brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  color: var(--hb-text) !important;
  transition: opacity var(--hb-transition);
}

.portal-nav__brand:hover,
.portal-nav__brand:focus-visible {
  opacity: 0.9;
  color: var(--hb-text) !important;
}

.portal-nav__logo-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  line-height: 0;
}

.portal-nav__logo-wrap img,
.portal-nav__brand img,
.portal-nav__logo {
  display: block;
  width: auto;
  height: 2.35rem;
  max-width: 11rem;
  object-fit: contain;
  object-position: left center;
}

body.rtl .portal-nav__logo-wrap img,
body.rtl .portal-nav__logo {
  object-position: right center;
}

.portal-nav__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hb-highlight);
  background: var(--hb-highlight-muted);
  border: 1px solid rgba(var(--hb-magenta-rgb), 0.22);
  border-radius: 999px;
  white-space: nowrap;
}

.portal-nav__brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.portal-nav__brand-name {
  font-family: var(--hb-font-display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--hb-primary);
  white-space: nowrap;
}

body.rtl .portal-nav__brand-name {
  font-family: var(--hb-font-arabic);
}

.portal-nav__brand-tag {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hb-text-muted);
}

.portal-nav__end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.portal-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
  transition:
    background var(--hb-transition),
    color var(--hb-transition),
    box-shadow var(--hb-transition),
    transform 0.15s ease;
}

.portal-nav__link--signin {
  color: var(--hb-primary);
  background: var(--hb-primary-muted);
  border: 1px solid rgba(var(--hb-teal-rgb), 0.18);
}

.portal-nav__link--signin:hover {
  color: #fff;
  background: var(--hb-primary);
  box-shadow: 0 4px 14px rgba(var(--hb-teal-rgb), 0.28);
}

.portal-nav__link--signout {
  color: var(--hb-primary);
  background: var(--hb-surface);
  border: 1px solid rgba(var(--hb-teal-rgb), 0.2);
  box-shadow: 0 1px 2px rgba(28, 36, 40, 0.04);
}

.portal-nav__link--signout:hover {
  color: #fff;
  background: var(--hb-highlight);
  border-color: var(--hb-highlight);
  box-shadow: 0 4px 14px rgba(var(--hb-magenta-rgb), 0.28);
}

.portal-nav__link--signout:focus-visible {
  outline: 2px solid var(--hb-highlight);
  outline-offset: 2px;
}

.portal-nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--hb-border);
  border-radius: 10px;
  background: var(--hb-surface);
  color: var(--hb-primary);
  cursor: pointer;
  transition: background var(--hb-transition), border-color var(--hb-transition);
}

.portal-nav__toggle:hover {
  background: var(--hb-primary-muted);
  border-color: rgba(var(--hb-teal-rgb), 0.2);
}

.portal-nav__toggle-bar {
  display: block;
  width: 1rem;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform var(--hb-transition), opacity var(--hb-transition);
}

.portal-nav__toggle[aria-expanded="true"] .portal-nav__toggle-bar:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

.portal-nav__toggle[aria-expanded="true"] .portal-nav__toggle-bar:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

.portal-nav__drawer {
  display: none;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--hb-border);
  background: rgba(255, 252, 248, 0.98);
}

.portal-nav__drawer.is-open {
  display: flex;
}

.portal-nav__drawer-link {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--hb-primary);
  text-decoration: none;
  border-radius: var(--hb-radius-sm);
  transition: background var(--hb-transition);
}

.portal-nav__drawer-link:hover {
  background: var(--hb-primary-muted);
}

@media (max-width: 991.98px) {
  .portal-nav__link {
    display: none;
  }

  .portal-nav__toggle {
    display: flex;
  }
}

@media (min-width: 992px) {
  .portal-nav__drawer {
    display: none !important;
  }
}

/* Auth / login: logo-only bar, tighter */
.portal-nav--minimal {
  margin-bottom: 1.75rem;
}

.portal-nav--minimal .portal-nav__inner {
  min-height: 3.75rem;
}

.portal-nav--minimal .portal-nav__badge {
  color: var(--hb-accent);
  background: rgba(var(--hb-gold-rgb), 0.12);
}

/* Table action column alignment on desktop */
@media (min-width: 768px) {
  .portal-table td:last-child {
    text-align: end;
    white-space: nowrap;
  }
}

body.rtl .portal-nav__bar::before {
  inset: 0 0 0 auto;
  border-radius: 0 4px 4px 0;
}

body.rtl .portal-nav__inner {
  padding-left: 1rem;
  padding-right: 1.15rem;
}

body.rtl .portal-nav__link--signin i {
  transform: scaleX(-1);
}

/* —— Typography —— */
.portal-display {
  font-family: var(--hb-font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--hb-primary);
}

body.rtl .portal-display {
  font-family: var(--hb-font-arabic);
}

.portal-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hb-highlight);
  margin-bottom: 0.5rem;
}

.portal-lead {
  font-size: 1.05rem;
  color: var(--hb-text-muted);
  max-width: 42ch;
}

/* —— Cards —— */
.portal-card {
  background: var(--hb-surface);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius);
  box-shadow: var(--hb-shadow);
  overflow: hidden;
  transition: box-shadow var(--hb-transition);
}

.portal-card:hover {
  box-shadow: var(--hb-shadow-lg);
}

.portal-card__header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--hb-border);
  background: linear-gradient(180deg, var(--hb-surface) 0%, var(--hb-primary-muted) 100%);
}

.portal-card__header h2,
.portal-card__header h3 {
  margin: 0;
  font-family: var(--hb-font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--hb-primary);
}

body.rtl .portal-card__header h2,
body.rtl .portal-card__header h3 {
  font-family: var(--hb-font-arabic);
}

.portal-card__body {
  padding: 1.5rem;
}

.portal-card--highlight {
  border-color: rgba(var(--hb-teal-rgb), 0.22);
  background: linear-gradient(
    145deg,
    var(--hb-surface) 0%,
    rgba(var(--hb-teal-rgb), 0.05) 55%,
    rgba(var(--hb-magenta-rgb), 0.03) 100%
  );
}

/* —— Data table / list —— */
.portal-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.25rem;
}

.portal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.portal-table th,
.portal-table td {
  padding: 1rem 1.25rem;
  text-align: start;
  border-bottom: 1px solid var(--hb-border);
}

.portal-table th {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hb-text-muted);
  background: var(--hb-primary-muted);
}

.portal-table tbody tr {
  transition: background var(--hb-transition);
}

.portal-table tbody tr:hover {
  background: var(--hb-primary-muted);
}

.portal-table tbody tr:last-child td {
  border-bottom: none;
}

@media (max-width: 640px) {
  .portal-table--stack thead {
    display: none;
  }

  .portal-table--stack tbody tr {
    display: block;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--hb-surface);
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius-sm);
  }

  .portal-table--stack tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
    border: none;
  }

  .portal-table--stack tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--hb-text-muted);
  }
}

/* —— Definition list / info rows —— */
.portal-info-grid {
  display: grid;
  gap: 0;
}

.portal-info-row {
  display: grid;
  grid-template-columns: minmax(120px, 38%) 1fr;
  gap: 0.75rem 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--hb-border);
}

.portal-info-row:last-child {
  border-bottom: none;
}

.portal-info-row dt {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hb-text-muted);
}

.portal-info-row dd {
  margin: 0;
  font-weight: 500;
  color: var(--hb-text);
}

@media (max-width: 480px) {
  .portal-info-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

/* —— Buttons —— */
.portal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  border: none;
  border-radius: var(--hb-radius-sm);
  cursor: pointer;
  transition: background var(--hb-transition), color var(--hb-transition), transform 0.15s ease, box-shadow var(--hb-transition);
}

.portal-btn:active {
  transform: scale(0.98);
}

.portal-btn--primary {
  background: var(--hb-primary);
  color: #fff;
  box-shadow: 0 2px 10px rgba(var(--hb-teal-rgb), 0.32);
}

.portal-btn--primary:hover {
  background: var(--hb-primary-hover);
  color: #fff;
}

.portal-btn--accent {
  background: var(--hb-highlight);
  color: #fff;
  box-shadow: 0 2px 10px rgba(var(--hb-magenta-rgb), 0.28);
}

.portal-btn--accent:hover {
  background: var(--hb-highlight-hover);
  color: #fff;
}

.portal-btn--outline {
  background: transparent;
  color: var(--hb-primary);
  border: 1.5px solid var(--hb-primary);
}

.portal-btn--outline:hover {
  background: var(--hb-primary-muted);
  color: var(--hb-primary);
}

.portal-btn--ghost {
  background: transparent;
  color: var(--hb-text-muted);
  border: 1px solid var(--hb-border);
}

.portal-btn--ghost:hover {
  background: var(--hb-surface);
  color: var(--hb-primary);
}

.portal-btn--sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
}

.portal-btn--block {
  width: 100%;
}

/* —— Forms —— */
.portal-form-group {
  margin-bottom: 1.25rem;
}

.portal-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--hb-text);
}

.portal-input,
.portal-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--hb-text);
  background: var(--hb-surface-elevated);
  border: 1.5px solid var(--hb-border);
  border-radius: var(--hb-radius-sm);
  transition: border-color var(--hb-transition), box-shadow var(--hb-transition);
}

.portal-input:focus,
.portal-textarea:focus {
  outline: none;
  border-color: var(--hb-primary);
  box-shadow: 0 0 0 3px rgba(var(--hb-teal-rgb), 0.2);
}

.portal-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--hb-text-muted);
}

/* —— Login —— */
.portal-auth {
  min-height: calc(100vh - var(--hb-nav-height) - 4rem);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
}

.portal-auth__card {
  width: 100%;
  max-width: 420px;
  animation: portal-fade-up 0.6s ease both;
}

.portal-auth__card .portal-card__header {
  text-align: center;
  padding: 2rem 1.5rem 1rem;
}

.portal-auth__card .portal-card__header h1 {
  margin: 0;
  font-family: var(--hb-font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--hb-primary);
}

body.rtl .portal-auth__card .portal-card__header h1 {
  font-family: var(--hb-font-arabic);
}

.portal-auth__ornament {
  width: 56px;
  height: 3px;
  margin: 1rem auto 0;
  background: var(--hb-gradient-brand);
  border-radius: 2px;
}

/* —— Page header —— */
.portal-page-header {
  margin-bottom: 2rem;
  animation: portal-fade-up 0.5s ease both;
}

.portal-page-header h1 {
  margin: 0 0 0.35rem;
  font-family: var(--hb-font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  color: var(--hb-primary);
}

body.rtl .portal-page-header h1 {
  font-family: var(--hb-font-arabic);
}

/* —— Breadcrumb —— */
.portal-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}

.portal-breadcrumb a {
  color: var(--hb-text-muted);
  text-decoration: none;
  transition: color var(--hb-transition);
}

.portal-breadcrumb a:hover {
  color: var(--hb-primary);
}

.portal-breadcrumb li + li::before {
  content: "›";
  margin-inline: 0.5rem;
  color: var(--hb-text-muted);
  font-weight: 600;
}

.portal-breadcrumb .active {
  color: var(--hb-primary);
  font-weight: 600;
}

/* —— Steps checklist (student) —— */
.portal-step {
  padding: 1rem 0;
  border-bottom: 1px solid var(--hb-border);
}

.portal-step:last-child {
  border-bottom: none;
}

.portal-step__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.portal-step__label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.portal-step__label input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
  accent-color: var(--hb-primary);
  flex-shrink: 0;
}

.portal-step__label strong {
  font-size: 1rem;
  color: var(--hb-text);
}

.portal-step__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.portal-upload-btn {
  position: relative;
  overflow: hidden;
}

.portal-upload-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.portal-step-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--hb-text-muted);
}

.portal-step-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* —— Customer checklist —— */
.portal-checklist-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--hb-border);
}

.portal-checklist-item:last-child {
  border-bottom: none;
}

.portal-checklist-item__icon {
  font-size: 1.1rem;
  line-height: 1;
}

.portal-checklist-item__name {
  font-weight: 600;
  color: var(--hb-text);
}

/* —— Media gallery —— */
.portal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.portal-media-card {
  background: var(--hb-surface);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius);
  overflow: hidden;
  box-shadow: var(--hb-shadow);
  transition: transform var(--hb-transition), box-shadow var(--hb-transition);
  animation: portal-fade-up 0.5s ease both;
}

.portal-media-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--hb-shadow-lg);
}

.portal-media-card img,
.portal-media-card video {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--hb-bg-accent);
}

.portal-media-card__body {
  padding: 1rem 1.25rem;
}

.portal-media-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--hb-primary);
}

.portal-media-card__footer {
  padding: 0 1.25rem 1.25rem;
}

/* —— Alerts —— */
.portal-alert {
  padding: 1rem 1.25rem;
  border-radius: var(--hb-radius-sm);
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.portal-alert--success {
  background: rgba(var(--hb-teal-rgb), 0.1);
  border-color: rgba(var(--hb-teal-rgb), 0.28);
  color: var(--hb-success);
}

.portal-alert--danger {
  background: rgba(var(--hb-magenta-rgb), 0.08);
  border-color: rgba(var(--hb-magenta-rgb), 0.22);
  color: var(--hb-danger);
}

/* Bootstrap alert overrides in portal */
.portal-body .alert {
  border-radius: var(--hb-radius-sm);
  border: 1px solid var(--hb-border);
}

/* —— Empty state —— */
.portal-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--hb-text-muted);
}

/* —— Layout grid —— */
.portal-layout {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .portal-layout {
    grid-template-columns: minmax(280px, 340px) 1fr;
    align-items: start;
  }
}

.portal-layout__main {
  min-width: 0;
}

/* —— Loading overlay —— */
.loading-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(var(--hb-cream-rgb), 0.9);
  backdrop-filter: blur(4px);
  z-index: 9999;
}

.loading-overlay .spinner-border {
  width: 2.75rem;
  height: 2.75rem;
  color: var(--hb-primary) !important;
  border-width: 0.2em;
}

/* —— Audio player —— */
.portal-audio-wrap {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--hb-primary-muted);
  border-radius: var(--hb-radius-sm);
}

.portal-audio-wrap p {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--hb-primary);
}

.portal-audio-wrap audio {
  width: 100%;
  max-width: 100%;
}

/* —— Animations —— */
@keyframes portal-fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.portal-stagger > * {
  animation: portal-fade-up 0.5s ease both;
}

.portal-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.portal-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.portal-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.portal-stagger > *:nth-child(4) { animation-delay: 0.2s; }
.portal-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.portal-stagger > *:nth-child(6) { animation-delay: 0.3s; }

/* —— Dashboard hero —— */
.portal-hero {
  position: relative;
  margin-bottom: 2.5rem;
  padding: 2rem 1.75rem 2.25rem;
  background: var(--hb-surface-elevated);
  border: 1px solid rgba(var(--hb-teal-rgb), 0.18);
  border-radius: calc(var(--hb-radius) + 6px);
  box-shadow: var(--hb-shadow-lg);
  overflow: hidden;
}

.portal-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: var(--hb-gradient-brand);
  opacity: 0.85;
}

.portal-hero__pattern {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    radial-gradient(circle at 18% 28%, rgba(var(--hb-magenta-rgb), 0.1) 0%, transparent 40%),
    radial-gradient(circle at 88% 68%, rgba(var(--hb-teal-rgb), 0.12) 0%, transparent 42%),
    radial-gradient(circle at 55% 90%, rgba(var(--hb-gold-rgb), 0.1) 0%, transparent 38%),
    repeating-conic-gradient(
      from 0deg at 50% 50%,
      transparent 0deg 14deg,
      rgba(var(--hb-teal-rgb), 0.035) 14deg 15deg
    );
  pointer-events: none;
}

.portal-hero__content {
  position: relative;
  z-index: 1;
}

.portal-hero__title {
  margin: 0 0 0.65rem;
  font-family: var(--hb-font-display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--hb-primary);
}

body.rtl .portal-hero__title {
  font-family: var(--hb-font-arabic);
}

.portal-hero__lead {
  margin: 0;
  max-width: 52ch;
  font-size: 1.05rem;
  color: var(--hb-text-muted);
}

.portal-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  margin: 1.75rem 0 0;
  padding: 0;
}

.portal-hero__stat {
  margin: 0;
}

.portal-hero__stat dt {
  margin: 0 0 0.2rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hb-text-muted);
}

.portal-hero__stat dd {
  margin: 0;
  font-family: var(--hb-font-display);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
  color: var(--hb-primary);
}

/* —— Case cards (customer dashboard) —— */
.portal-case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.portal-case-card {
  animation: portal-fade-up 0.55s ease both;
}

.portal-case-card__link {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.35rem 1.4rem 1.25rem;
  text-decoration: none;
  color: inherit;
  background: var(--hb-surface-elevated);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius);
  box-shadow: var(--hb-shadow);
  overflow: hidden;
  transition:
    transform var(--hb-transition),
    box-shadow var(--hb-transition),
    border-color var(--hb-transition);
}

.portal-case-card__link::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--hb-gradient-brand);
  opacity: 0;
  transition: opacity var(--hb-transition);
}

.portal-case-card__link:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--hb-teal-rgb), 0.28);
  box-shadow: var(--hb-shadow-lg);
}

.portal-case-card__link:hover::before {
  opacity: 1;
}

.portal-case-card__link:focus-visible {
  outline: 2px solid var(--hb-highlight);
  outline-offset: 3px;
}

.portal-case-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.portal-case-card__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  text-align: end;
}

.portal-case-card__type {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--hb-text-muted);
}

.portal-case-card__id {
  margin: 0 0 0.5rem;
  font-family: var(--hb-font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--hb-primary);
  letter-spacing: -0.02em;
}

.portal-case-card__behalf {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--hb-text);
}

.portal-case-card__label {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hb-text-muted);
}

.portal-case-card__steps {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--hb-text-muted);
}

.portal-case-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.75rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #8a5f06;
  background: var(--hb-accent-soft);
  border: 1px solid rgba(var(--hb-gold-rgb), 0.28);
  border-radius: 999px;
  width: fit-content;
}

.portal-case-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--hb-primary);
  border-top: 1px solid var(--hb-border);
  transition: gap var(--hb-transition);
}

.portal-case-card__link:hover .portal-case-card__cta {
  gap: 0.55rem;
  color: var(--hb-highlight);
}

.portal-case-card__cta i {
  transition: transform var(--hb-transition);
}

.portal-case-card__link:hover .portal-case-card__cta i {
  transform: translateX(3px);
}

/* —— Progress ring —— */
.portal-progress-ring {
  --ring-size: 3.75rem;
  position: relative;
  flex-shrink: 0;
  width: var(--ring-size);
  height: var(--ring-size);
  border-radius: 50%;
  background: conic-gradient(
    var(--hb-primary) calc(var(--case-progress, 0) * 1%),
    var(--hb-primary-muted) 0
  );
  box-shadow: 0 0 0 2px rgba(var(--hb-gold-rgb), 0.15);
  transition: --case-progress 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.portal-progress-ring::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--hb-surface);
  box-shadow: inset 0 1px 2px rgba(26, 22, 18, 0.06);
}

.portal-progress-ring__value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--hb-primary);
  z-index: 1;
}

/* —— Status pills —— */
.portal-status {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid transparent;
}

.portal-status--r,
.portal-status--a {
  color: var(--hb-text-muted);
  background: rgba(107, 99, 90, 0.1);
  border-color: rgba(107, 99, 90, 0.15);
}

.portal-status--ip,
.portal-status--tbc {
  color: #9a6508;
  background: var(--hb-accent-soft);
  border-color: rgba(var(--hb-gold-rgb), 0.3);
}

.portal-status--c {
  color: var(--hb-primary-hover);
  background: rgba(var(--hb-teal-rgb), 0.12);
  border-color: rgba(var(--hb-teal-rgb), 0.28);
}

.portal-status--f {
  color: var(--hb-danger);
  background: rgba(155, 44, 44, 0.08);
  border-color: rgba(155, 44, 44, 0.2);
}

/* —— Empty state —— */
.portal-empty-state {
  text-align: center;
  padding: 3.5rem 2rem;
}

.portal-empty-state__icon {
  margin-bottom: 1.25rem;
  color: var(--hb-primary);
}

.portal-empty-state .portal-display {
  margin-bottom: 0.5rem;
}

/* —— Journey progress bar (case detail) —— */
.portal-journey-bar__track {
  height: 6px;
  margin-bottom: 0.45rem;
  background: var(--hb-primary-muted);
  border-radius: 999px;
  overflow: hidden;
}

.portal-journey-bar__fill {
  display: block;
  height: 100%;
  width: calc(var(--journey-progress, 0) * 1%);
  background: linear-gradient(90deg, var(--hb-primary) 0%, var(--hb-highlight) 100%);
  border-radius: 999px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.portal-journey-bar__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--hb-text-muted);
}

/* Hide default bootstrap container padding conflicts */
.portal-body > .container,
.portal-body > .portal-shell {
  padding-top: 0;
}
