.portal-body {
  min-height: 100vh;
  background:
    linear-gradient(rgba(23, 60, 52, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 60, 52, 0.045) 1px, transparent 1px),
    var(--paper);
  background-size: 48px 48px;
}

.portal-header {
  display: grid;
  height: 76px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 clamp(24px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(246, 243, 233, 0.9);
}

.portal-header.simple-header {
  grid-template-columns: 1fr auto;
}

.confirmation-main {
  display: grid;
  min-height: calc(100vh - 144px);
  padding: 60px 24px;
  place-items: center;
}

.confirmation-card,
.recovery-card {
  width: min(100%, 620px);
  padding: clamp(38px, 7vw, 72px);
  border: 1px solid var(--line);
  background: #fbfaf5;
  box-shadow: 0 28px 70px rgba(23, 60, 52, 0.08);
}

.confirmation-mark {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 34px;
  border-radius: 50%;
  background: var(--lime);
  place-items: center;
}

.confirmation-mark img {
  width: 27px;
  height: 27px;
}

.confirmation-card h1,
.recovery-card h1,
.download-heading h1 {
  margin: 18px 0 16px;
  font-size: clamp(40px, 6vw, 64px);
  letter-spacing: -0.055em;
  line-height: 1;
}

.confirmation-card > p,
.recovery-card > p,
.download-heading > p {
  max-width: 510px;
  margin: 0;
  color: #61746d;
  font-size: 14px;
  line-height: 1.7;
}

.purchase-progress {
  height: 5px;
  margin-top: 34px;
  overflow: hidden;
  background: #dfe2d8;
}

.purchase-progress span {
  display: block;
  width: 36%;
  height: 100%;
  background: var(--ink);
  animation: purchase-progress 1.25s ease-in-out infinite;
}

.purchase-progress[data-state="complete"] span {
  width: 100%;
  animation: none;
  background: #529178;
}

.purchase-progress[data-state="error"] span {
  width: 100%;
  animation: none;
  background: #b46c55;
}

@keyframes purchase-progress {
  from {
    transform: translateX(-105%);
  }

  to {
    transform: translateX(285%);
  }
}

.confirmation-retry {
  margin-top: 28px;
}

.download-main {
  max-width: 1040px;
}

.download-heading {
  max-width: 690px;
  margin-bottom: 54px;
}

.recommended-download {
  margin-top: 18px;
}

.recommended-download .download-card {
  min-height: 230px;
}

.other-downloads {
  margin-top: 30px;
  border-top: 1px solid var(--line);
}

.other-downloads > summary {
  width: max-content;
  padding: 22px 0 8px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.other-downloads .download-grid {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 18px;
}

.download-next {
  margin-top: 34px;
  padding: 22px 24px;
  border-left: 3px solid var(--lime);
  background: rgba(185, 224, 208, 0.24);
}

.download-next strong {
  font-size: 13px;
}

.download-next p {
  margin: 5px 0 0;
  color: #61746d;
  font-size: 11px;
}

.download-next .button {
  margin-top: 18px;
}

.device-code-entry {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(23, 60, 52, 0.14);
}

.device-code-entry summary {
  width: max-content;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.device-code-entry form {
  max-width: 430px;
  margin-top: 16px;
}

.device-code-entry label {
  display: block;
  margin-bottom: 7px;
  color: #71827c;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.device-code-entry form > div {
  display: flex;
}

.device-code-entry input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  outline: none;
}

.device-code-entry form button {
  padding: 0 16px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.download-next > [data-activation-status]:not(:empty) {
  margin-top: 14px;
  color: var(--ink);
  font-size: 10px;
}

.recovery-card form {
  margin-top: 34px;
}

.recovery-card label {
  display: block;
  margin-bottom: 9px;
  color: #71827c;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.recovery-card input {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  outline: none;
}

.recovery-card input:focus {
  border-color: var(--ink);
}

.recovery-card .button {
  width: 100%;
  margin-top: 12px;
}

.recovery-card .recovery-success {
  margin-top: 24px;
  padding: 14px 16px;
  background: rgba(185, 224, 208, 0.35);
  color: var(--ink);
  font-size: 11px;
}

.recovery-card .recovery-error {
  margin-top: 24px;
  color: #9f352b;
  font-size: 11px;
}

.support-link {
  justify-self: end;
  font-size: 11px;
  font-weight: 700;
  text-underline-offset: 4px;
}

.portal-main {
  max-width: 1220px;
  margin: 0 auto;
  padding: 78px 24px 110px;
}

.setup-intro {
  max-width: 720px;
  margin-bottom: 52px;
}

.setup-intro h1 {
  margin: 22px 0;
  font-size: clamp(52px, 6vw, 76px);
  font-weight: 600;
  line-height: 0.98;
}

.setup-intro > p {
  color: #62756e;
  font-size: 16px;
}

.step-kicker {
  color: #7c8b86;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.setup-notice {
  display: grid;
  grid-template-columns: 25px 1fr;
  gap: 10px;
  margin: 20px 0;
  padding: 16px;
  background: rgba(185, 224, 208, 0.27);
}

.setup-notice i {
  display: grid;
  width: 20px;
  height: 20px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  place-items: center;
  font-family: var(--serif);
  font-style: normal;
}

.setup-notice p {
  margin: 0;
  color: #597069;
  font-size: 10px;
  line-height: 1.65;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 32px;
}

.download-card {
  position: relative;
  display: flex;
  min-height: 190px;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--paper);
  text-decoration: none;
  transition:
    transform 160ms ease,
    border 160ms ease;
}

.download-card:hover {
  border-color: var(--ink);
  transform: translateY(-3px);
}

.download-card.recommended {
  border-color: var(--ink);
}

.recommend-pill {
  position: absolute;
  top: -18px;
  left: -1px;
  right: -1px;
  height: 18px;
  padding-top: 4px;
  background: var(--ink);
  color: var(--lime);
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.12em;
  text-align: center;
}

.os-mark {
  margin-bottom: 25px;
  font-family: var(--serif);
  font-size: 29px;
}

.os-mark.windows {
  font-family: var(--sans);
}

.download-card strong {
  font-size: 13px;
}

.download-card small {
  margin-top: 5px;
  color: #72827d;
  font-size: 8px;
}

.download-card > i {
  position: absolute;
  right: 18px;
  bottom: 18px;
  font-style: normal;
}

.manage-main {
  min-height: calc(100vh - 150px);
}

.manage-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(19, 50, 43, 0.08);
}

.manage-loading,
.manage-error {
  padding: 70px clamp(24px, 7vw, 90px);
  text-align: center;
}

.manage-error p {
  margin: 10px auto 25px;
  color: var(--muted);
}

.manage-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  padding: 38px clamp(24px, 5vw, 58px);
  border-bottom: 1px solid var(--line);
}

