body.pasi-has-site-header {
  --portal-green-950: #042a1d;
  --portal-green-900: #063f2b;
  --portal-green-800: #075437;
  --portal-emerald: #13a66b;
  --portal-emerald-light: #25c47f;
  --portal-ink: #17211c;
  --portal-muted: #627268;
  --portal-soft: #f5f8f6;
  --portal-soft-green: #edf7f0;
  --portal-line: rgba(6, 63, 43, 0.12);
  --portal-shadow: 0 24px 70px rgba(4, 42, 29, 0.12);
}

.pasi-auth-section,
.portal-shell {
  background:
    radial-gradient(circle at top left, rgba(19, 166, 107, 0.12), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f5f8f6 100%);
  color: var(--portal-ink);
  min-height: 72vh;
  padding: 74px 0 110px;
}

.pasi-auth-card,
.portal-card,
.portal-table-card,
.application-wizard {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--portal-line);
  border-radius: 22px;
  box-shadow: var(--portal-shadow);
}

.pasi-auth-card {
  padding: clamp(26px, 4vw, 44px);
}

.pasi-auth-logo {
  align-items: center;
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
}

.pasi-auth-logo img {
  height: 74px;
  width: auto;
}

.pasi-auth-logo span,
.portal-eyebrow {
  color: var(--portal-emerald);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.pasi-auth-card h1,
.portal-hero h1,
.application-wizard h1 {
  color: var(--portal-green-950);
  font-family: "Playfair Display", Georgia, serif;
  letter-spacing: 0;
}

.pasi-auth-card h1 {
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.02;
  margin-bottom: 14px;
}

.pasi-auth-card p,
.portal-hero p {
  color: var(--portal-muted);
  line-height: 1.7;
}

.portal-input,
.pasi-auth-card .form-control,
.pasi-auth-card .form-select,
.application-wizard .form-control,
.application-wizard .form-select,
.application-wizard textarea {
  border: 1px solid rgba(6, 63, 43, 0.16);
  border-radius: 14px;
  min-height: 50px;
  padding: 12px 14px;
}

.portal-input:focus,
.pasi-auth-card .form-control:focus,
.pasi-auth-card .form-select:focus,
.application-wizard .form-control:focus,
.application-wizard .form-select:focus,
.application-wizard textarea:focus {
  border-color: rgba(19, 166, 107, 0.74);
  box-shadow: 0 0 0 0.25rem rgba(19, 166, 107, 0.14);
}

.portal-label,
.application-wizard .form-label,
.pasi-auth-card .form-label {
  color: var(--portal-green-900);
  font-size: 13px;
  font-weight: 800;
}

.portal-link {
  color: var(--portal-green-800);
  font-weight: 800;
}

.portal-link:hover {
  color: var(--portal-emerald);
}

.portal-inline-button {
  background: transparent;
  border: 0;
  color: var(--portal-green-800);
  font-weight: 900;
  padding: 0;
  text-decoration: underline;
}

.portal-inline-button:hover,
.portal-inline-button:focus-visible {
  color: var(--portal-emerald);
}

.portal-alert {
  align-items: flex-start;
  border-radius: 18px;
  display: flex;
  gap: 14px;
  line-height: 1.55;
  margin: 22px 0;
  padding: 16px 18px;
  text-align: left;
}

.portal-alert i {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 38px;
  font-size: 19px;
  height: 38px;
  justify-content: center;
}

.portal-alert strong {
  color: var(--portal-green-950);
  display: block;
  margin-bottom: 2px;
}

.portal-alert p {
  margin: 0;
}

.portal-alert-success {
  background: #edf7f0;
  border: 1px solid rgba(19, 166, 107, 0.22);
  color: #355545;
}

.portal-alert-success i {
  background: #13a66b;
  color: #ffffff;
}

.portal-alert-info {
  background: #f4f8f5;
  border: 1px solid rgba(6, 63, 43, 0.12);
  color: #45564d;
}

.portal-alert-info i {
  background: rgba(19, 166, 107, 0.12);
  color: var(--portal-green-900);
}

.portal-toast-wrap {
  pointer-events: none;
  position: fixed;
  right: clamp(16px, 3vw, 34px);
  top: calc(94px + env(safe-area-inset-top));
  width: min(420px, calc(100vw - 32px));
  z-index: 1080;
}

.portal-email-toast {
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(6, 63, 43, 0.14);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(4, 42, 29, 0.18);
  color: var(--portal-ink);
  overflow: hidden;
  pointer-events: auto;
  position: relative;
}

.portal-email-toast::before {
  background: linear-gradient(90deg, var(--portal-emerald), var(--portal-green-800));
  content: "";
  height: 4px;
  inset: 0 0 auto;
  position: absolute;
}

.portal-email-toast .toast-body {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  padding: 20px 18px 18px;
}

.portal-email-toast strong {
  color: var(--portal-green-950);
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.portal-email-toast p {
  color: var(--portal-muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.portal-toast-icon {
  align-items: center;
  background: rgba(19, 166, 107, 0.12);
  border-radius: 999px;
  color: var(--portal-green-900);
  display: inline-flex;
  flex: 0 0 42px;
  font-size: 20px;
  height: 42px;
  justify-content: center;
}

.portal-email-toast .btn-close {
  flex: 0 0 auto;
  margin-left: auto;
}

.portal-action-toast.is-danger {
  border-color: rgba(217, 45, 32, 0.22);
}

.portal-action-toast.is-danger::before {
  background: linear-gradient(90deg, #d92d20, #a61b12);
}

.portal-action-toast.is-danger .portal-toast-icon {
  background: rgba(217, 45, 32, 0.12);
  color: #b42318;
}

.application-wizard .form-control.is-invalid,
.application-wizard .form-select.is-invalid,
.application-wizard .form-check-input.is-invalid {
  border-color: #d92d20;
}

.application-wizard .form-control.is-invalid,
.application-wizard .form-select.is-invalid {
  background-image: none;
  box-shadow: 0 0 0 0.22rem rgba(217, 45, 32, 0.1);
}

.application-wizard .form-control.is-invalid:focus,
.application-wizard .form-select.is-invalid:focus {
  border-color: #b42318;
  box-shadow: 0 0 0 0.25rem rgba(217, 45, 32, 0.16);
}

.application-wizard .invalid-feedback {
  color: #b42318;
  font-size: 13px;
  font-weight: 700;
  margin-top: 7px;
}

.portal-btn,
.portal-btn-outline,
.portal-btn-danger {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-weight: 800;
  gap: 8px;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
  text-decoration: none;
  transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease, color 200ms ease;
}

.portal-btn {
  background: linear-gradient(135deg, var(--portal-emerald), #0c8f5a);
  border: 0;
  box-shadow: 0 18px 38px rgba(19, 166, 107, 0.25);
  color: #ffffff;
}

.portal-btn:hover,
.portal-btn:focus-visible {
  background: linear-gradient(135deg, var(--portal-emerald-light), var(--portal-emerald));
  color: #ffffff;
  transform: translateY(-2px);
}

.portal-btn-outline {
  background: #ffffff;
  border: 1px solid rgba(6, 63, 43, 0.16);
  color: var(--portal-green-900);
}

.portal-btn-outline:hover,
.portal-btn-outline:focus-visible {
  background: var(--portal-soft-green);
  color: var(--portal-green-800);
  transform: translateY(-2px);
}

.portal-btn-danger {
  background: #fff4f4;
  border: 1px solid rgba(180, 30, 30, 0.2);
  color: #9b1c1c;
}

.portal-hero {
  margin-bottom: 34px;
}

.portal-hero h1 {
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.02;
  margin: 8px 0 12px;
}

.portal-stat-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.portal-stat {
  background: #ffffff;
  border: 1px solid var(--portal-line);
  border-radius: 18px;
  padding: 22px;
}

.portal-stat strong {
  color: var(--portal-green-950);
  display: block;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1;
}

.portal-stat span {
  color: var(--portal-muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.portal-card {
  padding: clamp(22px, 3vw, 34px);
}

.portal-table-card {
  overflow: hidden;
}

.portal-table-card .table {
  margin: 0;
}

.portal-status {
  background: var(--portal-soft-green);
  border: 1px solid rgba(19, 166, 107, 0.16);
  border-radius: 999px;
  color: var(--portal-green-900);
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  padding: 7px 11px;
  text-transform: uppercase;
}

.portal-progress-track {
  background: #dfeae3;
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.portal-progress-bar {
  background: linear-gradient(90deg, var(--portal-emerald), var(--portal-emerald-light));
  border-radius: inherit;
  height: 100%;
}

.portal-admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 28px;
}

.portal-admin-nav a {
  background: #ffffff;
  border: 1px solid var(--portal-line);
  border-radius: 999px;
  color: var(--portal-green-900);
  font-weight: 800;
  padding: 10px 16px;
}

.portal-admin-nav a.active,
.portal-admin-nav a:hover {
  background: var(--portal-green-900);
  color: #ffffff;
}

.portal-command-bar {
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--portal-line);
  border-radius: 22px;
  box-shadow: 0 18px 48px rgba(4, 42, 29, 0.08);
  display: grid;
  gap: 18px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  margin: 0 0 28px;
  padding: 14px;
}

.portal-command-bar__title {
  border-right: 1px solid var(--portal-line);
  min-width: 150px;
  padding: 8px 18px 8px 8px;
}

.portal-command-bar__title span,
.portal-command-bar__title strong {
  display: block;
}

.portal-command-bar__title span {
  color: var(--portal-emerald);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.portal-command-bar__title strong {
  color: var(--portal-green-950);
  font-size: 17px;
  line-height: 1.2;
}

.portal-command-bar__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.portal-command-bar__nav a,
.portal-command-bar__account-link {
  align-items: center;
  background: var(--portal-soft);
  border: 1px solid rgba(6, 63, 43, 0.1);
  border-radius: 999px;
  color: var(--portal-green-900);
  display: flex;
  font-weight: 800;
  gap: 8px;
  min-height: 42px;
  padding: 9px 13px;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.portal-command-bar__nav a i,
.portal-command-bar__account-link i {
  align-items: center;
  color: var(--portal-emerald);
  display: inline-flex;
  flex: 0 0 20px;
  font-size: 18px;
  height: 20px;
  justify-content: center;
  width: 20px;
}

.portal-command-bar__nav a.active,
.portal-command-bar__nav a:hover,
.portal-command-bar__account-link.active,
.portal-command-bar__account-link:hover {
  background: var(--portal-green-900);
  color: #ffffff;
  transform: translateY(-1px);
}

.portal-command-bar__nav a.active i,
.portal-command-bar__nav a:hover i,
.portal-command-bar__account-link.active i,
.portal-command-bar__account-link:hover i {
  color: #ffffff;
}

.portal-command-bar__account {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.portal-command-bar__avatar {
  align-items: center;
  background: var(--portal-green-900);
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  flex: 0 0 38px;
  font-size: 14px;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.portal-command-bar__account-link {
  border: 0;
  font-size: 13px;
}

.portal-profile-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.45fr);
}

.portal-profile-card h2 {
  color: var(--portal-green-950);
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 8px;
}

.portal-profile-card p {
  color: var(--portal-muted);
  line-height: 1.65;
}

.portal-danger-zone {
  background: #fff7f7;
  border-color: rgba(180, 30, 30, 0.18);
}

.portal-danger-zone h2 {
  color: #8f1d1d;
}

@media (max-width: 1199px) {
  .portal-command-bar {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .portal-command-bar__title {
    border-bottom: 1px solid var(--portal-line);
    border-right: 0;
    padding: 4px 4px 14px;
  }

  .portal-command-bar__account {
    border-top: 1px solid var(--portal-line);
    justify-content: flex-start;
    padding-top: 12px;
  }

  .portal-profile-grid {
    grid-template-columns: 1fr;
  }
}

.application-wizard {
  overflow: hidden;
}

.application-wizard,
.application-wizard * {
  min-width: 0;
}

.wizard-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
}

.wizard-rail {
  background: linear-gradient(180deg, var(--portal-green-950), var(--portal-green-800));
  color: #ffffff;
  padding: 28px;
}

.wizard-steps {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.wizard-step {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.86);
  display: flex;
  gap: 12px;
  padding: 12px;
  text-align: left;
  width: 100%;
}

.wizard-step strong {
  overflow-wrap: anywhere;
}

.wizard-step span {
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 34px;
  font-weight: 900;
  height: 34px;
  justify-content: center;
}

.wizard-step.is-active {
  background: #ffffff;
  color: var(--portal-green-950);
}

.wizard-step.has-errors {
  border-color: rgba(217, 45, 32, 0.72);
}

.wizard-step.has-errors span {
  background: #d92d20;
  color: #ffffff;
}

.wizard-step.has-errors:not(.is-active) {
  background: rgba(217, 45, 32, 0.12);
}

.wizard-main {
  padding: clamp(24px, 4vw, 42px);
}

.wizard-panel {
  display: none;
}

.wizard-panel.is-active {
  display: block;
}

.wizard-panel h2 {
  color: var(--portal-green-950);
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: 0;
  margin-bottom: 10px;
}

.wizard-actions {
  border-top: 1px solid var(--portal-line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 22px;
}

.upload-zone {
  background: var(--portal-soft);
  border: 1px dashed rgba(6, 63, 43, 0.3);
  border-radius: 18px;
  padding: 18px;
}

.upload-zone input {
  cursor: pointer;
}

.agreement-box {
  border: 1px solid var(--portal-line);
  border-radius: 18px;
  max-height: 440px;
  overflow-y: auto;
  padding: 18px;
}

.agreement-source {
  align-items: center;
  background: linear-gradient(135deg, rgba(19, 166, 107, 0.1), rgba(6, 63, 43, 0.04));
  border: 1px solid rgba(6, 63, 43, 0.12);
  border-radius: 18px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 18px;
}

.agreement-source h3 {
  color: var(--portal-green-950);
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: 0;
  margin: 4px 0 8px;
}

.agreement-preamble {
  background: #ffffff;
  border: 1px solid var(--portal-line);
  border-radius: 18px;
  color: var(--portal-ink);
  margin-bottom: 18px;
  padding: 18px;
}

.agreement-preamble p,
.agreement-card__body p {
  line-height: 1.72;
  margin-bottom: 12px;
}

.agreement-preamble p:last-child,
.agreement-card__body p:last-child {
  margin-bottom: 0;
}

.agreement-card {
  border: 1px solid rgba(6, 63, 43, 0.12);
  border-radius: 16px;
  margin-bottom: 12px;
  overflow: hidden;
}

.agreement-card .accordion-button {
  color: var(--portal-green-950);
  font-weight: 900;
}

.agreement-card .accordion-button:not(.collapsed) {
  background: var(--portal-soft-green);
  box-shadow: none;
}

.agreement-card__body {
  color: #34483d;
}

.application-review {
  padding: clamp(20px, 3vw, 30px);
}

.review-header {
  align-items: flex-start;
  border-bottom: 1px solid var(--portal-line);
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 240px);
  margin-bottom: 26px;
  padding-bottom: 24px;
}

.review-header h3 {
  color: var(--portal-green-950);
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(30px, 4vw, 42px);
  letter-spacing: 0;
  margin: 6px 0 10px;
}

.review-header p {
  color: var(--portal-muted);
  line-height: 1.65;
  margin: 0;
}

.review-qr-card {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--portal-line);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  padding: 16px;
  text-align: center;
}

.review-qr-card img {
  aspect-ratio: 1;
  height: auto;
  margin-bottom: 10px;
  max-width: 160px;
  width: 100%;
}

.review-qr-card strong {
  color: var(--portal-green-950);
}

.review-qr-card span {
  color: var(--portal-muted);
  font-size: 13px;
  line-height: 1.45;
}

.review-qr-placeholder {
  align-items: center;
  aspect-ratio: 1;
  background: var(--portal-soft-green);
  border-radius: 16px;
  color: var(--portal-green-900);
  display: inline-flex;
  font-size: 54px;
  justify-content: center;
  margin-bottom: 12px;
  max-width: 160px;
  width: 100%;
}

.review-section {
  border-bottom: 1px solid var(--portal-line);
  margin-bottom: 24px;
  padding-bottom: 22px;
}

.review-section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.review-section h4 {
  color: var(--portal-green-950);
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 14px;
}

.review-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.review-item,
.review-long-item {
  background: var(--portal-soft);
  border: 1px solid var(--portal-line);
  border-radius: 16px;
  padding: 14px;
}

.review-item span,
.review-long-item span {
  color: var(--portal-muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.review-item strong,
.review-long-item strong {
  color: var(--portal-ink);
  display: block;
  overflow-wrap: anywhere;
}

.review-long-item p {
  color: #415149;
  line-height: 1.65;
  margin: 10px 0 0;
  white-space: pre-wrap;
}

.portal-printable {
  background: #ffffff;
  color: #1d2a23;
  font-family: Arial, sans-serif;
  padding: 32px;
}

@media (max-width: 1199px) {
  .portal-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wizard-layout {
    grid-template-columns: 1fr;
  }

  .wizard-rail {
    position: sticky;
    top: 78px;
    z-index: 2;
  }

  .wizard-steps {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .wizard-step {
    flex: 0 0 230px;
  }

  .review-header {
    grid-template-columns: 1fr;
  }

  .review-qr-card {
    align-items: flex-start;
    text-align: left;
  }
}

@media (max-width: 767px) {
  .pasi-auth-section,
  .portal-shell {
    padding: 44px 0 78px;
  }

  .portal-stat-grid {
    grid-template-columns: 1fr;
  }

  .portal-command-bar {
    border-radius: 18px;
    padding: 12px;
  }

  .portal-command-bar__nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-command-bar__nav a,
  .portal-command-bar__account-link {
    justify-content: flex-start;
    min-width: 0;
  }

  .portal-command-bar__nav a span,
  .portal-command-bar__account-link span {
    overflow-wrap: anywhere;
  }

  .portal-command-bar__account {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) minmax(0, 1fr);
  }

  .portal-command-bar__account form {
    min-width: 0;
  }

  .pasi-auth-logo {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-alert {
    border-radius: 16px;
    gap: 12px;
    padding: 14px;
  }

  .portal-toast-wrap {
    left: 16px;
    right: 16px;
    top: calc(82px + env(safe-area-inset-top));
    width: auto;
  }

  .portal-email-toast .toast-body {
    padding: 18px 14px 16px;
  }

  .agreement-source {
    align-items: flex-start;
    flex-direction: column;
  }

  .wizard-main,
  .wizard-rail {
    padding: 20px;
  }

  .application-wizard {
    border-radius: 18px;
  }

  .wizard-rail {
    position: static;
  }

  .wizard-steps {
    gap: 8px;
    margin-left: -4px;
    margin-right: -4px;
    padding: 0 4px 8px;
  }

  .wizard-step {
    border-radius: 14px;
    flex: 0 0 190px;
    padding: 10px;
  }

  .wizard-step span {
    flex-basis: 30px;
    height: 30px;
  }

  .wizard-actions {
    display: grid;
  }

  .wizard-actions > div {
    display: grid !important;
  }

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

  .review-qr-card {
    width: 100%;
  }

  .portal-btn,
  .portal-btn-outline,
  .portal-btn-danger {
    width: 100%;
  }
}

@media (max-width: 575px) {
  .portal-shell .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .portal-command-bar__nav,
  .portal-command-bar__account {
    grid-template-columns: 1fr;
  }

  .portal-command-bar__avatar {
    display: none;
  }

  .wizard-main,
  .wizard-rail {
    padding: 16px;
  }

  .wizard-panel h2,
  .review-header h3 {
    font-size: 30px;
  }

  .portal-alert,
  .review-item,
  .review-long-item,
  .agreement-preamble,
  .agreement-source {
    border-radius: 14px;
  }
}
