.client-page {
  min-height: 100svh;
  background:
    radial-gradient(circle at 12% 0%, rgba(244, 90, 55, 0.08), transparent 28%),
    linear-gradient(180deg, #f7faf9 0%, #ffffff 48%, #f3f6f7 100%);
}

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.client-shell {
  width: min(100% - 32px, 1080px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 30px 0 56px;
}

.client-loading,
.client-access {
  min-height: calc(100svh - 86px);
  display: grid;
  align-content: center;
  gap: 24px;
}

.client-access-panel,
.client-card,
.client-hero,
.client-step,
.client-payment,
.client-contact {
  border: 1px solid rgba(223, 228, 232, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 70px rgba(24, 35, 45, 0.08);
}

.client-access-panel {
  max-width: 680px;
  padding: 34px;
}

.client-access-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 18px;
  align-items: stretch;
}

.client-access-grid .client-access-panel {
  max-width: none;
}

.client-access-panel h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.12;
}

.client-access-panel p {
  color: var(--muted);
}

.client-token-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 24px;
}

.client-link-request {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.client-link-request h2 {
  margin: 0;
  font-size: 1.25rem;
}

.client-link-request p {
  margin: 6px 0 0;
}

.client-link-request-form {
  display: grid;
  gap: 12px;
}

.client-link-request-form label span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.client-journey-card {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 26px;
  border: 1px solid rgba(223, 228, 232, 0.92);
  border-radius: 8px;
  background: #162127;
  color: #fff;
  box-shadow: 0 24px 70px rgba(24, 35, 45, 0.12);
}

.client-journey-card h2 {
  margin: 0;
  font-size: 1.65rem;
  line-height: 1.2;
}

.client-journey-steps {
  display: grid;
  gap: 10px;
}

.client-journey-steps article {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 4px;
  align-items: start;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.client-journey-steps span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  color: var(--teal);
  font-weight: 900;
}

.client-journey-steps strong {
  display: block;
  line-height: 1.25;
}

.client-journey-steps p {
  margin: 0;
  color: #c8d1d6;
  font-size: 0.92rem;
  line-height: 1.55;
}

.client-topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}

.client-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.client-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 28px;
  padding: 34px;
}

.client-hero h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 4.3rem);
  line-height: 1.04;
}

.client-kicker {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef6f5;
  color: var(--teal);
  font-size: 0.86rem;
  font-weight: 900;
}

.client-project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.client-project-meta span,
.client-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--soft);
  color: #3d444a;
  font-size: 0.9rem;
  font-weight: 800;
}

.client-now {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 20px;
  border-radius: 8px;
  background: #152027;
  color: #fff;
}

.client-now span {
  color: #bfc9cf;
  font-weight: 800;
}

.client-now strong {
  font-size: 1.5rem;
  line-height: 1.25;
}

.client-progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.client-progress-fill {
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f45a37, #0b746f);
}

.client-progress-number {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #e9eef1;
  font-size: 0.9rem;
  font-weight: 900;
}

.client-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 18px;
  margin-top: 18px;
}

.material-grid,
.request-grid {
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
}

.client-card {
  padding: 24px;
}

.referral-card-client {
  margin-top: 18px;
}

.referral-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.referral-link-box {
  display: grid;
  gap: 5px;
  margin-top: 18px;
  padding: 16px;
  border-radius: 8px;
  background: #132027;
  color: #fff;
}

.referral-link-box span {
  color: #bdc8ce;
  font-size: 0.86rem;
  font-weight: 900;
}

