* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --light-blue: #d9e5f9;
  --lighter-blue: #eff4fd;
  --shadow-blue: #aac7f1;
  --dark-blue: #242a7a;
  --navy: #375da1;
  --blue: #5172ad;
  --dark-grey: #494949;
  --light-grey: #85888e;
  --lightest-grey: #85888e47;
  --green: #097969;
  --light-green: #afe1af;
  --lightest-green: #edf6f7;
  --black: #191919;
  --red: #ec6a5e;
  --dark-red: #e53935;
  --light-red: #f8d8e5;
  --indigo: #35428c;
  --light-purple: #e9e9fa;
  --almost-white: #f9f9f9;
  --sidebar-w: 235px;
  --topbar-h: 100px;
  --icon-col: 56px;
  --icon-h: 28px;
  --w-small: clamp(6ch, 3vw, 16ch);
  --w-mid: clamp(16ch, 10vw, 30ch);
  --w-long: clamp(24ch, 36vw, 46ch);
  --w-cta: clamp(10ch, 14vw, 18ch);
  --DM-Sans: "DM Sans", Arial, sans-serif;
}

#nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 2;
}

.nav-upper {
  padding: 1rem 0;
  width: 100%;
  border-bottom: 3px var(--dark-blue) solid;
  display: flex;
  justify-content: center;
}

.nav-logo {
  width: 18rem;
}

body {
  font-family: "DM Sans", sans-serif;
  background: #f6f7fb;
  margin: 0;
  color: var(--dark-grey);
}

.portal-blob-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.portal-blob-blur {
  width: 100%;
  height: 100%;
  filter: blur(90px);
  opacity: 0.7;
}

.portal-blob {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 20%, #9cc6ff, #5a86d6 45%, #2f4ea1 80%);
  transition: clip-path 2.4s ease-in-out;
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
}