.manage-heading h2 {
  margin: 5px 0 0;
}

.manage-heading p {
  max-width: 390px;
  color: var(--muted);
  font-size: 13px;
}

.purchase-list {
  display: grid;
  gap: 18px;
  padding: clamp(20px, 4vw, 46px);
  background: var(--paper);
}

.purchase-card {
  min-width: 0;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.purchase-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
}

.purchase-card-header h3 {
  margin: 0 0 4px;
  overflow-wrap: anywhere;
  font-family: var(--serif);
  font-size: 28px;
}

.purchase-card-header p,
.purchase-card-details > span {
  color: var(--muted);
  font-size: 12px;
}

.purchase-card-details {
  display: flex;
  align-items: end;
  flex-direction: column;
  gap: 12px;
}

.secondary.compact {
  padding: 8px 11px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.secondary.compact:disabled {
  cursor: wait;
  opacity: 0.6;
}

.managed-license-key {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 24px 0;
  padding: 16px 18px;
  border-radius: 10px;
  background: var(--forest);
  color: #fff;
}

.managed-license-key code {
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 12px;
}

.managed-license-key button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--lime);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  cursor: pointer;
}

.session-lookup {
  display: flex;
  min-width: 0;
}

.session-lookup input {
  min-width: 0;
}

.managed-devices {
  border-top: 1px solid var(--line);
}

.managed-devices > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.managed-devices strong,
.managed-devices small {
  display: block;
}

.managed-devices small {
  margin-top: 4px;
  color: var(--muted);
}

.managed-devices .release-seat {
  flex: 0 0 auto;
}

@media (max-width: 850px) {
  .portal-header {
    grid-template-columns: 1fr auto;
  }

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

  .manage-heading,
  .purchase-card-header {
    align-items: start;
    flex-direction: column;
  }

  .purchase-card-details {
    align-items: start;
  }

  .managed-license-key {
    align-items: stretch;
    flex-direction: column;
  }

  .managed-license-key button {
    text-align: left;
  }
}

@media (max-width: 580px) {
  .support-link {
    font-size: 9px;
  }

  .portal-main {
    padding: 55px 14px 80px;
  }

  .confirmation-main {
    min-height: calc(100vh - 132px);
    padding: 30px 14px;
  }

  .confirmation-card,
  .recovery-card {
    padding: 34px 24px;
  }

  .purchase-card {
    padding: 22px;
  }

  .session-lookup {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .other-downloads .download-grid {
    grid-template-columns: 1fr;
  }

}

@media (prefers-reduced-motion: reduce) {
  .purchase-progress span {
    width: 55%;
    animation: none;
  }
}