.referral-link-box strong {
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.referral-rule-strip,
.referral-stats {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.referral-rule-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.referral-rule-strip span,
.referral-stats article,
.referral-policy,
.client-referral-row {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.referral-rule-strip span {
  color: #30383f;
  font-weight: 900;
}

.referral-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.referral-stats span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.referral-stats strong {
  display: block;
  margin-top: 5px;
  font-size: 1.3rem;
}

.referral-policy {
  margin-top: 14px;
  background: #f7faf9;
}

.referral-policy p {
  margin: 6px 0 0;
  color: var(--muted);
}

.client-referral-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.client-referral-row strong,
.client-referral-row span {
  display: block;
}

.client-referral-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.client-card h2,
.client-contact h2 {
  margin: 0;
  font-size: 1.35rem;
}

.client-next-action {
  margin: 14px 0 0;
  color: #242b31;
  font-size: 1.25rem;
  font-weight: 900;
}

.client-note {
  margin: 10px 0 0;
  color: var(--muted);
}

.client-steps {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.client-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  box-shadow: none;
}

.client-step-index {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--muted);
  font-weight: 900;
}

.client-step[data-state="done"] .client-step-index,
.client-step[data-state="active"] .client-step-index {
  background: var(--teal);
  color: #fff;
}

.client-step strong {
  display: block;
  line-height: 1.25;
}

.client-step small {
  color: var(--muted);
}

.client-step-status {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 900;
}

.client-payment-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.agreement-card-client {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.agreement-client-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.agreement-client-head h2 {
  margin: 0;
}

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

.agreement-client-grid article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfb;
}

.agreement-client-grid ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #3d444a;
}

.client-agreement-form {
  display: grid;
  gap: 12px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #3d444a;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.55;
}

.check input {
  margin-top: 5px;
}

.client-payment {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 16px;
  box-shadow: none;
}

.client-upload-form,
.client-request-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.client-form-row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 10px;
}

.client-material-list,
.client-request-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.client-material {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.client-material img,
.client-file-icon {
  width: 74px;
  height: 58px;
  border-radius: 7px;
  background: var(--soft);
  object-fit: cover;
}

.client-file-icon {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.client-material strong,
.client-request strong {
  display: block;
  line-height: 1.25;
}

.client-material span,
.client-request span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.client-material p,
.client-request p {
  margin: 6px 0 0;
  color: #3d444a;
}

.client-request,
.client-empty {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.client-request[data-status="done"] {
  background: #f7faf9;
}

.client-empty {
  color: var(--muted);
  font-weight: 800;
}

.client-payment strong {
  display: block;
}

.client-payment span {
  color: var(--muted);
  font-size: 0.92rem;
}

.client-payment-badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-weight: 900;
  white-space: nowrap;
}

.client-payment-badge[data-status="paid"] {
  background: #e8f6ef;
  color: var(--green);
}

.client-payment-badge[data-status="pending"] {
  background: #fff4dd;
  color: #9a6500;
}

.client-contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-top: 18px;
  padding: 24px;
}

.client-error {
  max-width: 620px;
  margin: 16vh auto 0;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.client-error h1 {
  margin: 0;
}

.client-error p {
  color: var(--muted);
}

@media (max-width: 780px) {
  .client-token-form,
  .client-link-request-form .client-form-row,
  .client-access-grid,
  .client-hero,
  .client-grid,
    .client-contact,
    .client-form-row,
    .agreement-client-grid,
    .client-material,
  .referral-rule-strip,
  .referral-stats {
    grid-template-columns: 1fr;
  }

  .referral-head {
    flex-direction: column;
  }

  .client-hero,
  .client-access-panel,
  .client-card,
  .client-contact {
    padding: 20px;
  }

  .client-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .client-hero h1 {
    font-size: 2.45rem;
  }

  .client-step {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .client-step-status {
    grid-column: 2;
  }
}

/* Access form final placement */
.client-token-form,
.client-unlock-form {
  grid-template-columns: minmax(170px, 0.85fr) minmax(220px, 1fr);
  align-items: end;
}

.client-token-form .button,
.client-unlock-form .button {
  grid-column: 2;
  justify-self: end;
  min-width: 158px;
  gap: 8px;
}

.client-token-form .button.is-loading,
.client-unlock-form .button.is-loading {
  opacity: 0.9;
  pointer-events: none;
}

.client-token-form .button.is-loading::before,
.client-unlock-form .button.is-loading::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 999px;
  animation: client-button-spin 0.78s linear infinite;
}

@media (max-width: 780px) {
  .client-token-form,
  .client-unlock-form {
    grid-template-columns: 1fr;
  }

  .client-token-form .button,
  .client-unlock-form .button {
    grid-column: auto;
    justify-self: stretch;
    width: 100%;
  }
}

/* Final override: client access button alignment and loading state */
.client-token-form,
.client-unlock-form {
  grid-template-columns: minmax(170px, 0.85fr) minmax(220px, 1fr);
  align-items: end;
}

.client-token-form .button,
.client-unlock-form .button {
  grid-column: 2;
  justify-self: end;
  min-width: 158px;
  gap: 8px;
}

.client-token-form .button.is-loading,
.client-unlock-form .button.is-loading {
  opacity: 0.9;
  pointer-events: none;
}

.client-token-form .button.is-loading::before,
.client-unlock-form .button.is-loading::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 999px;
  animation: client-button-spin 0.78s linear infinite;
}

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

@media (max-width: 780px) {
  .client-token-form,
  .client-unlock-form {
    grid-template-columns: 1fr;
  }

  .client-token-form .button,
  .client-unlock-form .button {
    grid-column: auto;
    justify-self: stretch;
    width: 100%;
  }
}

/* Client portal open button placement + loading feedback */
.client-token-form,
.client-unlock-form {
  grid-template-columns: minmax(170px, 0.85fr) minmax(220px, 1fr);
  align-items: end;
}

.client-token-form .button,
.client-unlock-form .button {
  grid-column: 2;
  justify-self: end;
  min-width: 158px;
  gap: 8px;
}

.client-token-form .button.is-loading,
.client-unlock-form .button.is-loading {
  opacity: 0.9;
  pointer-events: none;
}

.client-token-form .button.is-loading::before,
.client-unlock-form .button.is-loading::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 999px;
  animation: client-button-spin 0.78s linear infinite;
}

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