.portal-blob-layer--failed .portal-blob {
  background: radial-gradient(circle at 20% 20%, #ff6b80, #e60026 45%, #b8001e 80%);
}

.portal {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 8rem;
  position: relative;
  z-index: 1;
}

.portal-finished {
  margin-top: 3rem;
  padding: 0 1.5rem 4rem;
}

.portal-finished-card {
  width: min(900px, 100%);
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  border-radius: 32px;
  border: 1px solid var(--lightest-grey);
  padding: 3.5rem 4rem;
  box-shadow: 0 18px 40px rgba(36, 42, 122, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.portal-finished-icon img {
  width: 96px;
  height: auto;
  display: block;
}

.portal-finished-divider {
  width: min(60%, 420px);
  border: 1px solid var(--lightest-grey);
}

.portal-finished-title {
  color: var(--navy);
  font-size: 1.5rem;
  font-weight: 700;
}

.portal-finished-text {
  max-width: 560px;
  text-align: left;
  color: var(--dark-grey);
  line-height: 1.5;
}

.portal-finished-actions {
  width: 100%;
  display: flex;
  justify-content: flex-end;
}

.portal-finished-button {
  background: #2f4ea1;
  color: #fff;
  border-radius: 10px;
  padding: 10px 2.5rem;
  text-decoration: none;
  font-weight: 400;
  font-size: 13.3333px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
}

.portal-results-card {
  width: min(880px, 100%);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-radius: 32px;
  padding: 3rem;
  box-shadow: 0 18px 40px rgba(36, 42, 122, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.portal-results-summary {
  border: 1px solid var(--lightest-grey);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
}

.portal-results-title {
  background: #f2f8f7;
  border-radius: 24px 24px 0 0;
  padding: 1.15rem 2rem;
  border-bottom: 1px solid var(--lightest-grey);
  font-size: 1.4rem;
  color: var(--dark-grey);
  margin: 0;
}

.portal-results-grid {
  padding: 1.15rem 2rem;
  display: grid;
  gap: 0.5rem;
  color: var(--dark-grey);
}

.portal-results-grid div strong {
  font-size: 1.15rem;
}

.portal-results-score {
  font-size: 1.1rem;
}

.portal-results-actions {
  display: flex;
  justify-content: flex-end;
}

.portal-section-breakdown h2 {
  margin: 0 0 1rem;
}

.approved {
  color: var(--green)!important;
}

.not-approved {
  background-color: #E60026;
  color: var(--lighter-blue);
}

.unapproved {
  color: var(--dark-red)!important;
}

.portal-section-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.portal-section-item {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e1e6f5;
  overflow: hidden;
}

.portal-section-item > .portal-section-questions {
  display: block;
}

.portal-section-item:not([open]) .portal-section-questions {
  pointer-events: none;
}

.portal-section-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.2rem;
  cursor: pointer;
  list-style: none;
  width: 100%;
  background: transparent;
  border: 0;
  text-align: left;
  font: inherit;
}

.portal-section-summary::-webkit-details-marker {
  display: none;
}

.portal-section-summary-right {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.portal-section-title {
  font-weight: 700;
  color: var(--dark-grey);
}

.portal-section-score {
  color: #5b6785;
  font-weight: 600;
}

.portal-section-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #5b6785;
  transition: transform 0.2s ease;
}

.portal-section-item[open] .portal-section-chevron {
  transform: rotate(180deg);
}

.portal-section-item.is-open .portal-section-chevron {
  transform: rotate(180deg);
}

.portal-section-bar {
  height: 6px;
  background: #e6e9f2;
  margin: 0 1.2rem 0.8rem;
  border-radius: 999px;
  overflow: hidden;
}

.portal-section-bar span {
  display: block;
  height: 100%;
  background: #7f97d5;
  border-radius: inherit;
}

.portal-section-questions {
  padding: 0.8rem 1.2rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  height: 0;
  opacity: 0;
  transform: translateY(-6px);
  overflow: hidden;
  transition: height 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease,
    transform 0.4s ease;
  will-change: height, opacity, transform;
}

.portal-question-item {
  background: #f4f6fb;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.portal-question-item:last-child {
  margin: 0;
}

.portal-question-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 600;
  color: var(--dark-grey);
}

.portal-question-status {
  font-size: 0.9rem;
  color: #6a7287;
}

.portal-answer-block {
  font-size: 0.95rem;
  color: #5c6478;
}

.card {
  max-width: 900px;
  width: min(900px, 100%);
  display: flex;
  border-radius: 25px;
  mask-clip: var(--black);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

.card > div {
  padding: 3rem;
  border: 1px solid var(--lightest-grey);
  border-radius: 25px;
}

.card .card-data {
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px);
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

#portal-content {
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background-color: white;
  border-left: 1px solid transparent;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  transition: height 0.28s ease, border-radius 0.28s ease, border-color 0.28s ease;
  will-change: height;
}

#portal-content.is-resizing {
  overflow: hidden;
}

.portal-step {
  animation: portalFadeIn 0.28s ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.portal-step-access {
  animation: none;
}

.portal-step-identify {
  animation: none;
}

.portal-step-valid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.portal-status {
  position: relative;
  width: 36px;
  height: 36px;
}

.portal-loader {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 3px solid var(--lightest-grey);
  border-top-color: var(--navy);
  animation: portalSpin 0.55s linear infinite, portalFadeOut 0.2s ease 0.55s forwards;
}

.portal-check {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.6);
  animation: portalCheckIn 0.2s ease 0.55s forwards;
}

.portal-check-icon {
  width: 36px;
  height: 36px;
}

hr {
  border: 1px solid var(--lightest-grey);
  border-top: none;
  margin: 0;
}

.card-data {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: var(--dark-grey);
  overflow: hidden;
  transition: width 0.32s ease, padding 0.32s ease, opacity 0.2s ease, border-color 0.2s ease;
}

.portal.portal-instructions .card-data {
  padding: 0;
  opacity: 0;
  border: 0;
  background-color: transparent;
  pointer-events: none;
  max-width: 0;
  min-width: 0;
  height: 0;
  min-height: 0;
  max-height: 0;
}

.portal.portal-instructions .card {
  align-items: flex-start;
}

.portal.portal-instructions #portal-content {
  border-top-left-radius: 25px;
  border-bottom-left-radius: 25px;
  border-color: var(--lightest-grey);
}

.card-data > p {
  font-weight: 300;
}

.card-data > p strong {
  font-weight: 600;
}

.card-data ul,
.portal-list {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  list-style: none;
}

ul.portal-list {
  gap: 1.1rem;
}

.card-data ul li,
.portal-list li {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 10pt;
}

.portal-list li {
  font-size: 10pt;
}

.card-data img,
.portal-list img {
  width: 25px;
}

.portal-step-continue h1 {
  text-align: center;
}

.portal-step-continue h2 {
  margin-top: 1rem;
}

.portal-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.portal-form label {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 8pt;
}

.portal-list {
  margin: 16px 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.portal-meta {
  margin-bottom: 16px;
}

.portal-form input {
  width: 100%;
  font-family: "DM Sans", sans-serif;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #d7dbe7;
  font-size: 14px;
}

@supports (-webkit-touch-callout: none) {
  .portal-form input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
    background-color: #fff;
    color: var(--dark-grey);
    text-align: left;
    padding-right: 36px;
    font-size: 16px;
    line-height: 1.2;
  }

  .portal-form input[type="date"]::-webkit-date-and-time-value,
  .portal-form input[type="date"]::-webkit-datetime-edit,
  .portal-form input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    text-align: left;
    color: inherit;
  }

  .portal-form input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0.7;
  }
}

.portal-form input:focus {
  outline: none;
  border: 1px solid var(--shadow-blue);
}

.portal-form button,
.portal-button {
  display: inline-block;
  font-family: var(--DM-Sans);
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: #2f4ea1;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}

@keyframes portalFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes portalSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes portalFadeOut {
  to {
    opacity: 0;
  }
}

@keyframes portalCheckIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.identify-button {
  margin-top: 0.5rem;
}

.portal-error {
  color: #b91c1c;
  font-size: 13px;
}

@media (max-width: 768px) {
  main.portal {
    margin: 3rem 0;
    padding: 10px;
  }

  main.portal .card {
    flex-direction: column;
    box-shadow: none;
  }

  main.portal .card-data,
  main.portal #portal-content {
    border-radius: 25px;
  }

  main.portal #portal-content {
    margin-top: 1rem;
    border-left: 1px solid var(--lightest-grey);
  }

  .portal-results-card {
    padding: 3rem 1.5rem;
  }
}
