.brand-logo-compact {
  display: grid;
  width: 3rem;
  aspect-ratio: 1 / 1;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 207, 245, 0.48);
  border-radius: 0.85rem 0.85rem 0.85rem 0.22rem;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 20px rgba(0, 225, 255, 0.22);
  overflow: hidden;
}

.brand-logo-compact img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.site-nav .account-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.account-link svg {
  width: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.contact-panel a.contact-row {
  color: inherit;
  text-decoration: none;
}

.footer-links a {
  color: inherit;
  text-decoration: none;
}

.footer-links a:hover {
  color: #007f9f;
}

.footer-brand-visual {
  display: block;
  width: clamp(8rem, 12vw, 10rem);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  box-shadow: 0 0 32px rgba(0, 225, 255, 0.2);
}

.footer-brand-visual picture {
  display: block;
  width: 100%;
}

.footer-brand-visual img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: inherit;
}

.portal-page {
  min-width: 0;
  background:
    linear-gradient(90deg, rgba(0, 207, 245, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(0, 207, 245, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 78% 8%, rgba(32, 223, 255, 0.16), transparent 22rem),
    #fafeff;
  background-size: 56px 56px, 56px 56px, auto, auto;
}

.portal-page .site-header {
  position: sticky;
  top: 0;
}

.portal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.portal-main {
  position: relative;
  min-height: calc(100vh - 9rem);
  overflow: hidden;
  padding: clamp(4rem, 8vw, 7.5rem) 0 clamp(5rem, 9vw, 8rem);
}

.portal-main::before,
.portal-main::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.portal-main::before {
  inset: 1.5rem auto auto -8rem;
  width: 25rem;
  height: 25rem;
  border: 1px solid rgba(0, 207, 245, 0.22);
  border-radius: 50%;
  box-shadow: 0 0 60px rgba(0, 225, 255, 0.08);
}

.portal-main::after {
  right: 8%;
  top: 6rem;
  width: 28%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00dffb, transparent);
  box-shadow: 0 0 16px rgba(0, 225, 255, 0.65);
}

.portal-shell {
  position: relative;
  z-index: 1;
}

.portal-intro {
  max-width: 48rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.portal-intro h1 {
  max-width: 14ch;
  margin: 0.5rem 0 1rem;
  color: #061b2a;
  font-family: Bahnschrift, "Segoe UI Variable", "Segoe UI", sans-serif;
  font-size: clamp(2.7rem, 7vw, 5.8rem);
  font-weight: 420;
  letter-spacing: -0.055em;
  line-height: 0.94;
}

.portal-intro > p:last-child {
  max-width: 42rem;
  color: #3c6271;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
}

.demo-banner,
.info-banner,
.warning-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  margin: 0 0 1.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(0, 199, 237, 0.42);
  border-radius: 0.8rem 0.8rem 0.8rem 0.2rem;
  color: #174253;
  background: rgba(245, 253, 255, 0.94);
  box-shadow: inset 0 1px 0 #fff, 0 12px 28px rgba(4, 48, 66, 0.07);
}

.demo-banner::before,
.info-banner::before,
.warning-banner::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  margin-top: 0.35rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #00dffb;
  box-shadow: 0 0 14px rgba(0, 225, 255, 0.75);
}

.warning-banner {
  border-color: rgba(246, 166, 35, 0.44);
  background: rgba(255, 251, 240, 0.96);
}

.warning-banner::before {
  background: #f6a623;
  box-shadow: 0 0 12px rgba(246, 166, 35, 0.4);
}

.portal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(17rem, 0.7fr);
  gap: clamp(1.25rem, 3vw, 2rem);
  align-items: start;
}

.portal-grid-balanced {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-panel {
  position: relative;
  min-width: 0;
  padding: clamp(1.35rem, 3vw, 2.3rem);
  border: 1px solid rgba(0, 199, 237, 0.45);
  border-radius: 1.35rem 1.35rem 1.35rem 0.28rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(238, 251, 254, 0.92));
  box-shadow:
    inset 0 1px 0 #fff,
    0 22px 60px rgba(8, 70, 94, 0.1),
    0 0 34px rgba(0, 225, 255, 0.09);
}