@media (max-width: 780px) {
  .client-token-form,
  .client-unlock-form {
    grid-template-columns: 1fr;
  }

  .client-token-form .button,
  .client-unlock-form .button {
    grid-column: auto;
    justify-self: stretch;
    width: 100%;
  }
}

/* Client portal action hierarchy */
.client-card > .eyebrow,
.client-contact > .eyebrow {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  margin: 0 0 9px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef4ff;
  color: #2563eb;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.client-card > h2,
.client-contact h2 {
  margin: 0 0 14px;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(30, 45, 70, 0.08);
  color: #101720;
  font-size: 1.12rem;
  font-weight: 900;
  letter-spacing: 0;
}

.client-focus-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 251, 255, 0.9)),
    radial-gradient(circle at 90% 0%, rgba(37, 99, 235, 0.1), transparent 36%);
}

.client-next-action {
  display: block;
  margin: 0 0 12px;
  padding: 15px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f5f8ff 0%, #eef8ff 100%);
  color: #101720;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.09);
  font-size: 1.02rem;
  font-weight: 850;
  line-height: 1.55;
}

.client-action-row {
  display: grid;
  gap: 8px;
  margin-top: 15px;
}

.client-action-row.compact {
  margin-top: 4px;
}

.client-action-row small {
  color: #65717d;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.45;
}

.client-action-row .button {
  justify-content: center;
}

.client-payment-card {
  background: rgba(255, 255, 255, 0.9);
}

.client-payment-list {
  gap: 10px;
  margin-top: 2px;
}

.client-payment {
  align-items: flex-start;
  padding: 15px;
  border-radius: 16px;
  background: #f8fbff;
  box-shadow: inset 0 0 0 1px rgba(30, 45, 70, 0.07);
}

