:root {
  color-scheme: light;
  --ink: #18374c;
  --muted: #586e7a;
  --teal: #007b80;
  --teal-hover: #006469;
  --mist: #edf4f6;
  --line: #d5e1e6;
  --white: #fff;
  --error: #933d35;
  --body-font: "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --display-font: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-family: var(--body-font);
  font-size: 16px;
  color: var(--ink);
  background: var(--mist);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  min-width: 280px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 78% 8%, #dbeeed 0%, transparent 48%),
    linear-gradient(135deg, #f5f8fa, var(--mist) 55%, #e4eef3);
  -webkit-text-size-adjust: 100%;
}

body::before,
body::after {
  position: fixed;
  z-index: 0;
  content: "";
  pointer-events: none;
  width: min(110vw, 1380px);
  height: min(90vw, 900px);
  border: 1px solid rgb(53 126 144 / 10%);
  border-radius: 50%;
  transform: rotate(-24deg);
}

body::before {
  right: -36%;
  top: -24%;
}

body::after {
  left: -54%;
  bottom: -37%;
  border-width: 32px;
  border-color: rgb(255 255 255 / 30%);
}

button,
input {
  font: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

a {
  color: var(--teal-hover);
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

.portal-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 40px 20px 28px;
}

.portal-card {
  width: 100%;
  max-width: 440px;
  padding: 38px 34px 25px;
  border: 1px solid rgb(255 255 255 / 90%);
  border-radius: 22px;
  background: var(--white);
  box-shadow: 0 24px 70px -24px rgb(33 75 100 / 22%), 0 2px 8px rgb(33 75 100 / 3%);
}

.card-header {
  text-align: center;
}

.brand {
  display: block;
  font-family: var(--display-font);
  font-size: 29px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: 0.15em;
  text-indent: 0.15em;
  color: var(--ink);
}

.brand-logo {
  display: block;
  max-width: 188px;
  max-height: 72px;
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

.brand-accent {
  display: block;
  width: 32px;
  height: 3px;
  margin: 18px auto 28px;
  border-radius: 2px;
  background: var(--teal);
}

h1 {
  margin: 0;
  font-family: var(--display-font);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.intro {
  margin: 10px 0 28px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.form-field + .form-field {
  margin-top: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

input:not([type="hidden"]) {
  display: block;
  width: 100%;
  height: 52px;
  padding: 12px 14px;
  border: 1px solid #a8bac4;
  border-radius: 9px;
  outline: none;
  color: var(--ink);
  background: #fbfdfe;
  font-size: 16px;
  line-height: 1.5;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input:not([type="hidden"]):focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgb(0 123 128 / 15%);
  background: var(--white);
}

input:not([type="hidden"]):disabled {
  color: var(--muted);
  background: #f2f5f6;
  border-color: var(--line);
  cursor: not-allowed;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 54px;
}

.password-toggle {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.password-toggle:hover:enabled {
  background: #e7f2f2;
  color: var(--teal-hover);
}

.password-toggle:disabled {
  cursor: not-allowed;
}

.eye-icon {
  position: relative;
  display: block;
  width: 20px;
  height: 13px;
  border: 1.6px solid currentColor;
  border-radius: 70% 70% 70% 70% / 90% 90% 90% 90%;
}

.eye-icon::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border: 1.6px solid currentColor;
  border-radius: 50%;
  content: "";
  transform: translate(-50%, -50%);
}

.password-toggle[aria-pressed="true"] .eye-icon::before {
  position: absolute;
  top: 4px;
  left: -3px;
  z-index: 1;
  width: 23px;
  height: 2px;
  background: currentColor;
  content: "";
  transform: rotate(-42deg);
}

.primary-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  margin-top: 26px;
  padding: 14px 42px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--teal);
  color: var(--white);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
  letter-spacing: 0.035em;
  text-align: center;
  text-decoration: none;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.primary-button:hover {
  background: var(--teal-hover);
  box-shadow: 0 4px 12px rgb(0 100 105 / 15%);
}

.primary-button:disabled {
  cursor: not-allowed;
  background: #677f86;
  box-shadow: none;
}

form[aria-busy="true"] .primary-button {
  cursor: progress;
}

.arrow-icon {
  position: absolute;
  right: 21px;
  width: 15px;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
}

.arrow-icon::after {
  position: absolute;
  top: -3px;
  right: 0;
  width: 8px;
  height: 8px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  content: "";
  transform: rotate(45deg);
}

.button-spinner {
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgb(255 255 255 / 40%);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

form[aria-busy="true"] .button-spinner {
  display: block;
}

form[aria-busy="true"] .arrow-icon {
  display: none;
}

.access-note {
  margin: 28px 0 0;
  padding-top: 21px;
  border-top: 1px solid #e6edef;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.portal-footer {
  width: 100%;
  max-width: 440px;
  margin-top: 25px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.portal-footer p {
  margin: 0;
}

.portal-footer span {
  white-space: nowrap;
}

.portal-footer .copyright {
  margin-top: 13px;
  font-size: 11px;
  letter-spacing: 0.015em;
}

.status-message {
  margin: 0 0 22px;
  padding: 13px 15px;
  border: 1px solid #bad9df;
  border-left: 3px solid var(--teal);
  border-radius: 7px;
  background: #f0f7f8;
  color: #315964;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.status-message[data-kind="error"] {
  border-color: #eed1cc;
  border-left-color: var(--error);
  background: #fdf5f3;
  color: var(--error);
}

.status-message[data-kind="success"] {
  border-color: #b6dcd3;
  border-left-color: #277361;
  background: #edf7f3;
  color: #246450;
}

.result-card {
  text-align: center;
}

.result-card .brand-accent {
  margin-bottom: 31px;
}

.result-card h1 {
  max-width: 315px;
  margin: 0 auto;
}

.result-symbol {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  margin: 0 auto 23px;
  border: 1px solid;
  border-radius: 50%;
}

.success-symbol {
  border-color: #c0dfd8;
  background: #edf7f3;
  color: #26745d;
}

.success-symbol span {
  width: 23px;
  height: 13px;
  margin-top: -5px;
  border-bottom: 3px solid currentColor;
  border-left: 3px solid currentColor;
  transform: rotate(-45deg);
}

.error-symbol {
  border-color: #edcfc9;
  background: #fdf3f0;
  color: var(--error);
  font-size: 32px;
  font-weight: 500;
}

.result-description {
  margin: 14px 0 31px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.result-card .primary-button {
  text-transform: none;
  letter-spacing: 0;
  font-size: 15px;
}

.retry-help {
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

@media (min-width: 720px) {
  .portal-shell {
    padding: 54px 24px 40px;
  }

  .portal-card {
    padding: 43px 38px 28px;
  }
}

@media (max-width: 359px) {
  .portal-shell {
    padding: 24px 12px;
  }

  .portal-card {
    padding: 30px 22px 22px;
    border-radius: 17px;
  }

  h1 {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (forced-colors: active) {
  .portal-card,
  .primary-button,
  .result-symbol {
    border: 1px solid CanvasText;
  }

  .arrow-icon,
  .brand-accent {
    background: CanvasText;
  }
}