.portal-panel::before {
  content: "";
  position: absolute;
  inset: 0.6rem;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: calc(1.35rem - 0.25rem);
}

.portal-panel > * {
  position: relative;
}

.portal-panel h2,
.portal-panel h3 {
  color: #102f3f;
}

.portal-panel h2 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
}

.portal-panel h3 {
  margin: 0.25rem 0 0.55rem;
  font-size: 1.08rem;
}

.portal-panel p {
  color: #466977;
}

.portal-aside {
  display: grid;
  gap: 1rem;
}

.logo-panel {
  display: grid;
  place-items: center;
  min-height: 18rem;
  background: rgba(255, 255, 255, 0.86);
}

.logo-panel picture {
  display: block;
  width: min(100%, 17rem);
}

.logo-panel img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: 50%;
  filter: drop-shadow(0 0 20px rgba(0, 225, 255, 0.2));
}

.form-progress {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.15rem;
  color: #075a72;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.form-progress::before {
  content: "";
  width: 2.8rem;
  height: 2px;
  background: linear-gradient(90deg, #00dffb, #348dff);
  box-shadow: 0 0 12px rgba(0, 225, 255, 0.55);
}

[hidden] {
  display: none !important;
}

.form-step > header {
  margin-bottom: 1.6rem;
}

.form-step > header p {
  margin-bottom: 0;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem 1rem;
}

.field,
.choice-group {
  display: grid;
  align-content: start;
  gap: 0.45rem;
  min-width: 0;
}

.field-wide {
  grid-column: 1 / -1;
}

.field label,
.choice-group legend {
  color: #153a4a;
  font-weight: 650;
}

.field label small,
.choice-group legend small {
  color: #5a7b88;
  font-weight: 450;
}

.required-mark {
  color: #007f9f;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 3.15rem;
  padding: 0.72rem 0.9rem;
  border: 1px solid rgba(37, 123, 153, 0.32);
  border-radius: 0.68rem 0.68rem 0.68rem 0.16rem;
  color: #102f3f;
  background: rgba(255, 255, 255, 0.96);
  font: inherit;
  box-shadow: inset 0 1px 2px rgba(14, 75, 97, 0.04);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field textarea {
  min-height: 8rem;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.choice-card:focus-within {
  outline: none;
  border-color: #00cfea;
  box-shadow: 0 0 0 4px rgba(0, 207, 234, 0.14), 0 0 18px rgba(0, 225, 255, 0.12);
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"],
.choice-card input[aria-invalid="true"] + span {
  border-color: #b84c63;
}

.field-hint {
  margin: 0;
  color: #5a7b88;
  font-size: 0.84rem;
}

.field-error,
.form-error {
  min-height: 1.1em;
  margin: 0;
  color: #9b2f47;
  font-size: 0.84rem;
  font-weight: 620;
}

.form-error {
  margin-top: 1rem;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.choice-card,
.check-card {
  display: flex;
  align-items: flex-start;
  gap: 0.72rem;
  min-height: 3.15rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid rgba(37, 123, 153, 0.25);
  border-radius: 0.68rem 0.68rem 0.68rem 0.16rem;
  color: #224a5b;
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
}

.choice-card input,
.check-card input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.05rem 0 0;
  flex: 0 0 auto;
  accent-color: #00bedc;
}

.check-card-critical {
  border-color: rgba(0, 199, 237, 0.5);
  background: linear-gradient(120deg, rgba(255,255,255,.98), rgba(229,250,254,.94));
}

.form-actions,
.card-actions,
.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.form-actions {
  justify-content: space-between;
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(37, 123, 153, 0.16);
}

.button-small {
  min-height: 2.6rem;
  padding: 0.62rem 0.9rem;
  font-size: 0.85rem;
}

button.button {
  border: 0;
  font: inherit;
  font-weight: 690;
  cursor: pointer;
}

button.button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.text-button {
  padding: 0;
  border: 0;
  color: #08738d;
  background: none;
  font: inherit;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.review-list,
.profile-list,
.compact-facts {
  display: grid;
  gap: 0;
  margin: 1.25rem 0;
}

.review-list > div,
.profile-list > div,
.compact-facts > div {
  display: grid;
  grid-template-columns: minmax(8rem, 0.4fr) minmax(0, 1fr);
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(37, 123, 153, 0.14);
}

.review-list dt,
.profile-list dt,
.compact-facts dt {
  color: #587985;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.review-list dd,
.profile-list dd,
.compact-facts dd {
  margin: 0;
  color: #173a49;
  font-weight: 620;
  overflow-wrap: anywhere;
}

.result-panel {
  padding: clamp(1.6rem, 4vw, 3rem);
  text-align: center;
}

.result-icon {
  display: grid;
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 1.2rem;
  place-items: center;
  border: 1px solid #00cfea;
  border-radius: 50%;
  color: #075a72;
  background: #fff;
  box-shadow: 0 0 30px rgba(0, 225, 255, 0.35);
  font-size: 1.8rem;
}

.request-reference {
  display: inline-block;
  max-width: 100%;
  margin: 0.8rem 0 1.4rem;
  padding: 0.45rem 0.7rem;
  border-radius: 0.35rem;
  color: #234858;
  background: #e8f9fc;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.auth-card {
  max-width: 42rem;
  margin-inline: auto;
}

.auth-brand {
  display: block;
  width: 7rem;
  height: auto;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  margin: 0 auto 1.4rem;
  border-radius: 50%;
  box-shadow: 0 0 28px rgba(0, 225, 255, 0.23);
}

.portal-tabs {
  display: flex;
  gap: 0.55rem;
  margin: 0 0 1.6rem;
  padding: 0.35rem;
  border: 1px solid rgba(37, 123, 153, 0.2);
  border-radius: 999px;
  background: rgba(235, 250, 253, 0.75);
}

.portal-tabs a {
  flex: 1;
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  color: #426673;
  text-align: center;
  text-decoration: none;
  font-weight: 650;
}

.portal-tabs a[aria-current="page"] {
  color: #092d3c;
  background: #fff;
  box-shadow: 0 8px 22px rgba(8, 70, 94, 0.08), 0 0 16px rgba(0, 225, 255, 0.12);
}

.dashboard-grid,
.admin-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.dashboard-grid .portal-panel:first-child {
  grid-column: 1 / -1;
}

.appointment-list,
.admin-list {
  display: grid;
  gap: 0.9rem;
}

.appointment-card,
.admin-list-item {
  padding: 1.15rem;
  border: 1px solid rgba(0, 199, 237, 0.28);
  border-radius: 0.9rem 0.9rem 0.9rem 0.2rem;
  background: rgba(255, 255, 255, 0.83);
}

.appointment-card > div:first-child,
.admin-list-item > div:first-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid rgba(0, 199, 237, 0.42);
  border-radius: 999px;
  color: #075a72;
  background: #edfbfd;
  font-size: 0.76rem;
  font-weight: 750;
}

.status-chip::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: #00cfe9;
  box-shadow: 0 0 8px rgba(0, 225, 255, 0.65);
}

.status-chip[data-status="ready"],
.status-chip[data-status="completed"] {
  color: #176447;
  border-color: rgba(43, 164, 113, 0.34);
  background: #effbf5;
}

.micro-label {
  color: #678590;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.inline-note {
  color: #6c6974;
  font-size: 0.8rem;
  font-weight: 620;
}

.health-question {
  margin: 0 0 1.35rem;
  padding: 0 0 1.35rem;
  border: 0;
  border-bottom: 1px solid rgba(37, 123, 153, 0.15);
}

.health-question legend {
  max-width: 62rem;
  margin-bottom: 0.8rem;
  color: #173a49;
  font-weight: 650;
}

.health-question .choice-grid {
  grid-template-columns: repeat(3, minmax(0, 9rem));
}

.health-question .field {
  margin-top: 0.7rem;
}

.privacy-note {
  padding: 1.1rem;
  border-left: 3px solid #00cfea;
  color: #365d6d;
  background: rgba(232, 249, 252, 0.72);
}

.consent-stack {
  display: grid;
  gap: 0.7rem;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.summary-tile {
  padding: 1rem;
  border: 1px solid rgba(0, 199, 237, 0.28);
  border-radius: 0.75rem 0.75rem 0.75rem 0.18rem;
  background: rgba(255, 255, 255, 0.82);
}

.summary-tile strong,
.summary-tile span {
  display: block;
}

.summary-tile strong {
  color: #0b3c50;
  font-size: 1.7rem;
}

.summary-tile span {
  margin-top: 0.25rem;
  color: #5b7b87;
  font-size: 0.76rem;
}

.admin-list-item .compact-facts {
  margin: 0.75rem 0;
}

.admin-list-item .compact-facts > div {
  grid-template-columns: 7rem 1fr;
  padding: 0.45rem 0;
}

dialog {
  width: min(42rem, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 1px solid rgba(0, 199, 237, 0.5);
  border-radius: 1.2rem 1.2rem 1.2rem 0.25rem;
  color: #173a49;
  background: #faffff;
  box-shadow: 0 30px 90px rgba(2, 33, 47, 0.24), 0 0 38px rgba(0, 225, 255, 0.18);
}

dialog::backdrop {
  background: rgba(4, 25, 37, 0.38);
  backdrop-filter: blur(5px);
}

.dialog-inner {
  padding: clamp(1.3rem, 4vw, 2rem);
  overflow: auto;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.dialog-close {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(0, 199, 237, 0.35);
  border-radius: 50%;
  color: #123b4c;
  background: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

.legal-layout {
  display: grid;
  grid-template-columns: minmax(12rem, 0.3fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}

.legal-nav {
  position: sticky;
  top: 7rem;
  display: grid;
  gap: 0.35rem;
}

.legal-nav a {
  padding: 0.65rem 0.8rem;
  border-left: 2px solid rgba(0, 199, 237, 0.28);
  color: #436a78;
  text-decoration: none;
}

.legal-copy {
  padding: clamp(1.35rem, 4vw, 3rem);
}

.legal-copy section + section {
  margin-top: 2.2rem;
}

.legal-copy h2 {
  margin-bottom: 0.75rem;
  font-size: clamp(1.25rem, 3vw, 1.8rem);
}

.legal-copy li + li {
  margin-top: 0.45rem;
}

.legal-meta {
  margin-bottom: 2rem;
  color: #527583;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.78rem;
}

.portal-footer {
  border-top: 1px solid rgba(0, 199, 237, 0.22);
  color: #557784;
  background: rgba(255, 255, 255, 0.92);
}

.portal-footer .shell {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.4rem;
}

.portal-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.portal-footer a {
  color: #315f70;
}

@media (max-width: 1060px) {
  .admin-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .portal-page .site-header {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .portal-page .site-nav {
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #f7fdff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .portal-grid,
  .portal-grid-balanced,
  .dashboard-grid,
  .admin-columns,
  .legal-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-grid .portal-panel:first-child {
    grid-column: auto;
  }

  .legal-nav {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-header-actions .button {
    display: none;
  }
}

@media (max-width: 640px) {
  .portal-main {
    padding-top: 3rem;
  }

  .portal-intro h1 {
    font-size: clamp(2.55rem, 14vw, 4.2rem);
  }

  .field-grid,
  .choice-grid,
  .health-question .choice-grid,
  .admin-summary,
  .legal-nav {
    grid-template-columns: 1fr;
  }

  .review-list > div,
  .profile-list > div,
  .compact-facts > div {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .form-actions .button {
    width: 100%;
    justify-content: center;
  }

  .portal-panel {
    padding: 1.1rem;
    border-radius: 1rem 1rem 1rem 0.22rem;
  }

  .portal-tabs {
    border-radius: 1rem;
  }

  .portal-tabs a {
    padding-inline: 0.55rem;
  }

  .footer-brand-visual {
    width: 7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .field input,
  .field select,
  .field textarea {
    transition: none;
  }
}