.client-payment[data-payment-status="pending"] {
  background: linear-gradient(135deg, #f6f9ff 0%, #eef6ff 100%);
  box-shadow:
    inset 0 0 0 1px rgba(37, 99, 235, 0.14),
    0 12px 28px rgba(37, 99, 235, 0.07);
}

.client-payment.is-empty {
  background: #fafbfc;
  box-shadow: inset 0 0 0 1px rgba(30, 45, 70, 0.06);
}

.client-payment-main {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.client-payment-label {
  color: #2563eb;
  font-size: 0.76rem;
  font-weight: 900;
}

.client-payment-main strong {
  color: #101720;
  font-size: 0.94rem;
  font-weight: 850;
  line-height: 1.45;
}

.client-payment-main small {
  color: #65717d;
  font-size: 0.86rem;
  font-weight: 700;
}

.client-payment-side {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  gap: 8px;
}

.client-payment-action {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  white-space: nowrap;
}

@media (max-width: 780px) {
  .client-payment {
    display: grid;
    gap: 12px;
  }

  .client-payment-side {
    width: 100%;
    justify-items: stretch;
  }

  .client-payment-action {
    width: 100%;
  }
}

/* Client portal email gate */
.client-token-form {
  grid-template-columns: minmax(160px, 0.9fr) minmax(220px, 1fr) auto;
}

.client-token-form input[readonly] {
  color: #485260;
  background: #f7f9fc;
}

.client-unlock-form {
  align-items: end;
}

@media (max-width: 780px) {
  .client-token-form,
  .client-unlock-form {
    grid-template-columns: 1fr;
  }
}

/* Referral panel redesign */
.referral-card-client {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding: 0;
  overflow: hidden;
}

.referral-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 0.28fr);
  gap: 18px;
  align-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 100% 0, rgba(37, 99, 235, 0.14), transparent 34%),
    linear-gradient(135deg, #f7fbff 0%, #eef6ff 100%);
}

.referral-hero .eyebrow {
  margin-bottom: 9px;
}

.referral-hero h2 {
  margin: 0;
  padding: 0;
  border: 0;
  color: #101720;
  font-size: clamp(1.22rem, 2.2vw, 1.72rem);
  line-height: 1.25;
}

.referral-hero p {
  max-width: 760px;
  margin: 10px 0 0;
  color: #5f6872;
  font-size: 0.95rem;
  line-height: 1.72;
}

.referral-hero-metric {
  display: grid;
  gap: 5px;
  min-height: 132px;
  align-content: center;
  padding: 18px;
  border-radius: 18px;
  background: #101720;
  color: #fff;
  box-shadow: 0 20px 48px rgba(16, 23, 32, 0.16);
}

.referral-hero-metric span,
.referral-hero-metric small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 850;
}

.referral-hero-metric strong {
  font-size: 1.55rem;
  line-height: 1.1;
}

.referral-hero-limit {
  min-height: 96px;
  place-items: center;
  text-align: center;
}

.referral-hero-limit strong {
  font-size: 1.15rem;
  line-height: 1.3;
}

.referral-link-panel,
.referral-section-label,
.referral-rule-strip,
.referral-stats,
.referral-policy,
.client-referral-list,
.referral-card-client > .form-status {
  margin-inline: 24px;
}

.referral-link-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-radius: 18px;
  background: #f8fbff;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.1);
}

.referral-link-panel span,
.referral-section-label span {
  color: #65717d;
  font-size: 0.78rem;
  font-weight: 850;
}

.referral-link-panel strong {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 5px;
  color: #101720;
  font-size: 0.94rem;
  line-height: 1.45;
}

.referral-link-panel small {
  display: block;
  margin-top: 6px;
  color: #65717d;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.5;
}

.referral-copy-status {
  grid-column: 1 / -1;
  min-height: 20px;
  margin: 0;
  color: #2563eb;
  font-size: 0.86rem;
  font-weight: 800;
}

.referral-link-panel[data-eligible="false"] {
  background: #fafbfc;
}

.referral-section-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  padding-top: 6px;
}

.referral-section-label strong {
  color: #101720;
  font-size: 1rem;
}

.referral-rule-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0;
}

.referral-benefit-item {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(30, 45, 70, 0.07), 0 14px 34px rgba(21, 35, 60, 0.055);
}

.referral-benefit-item > span,
.referral-benefit-pair small {
  color: #65717d;
  font-size: 0.8rem;
  font-weight: 850;
}

.referral-benefit-pair {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border-radius: 14px;
  background: #f7faff;
}

.referral-benefit-pair + .referral-benefit-pair {
  background: #f8fbf9;
}

.referral-benefit-pair strong {
  color: #2563eb;
  font-size: 1.06rem;
  line-height: 1.15;
}

