.customer-portal-page {
  min-height: 100vh;
  font-size: 14px;
}

.customer-portal-page,
.customer-portal-page input,
.customer-portal-page button,
.customer-portal-page a,
.customer-portal-page select,
.customer-portal-page textarea {
  font-weight: 400;
}

.customer-portal-page p,
.customer-portal-page label,
.customer-portal-page input,
.customer-portal-page select,
.customer-portal-page button,
.customer-portal-page a,
.customer-portal-page td,
.customer-portal-page th,
.customer-portal-page span,
.customer-portal-page small,
.customer-portal-page code,
.customer-portal-page dd,
.customer-portal-page dt {
  font-size: 12px;
}

.customer-portal-page h1,
.customer-portal-page h2 {
  font-weight: 800;
}

.customer-portal-page [hidden] {
  display: none !important;
}

.customer-shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

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

.customer-topbar h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent, #ffd21f);
  font-weight: 800;
  letter-spacing: 0;
}

.portal-panel,
.balance-panel {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(12, 12, 16, 0.76);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.24);
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 1fr);
  gap: 24px;
  align-items: start;
}

.panel-copy h2,
.portal-panel h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
}

.panel-copy p,
.next-panel p {
  margin: 0;
  color: var(--muted-text, #bfc0c7);
}

.portal-form {
  display: grid;
  gap: 14px;
}

.portal-form label {
  display: grid;
  gap: 7px;
  font-weight: 500;
}

.portal-form input {
  width: 100%;
  min-height: 46px;
}

.primary-btn,
.ghost-btn {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
}

.primary-btn {
  background: var(--primary, #e11d24);
  color: #fff;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text, #fff);
  border-color: rgba(255, 255, 255, 0.2);
  padding: 0 16px;
}

.button-pair {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.portal-notice {
  margin-bottom: 16px;
  border: 1px solid rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.12);
  color: #d8ffe4;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 500;
}

.portal-notice.is-error {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.14);
  color: #ffe0e0;
}

.portal-notice a,
.portal-footer a {
  color: var(--accent, #ffd21f);
  font-weight: 800;
  text-decoration: none;
}

.portal-notice a:hover,
.portal-footer a:hover {
  text-decoration: underline;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  min-width: 0;
}

.balance-panel {
  grid-column: span 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
  min-height: 138px;
  align-content: center;
  align-items: center;
}

.metric-label,
.metric-sub {
  color: var(--muted-text, #bfc0c7);
  font-weight: 400;
}

.balance-panel strong {
  font-size: 42px;
  line-height: 1;
  grid-column: 1 / -1;
}

.balance-panel .metric-label,
.balance-panel .metric-sub {
  grid-column: 1;
}

.refresh-btn {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
}

.refresh-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.refresh-btn.is-loading svg,
.portal-spinner {
  animation: portal-spin 0.8s linear infinite;
}

.portal-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: var(--accent, #ffd21f);
  border-radius: 50%;
}

.balance-panel strong.is-loading {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
}

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

.profile-lines {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
}

.profile-lines p {
  margin: 0;
  font-weight: 400;
  word-break: break-word;
  color: var(--muted-text, #bfc0c7);
}

.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-row h2 {
  margin: 0;
}

.section-title-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.card-vehicle-select {
  width: auto;
  min-width: 130px;
  max-width: 180px;
  min-height: 34px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 13px;
}

.section-row span {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  min-height: 32px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 600;
}

.vehicle-list {
  display: grid;
  gap: 10px;
}

.vehicle-row {
  display: grid;
  grid-template-columns: minmax(105px, auto) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.vehicle-row:first-child {
  border-top: 0;
}

.vehicle-row small,
.empty-text {
  color: var(--muted-text, #bfc0c7);
}

.vehicle-row small {
  justify-self: end;
  font-weight: 400;
  white-space: nowrap;
}

.vehicle-row strong {
  font-weight: 600;
}

.digital-card-preview {
  width: min(100%, 340px);
  margin: 0 auto;
}

.customer-card-live {
  display: block;
  width: 100%;
  min-height: 215px;
  border-radius: 8px;
  padding: 10px 0;
}

.card-note,
.portal-footer {
  color: var(--muted-text, #bfc0c7);
}

.card-note {
  margin: 10px 0 0;
  text-align: center;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.download-btn {
  display: inline-grid;
  place-items: center;
  width: 100%;
  height: 28px;
  min-height: 28px;
  padding: 0 10px;
  text-decoration: none;
}

.latest-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.latest-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
}

.latest-table th,
.latest-table td {
  padding: 8px 10px 8px 0;
  border: 0;
  white-space: nowrap;
}

.latest-table th {
  color: var(--accent, #ffd21f);
  font-weight: 600;
  padding-left: 10px;
}

.latest-table td,
.customer-portal-page .latest-table tbody td {
  font-weight: 400;
  text-align: left;
  padding-left: 10px;
}

.latest-table td:last-child,
.customer-portal-page .latest-table tbody td:last-child {
  text-align: right;
}

.latest-type-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
  line-height: 1.1;
}

.latest-type-pill.is-earn {
  color: #bbf7d0;
  border: 1px solid rgba(34, 197, 94, 0.28);
  background: rgba(34, 197, 94, 0.14);
}

.latest-type-pill.is-redeem {
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.30);
  background: rgba(248, 113, 113, 0.14);
}

.empty-text.is-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.portal-footer {
  margin-top: 18px;
  text-align: center;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  padding: 0 12px;
}

@media (max-width: 760px) {
  .customer-shell {
    width: min(100% - 20px, 640px);
    padding-top: 18px;
  }

  .customer-topbar h1 {
    font-size: 24px;
  }

  .login-panel,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .balance-panel {
    grid-column: span 1;
    grid-template-columns: 1fr;
  }

  .balance-panel strong {
    font-size: 36px;
  }

  .refresh-btn {
    grid-column: 1;
    grid-row: auto;
    width: 38px;
    justify-self: start;
  }

  .button-pair {
    grid-template-columns: 1fr;
  }

  .vehicle-row {
    grid-template-columns: minmax(92px, 100px) minmax(70px, 90px) max-content;
    justify-content: start;
    gap: 12px;
  }

  .digital-card-preview {
    width: min(100%, 300px);
  }
}