.referral-benefit-pair + .referral-benefit-pair strong {
  color: #0f8f88;
}

.referral-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0;
}

.referral-stats article {
  display: grid;
  gap: 5px;
  padding: 16px;
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(30, 45, 70, 0.07);
}

.referral-stats span,
.referral-stats small {
  color: #65717d;
  font-size: 0.8rem;
  font-weight: 850;
}

.referral-stats strong {
  margin: 0;
  color: #101720;
  font-size: 1.32rem;
  line-height: 1.16;
}

.referral-policy {
  margin-top: 0;
  padding: 0;
  border-radius: 16px;
  background: #f5f8fc;
  box-shadow: inset 0 0 0 1px rgba(30, 45, 70, 0.06);
}

.referral-policy summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 16px;
  color: #101720;
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}

.referral-policy summary::-webkit-details-marker {
  display: none;
}

.referral-policy summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #eaf1ff;
  color: #2563eb;
}

.referral-policy[open] summary::after {
  content: "-";
}

.referral-policy p {
  margin: 0;
  padding: 0 16px 16px;
  color: #65717d;
  font-size: 0.9rem;
  line-height: 1.7;
}

.client-referral-list {
  margin-top: 0;
  margin-bottom: 24px;
}

.referral-empty {
  padding: 18px;
  border-radius: 18px;
  background: #fbfcfd;
  color: #65717d;
  box-shadow: inset 0 0 0 1px rgba(30, 45, 70, 0.06);
}

@media (max-width: 780px) {
  .referral-hero,
  .referral-link-panel,
  .referral-rule-strip,
  .referral-stats {
    grid-template-columns: 1fr;
  }

  .referral-hero,
  .referral-link-panel,
  .referral-section-label,
  .referral-rule-strip,
  .referral-stats,
  .referral-policy,
  .client-referral-list,
  .referral-card-client > .form-status {
    margin-inline: 18px;
  }

  .referral-hero {
    margin-inline: 0;
    padding: 20px 18px;
  }

  .referral-section-label {
    display: grid;
  }
}

.client-page {
  background: linear-gradient(180deg, #fbfaf8 0%, #fffefc 48%, #f6f7f5 100%);
}

.client-access-panel,
.client-card,
.client-hero,
.client-step,
.client-payment,
.client-contact,
.client-error,
.agreement-client-grid article,
.client-material,
.client-request,
.client-empty,
.referral-rule-strip span,
.referral-stats article,
.referral-policy,
.client-referral-row {
  border-color: rgba(229, 225, 220, 0.92);
  background: rgba(255, 254, 252, 0.94);
  box-shadow: 0 22px 64px rgba(28, 25, 23, 0.07);
}

.client-access-panel h1,
.client-hero h1,
.client-card h2,
.client-contact h2,
.client-next-action {
  color: #151515;
}

.client-journey-card,
.client-now,
.referral-link-box {
  background: linear-gradient(180deg, #1b2224 0%, #111617 100%);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 70px rgba(28, 25, 23, 0.12);
}

.client-journey-card .eyebrow,
.client-kicker,
.client-journey-steps span {
  color: var(--teal);
}

.client-journey-steps article {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.065);
}

.client-journey-steps p,
.client-now span,
.referral-link-box span {
  color: #cdd6d4;
}

.client-kicker,
.client-project-meta span,
.client-chip,
.client-step-index,
.client-payment-badge,
.referral-policy,
.client-request[data-status="done"] {
  background: #eef6f4;
}

.client-progress-fill {
  background: linear-gradient(90deg, var(--action), var(--teal));
}

.client-payment-badge[data-status="paid"] {
  background: #e8f5ef;
  color: var(--green);
}

.client-payment-badge[data-status="pending"] {
  background: #fff6df;
  color: #8a5b00;
}

/* Client portal simplification */
.client-page {
  color: #151515;
  background:
    radial-gradient(circle at 18% 8%, rgba(82, 108, 255, 0.14), transparent 32%),
    radial-gradient(circle at 86% 18%, rgba(25, 148, 173, 0.12), transparent 34%),
    linear-gradient(135deg, #f7f7ff 0%, #eff8ff 52%, #fffefd 100%);
}

.client-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.045) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 70%);
}

.client-shell {
  position: relative;
  z-index: 1;
  width: min(100% - 32px, 1040px);
  padding: 24px 0 48px;
}

.client-access {
  min-height: calc(100svh - 72px);
  align-content: center;
  gap: 18px;
}

.client-access > .brand {
  justify-self: center;
}

.client-access-simple {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  grid-template-columns: 1fr;
}

.client-access-panel,
.client-card,
.client-hero,
.client-step,
.client-payment,
.client-contact,
.client-error,
.agreement-client-grid article,
.client-material,
.client-request,
.client-empty,
.referral-rule-strip span,
.referral-stats article,
.referral-policy,
.client-referral-row {
  border: 0;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 54px rgba(21, 35, 60, 0.08);
}

.client-access-panel {
  padding: 28px;
  backdrop-filter: blur(18px);
}

.client-access-panel .eyebrow,
.client-card .eyebrow,
.client-contact .eyebrow {
  margin-bottom: 8px;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.client-access-panel h1 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.client-access-panel p {
  max-width: 520px;
  margin: 10px 0 0;
  color: #5f6872;
  font-size: 1rem;
  line-height: 1.7;
}

.client-token-form {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
  margin-top: 22px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 0 0 1px rgba(30, 45, 70, 0.08), 0 12px 30px rgba(21, 35, 60, 0.06);
}

.client-token-form label {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0 0 0 8px;
  color: #69737d;
  font-size: 0.78rem;
  font-weight: 800;
}

.client-token-form input {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(49, 87, 255, 0.22);
  border-radius: 10px;
  background:
    linear-gradient(180deg, #fbfdff 0%, #ffffff 100%) padding-box,
    linear-gradient(135deg, rgba(49, 87, 255, 0.32), rgba(15, 143, 136, 0.2)) border-box;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 10px 24px rgba(15, 23, 42, 0.045);
  font-size: 1rem;
}

.client-token-form input:focus {
  border-color: rgba(49, 87, 255, 0.58);
  outline: 4px solid rgba(49, 87, 255, 0.13);
  outline-offset: 2px;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(49, 87, 255, 0.22),
    0 14px 34px rgba(49, 87, 255, 0.12);
}

.client-token-form .button {
  min-height: 48px;
  white-space: nowrap;
}

.client-link-request {
  display: block;
  margin-top: 14px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: inset 0 0 0 1px rgba(30, 45, 70, 0.07);
}

.client-link-request summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.client-link-request summary::-webkit-details-marker {
  display: none;
}

.client-link-request summary::after {
  content: "+";
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #eef4ff;
  color: #2563eb;
  font-weight: 900;
}

.client-link-request[open] summary::after {
  content: "-";
}

.client-link-request summary span {
  display: grid;
  gap: 3px;
}

.client-link-request summary strong {
  color: #202833;
  font-size: 0.96rem;
}

.client-link-request summary em {
  color: #69737d;
  font-size: 0.86rem;
  font-style: normal;
  font-weight: 700;
}

.client-link-request-form {
  padding: 0 16px 16px;
}

.client-link-request-form .client-form-row,
.client-form-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.client-link-request-form label,
.client-upload-form label,
.client-request-form label,
.client-agreement-form label {
  font-size: 0.9rem;
}

.client-page .nav a[aria-current="page"] {
  color: var(--action);
  font-weight: 900;
}

.client-page .client-shell {
  padding-top: 112px;
}

.client-page .client-access {
  min-height: calc(100svh - 184px);
}

.client-page .client-topbar,
.client-page .client-error > .brand {
  display: none;
}

.client-journey-card {
  display: none;
}

.client-topbar {
  margin-bottom: 16px;
}

.client-topbar-actions {
  gap: 8px;
}

.client-hero {
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.48fr);
  gap: 18px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}

.client-hero h1 {
  max-width: 700px;
  font-size: clamp(1.72rem, 3.5vw, 2.65rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.client-kicker {
  margin-bottom: 10px;
  background: #eef4ff;
  color: #2563eb;
}

.client-project-meta {
  margin-top: 14px;
}

.client-project-meta span,
.client-chip {
  min-height: 28px;
  background: #f2f6fb;
  color: #485260;
  font-size: 0.84rem;
}

.client-now {
  gap: 12px;
  padding: 18px;
  background: linear-gradient(135deg, #f5f7ff 0%, #eef8ff 100%);
  color: #151515;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.client-now span,
.client-progress-number {
  color: #5f6872;
}

.client-now strong {
  font-size: 1.12rem;
  line-height: 1.35;
}

.client-progress-track {
  height: 9px;
  background: rgba(37, 99, 235, 0.12);
}

.client-progress-fill {
  background: linear-gradient(90deg, #2563eb, #6d5dfc);
}

.client-grid {
  gap: 14px;
  margin-top: 14px;
}

.client-card,
.client-contact {
  padding: 20px;
}

.client-card h2,
.client-contact h2 {
  font-size: 1.08rem;
  line-height: 1.25;
}

.client-next-action {
  margin-top: 10px;
  font-size: 1.04rem;
  line-height: 1.55;
}

.client-note {
  margin-top: 8px;
  font-size: 0.92rem;
  line-height: 1.65;
}

.client-payment {
  padding: 14px;
  box-shadow: none;
}

.client-step {
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 0 0 1px rgba(30, 45, 70, 0.06);
}

.client-step-index {
  width: 30px;
  height: 30px;
  background: #eef4ff;
  color: #2563eb;
}

.client-step[data-state="done"] .client-step-index,
.client-step[data-state="active"] .client-step-index {
  background: #2563eb;
}

.referral-link-box,
.referral-policy,
.client-request[data-status="done"] {
  background: #f5f8fc;
  color: #151515;
}

.referral-link-box span {
  color: #69737d;
}

.referral-rule-strip span,
.referral-stats article,
.client-referral-row,
.agreement-client-grid article,
.client-material,
.client-request,
.client-empty {
  box-shadow: inset 0 0 0 1px rgba(30, 45, 70, 0.06);
}

.client-contact {
  margin-top: 14px;
}

.client-error {
  max-width: 560px;
  padding: 28px;
}

.client-error h1 {
  font-size: clamp(1.65rem, 4vw, 2.35rem);
}

/* Access form final placement */
.client-token-form,
.client-unlock-form {
  grid-template-columns: minmax(170px, 0.85fr) minmax(220px, 1fr);
  align-items: end;
}

.client-token-form .button,
.client-unlock-form .button {
  grid-column: 2;
  justify-self: end;
  min-width: 158px;
  gap: 8px;
}

.client-token-form .button.is-loading,
.client-unlock-form .button.is-loading {
  opacity: 0.9;
  pointer-events: none;
}

.client-token-form .button.is-loading::before,
.client-unlock-form .button.is-loading::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 999px;
  animation: client-button-spin 0.78s linear infinite;
}

@media (max-width: 780px) {
  .client-shell {
    width: min(100% - 24px, 1040px);
    padding: 96px 0 36px;
  }

  .client-access {
    min-height: calc(100svh - 132px);
    gap: 14px;
  }

  .client-access-panel,
  .client-hero,
  .client-card,
  .client-contact,
  .client-error {
    padding: 18px;
  }

  .client-access-panel h1,
  .client-hero h1 {
    font-size: 1.65rem;
  }

  .client-token-form {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .client-token-form label {
    padding-left: 2px;
  }

  .client-token-form .button {
    grid-column: auto;
    justify-self: stretch;
    width: 100%;
  }

  .client-link-request summary {
    padding: 13px 14px;
  }

  .client-link-request-form .client-form-row,
  .client-form-row,
  .client-hero,
  .client-grid,
  .client-contact,
  .agreement-client-grid,
  .client-material,
  .referral-rule-strip,
  .referral-stats {
    grid-template-columns: 1fr;
  }

  .client-project-meta {
    gap: 6px;
  }

  .client-step {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .client-step-status {
    grid-column: 2;
  }
}
