:root {
  color-scheme: light;
  --brown-900: #30251b;
  --brown-800: #473729;
  --brown-700: #604a38;
  --brown-500: #896a4f;
  --cream: #f5f1eb;
  --white: #fff;
  --ink: #302c29;
  --muted: #71665d;
  --line: #ded8d0;
  --teal: #00bfc8;
  --teal-dark: #008f98;
  --danger: #b73b3b;
  --shadow: 0 24px 70px rgba(35, 26, 19, .28);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at 50% 16%, #896a4f 0, #6e523d 34%, #473729 76%);
  color: var(--ink);
  font-family:
    Inter, "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  margin: 0;
  min-height: 100vh;
}

body::before,
body::after {
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 50%;
  content: "";
  pointer-events: none;
  position: fixed;
}

body::before {
  height: 520px;
  left: -290px;
  top: -260px;
  width: 520px;
}

body::after {
  bottom: -370px;
  height: 680px;
  right: -330px;
  width: 680px;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(0, 191, 200, .3);
  outline-offset: 3px;
}

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

.account-card {
  background: var(--white);
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 24px;
  box-shadow: var(--shadow);
  max-width: 560px;
  padding: 48px 52px 44px;
  width: 100%;
}

.brand-link {
  display: block;
  margin: 0 auto 28px;
  max-width: 224px;
}

.brand-logo {
  display: block;
  height: auto;
  max-height: 58px;
  object-fit: contain;
  width: 100%;
}

.secure-label {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: .76rem;
  font-weight: 700;
  gap: 7px;
  justify-content: center;
  letter-spacing: .09em;
  margin-bottom: 24px;
  text-transform: uppercase;
}

.secure-label svg {
  fill: var(--teal-dark);
  height: 16px;
  width: 16px;
}

.state-view h1 {
  color: var(--brown-900);
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  letter-spacing: -.035em;
  line-height: 1.12;
  margin: 0;
  text-align: center;
}

.intro,
.state-view-loading p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
  margin: 14px auto 0;
  max-width: 430px;
  text-align: center;
}

.state-view-loading {
  padding: 16px 0 18px;
}

.spinner {
  animation: spin .8s linear infinite;
  border: 3px solid #e9e3dc;
  border-radius: 50%;
  border-top-color: var(--teal);
  height: 42px;
  margin: 0 auto 24px;
  width: 42px;
}

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

.account-email {
  background: var(--cream);
  border: 1px solid #ebe5de;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 28px 0 26px;
  padding: 13px 16px;
}

.account-email span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.account-email strong {
  color: var(--brown-900);
  font-size: .95rem;
  overflow-wrap: anywhere;
}

.field-group {
  margin-top: 18px;
}

.field-group label {
  color: #40362e;
  display: block;
  font-size: .9rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.password-control {
  position: relative;
}

.password-control input {
  appearance: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  height: 54px;
  padding: 0 70px 0 16px;
  transition: border-color .18s ease, box-shadow .18s ease;
  width: 100%;
}

.password-control input:hover {
  border-color: #bdb3a8;
}

.password-control input:focus {
  border-color: var(--teal-dark);
  box-shadow: 0 0 0 4px rgba(0, 191, 200, .12);
  outline: none;
}

.password-control input[aria-invalid="true"] {
  border-color: var(--danger);
}

.visibility-button {
  background: transparent;
  border: 0;
  color: var(--brown-700);
  cursor: pointer;
  font: inherit;
  font-size: .8rem;
  font-weight: 700;
  padding: 10px;
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
}

.strength {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 10px;
}

.strength-bar {
  background: #e6e0d9;
  border-radius: 99px;
  height: 4px;
  transition: background-color .2s ease;
}

.strength[data-score="1"] .strength-bar:nth-child(-n+1) {
  background: #c7574e;
}

.strength[data-score="2"] .strength-bar:nth-child(-n+2) {
  background: #d79a35;
}

.strength[data-score="3"] .strength-bar:nth-child(-n+3) {
  background: #50aaa2;
}

.strength[data-score="4"] .strength-bar {
  background: var(--teal-dark);
}

.field-help {
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.45;
  margin: 8px 1px 0;
}

.form-error {
  background: #fff2f1;
  border-radius: 9px;
  color: #912e2e;
  font-size: .84rem;
  line-height: 1.4;
  margin: 16px 0 0;
  padding: 10px 12px;
}

.primary-button {
  align-items: center;
  background: var(--brown-800);
  border: 1px solid var(--brown-800);
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: .95rem;
  font-weight: 750;
  justify-content: center;
  min-height: 52px;
  padding: 13px 24px;
  text-align: center;
  text-decoration: none;
  transition: background-color .18s ease, box-shadow .18s ease, transform .18s ease;
  width: 100%;
}

form .primary-button {
  margin-top: 26px;
}

.primary-button:hover {
  background: var(--brown-900);
  box-shadow: 0 8px 20px rgba(48, 37, 27, .18);
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: .72;
  transform: none;
}

.button-spinner {
  animation: spin .7s linear infinite;
  border: 2px solid rgba(255, 255, 255, .42);
  border-radius: 50%;
  border-top-color: #fff;
  height: 19px;
  width: 19px;
}

.status-icon {
  align-items: center;
  border-radius: 50%;
  display: flex;
  height: 72px;
  justify-content: center;
  margin: 2px auto 24px;
  width: 72px;
}

.status-icon svg {
  height: 37px;
  width: 37px;
}

.status-icon-success {
  background: #dff8f6;
}

.status-icon-success svg {
  fill: #008f89;
}

.status-icon-error {
  background: #fff0ef;
}

.status-icon-error svg {
  fill: var(--danger);
}

#success-view .primary-button,
#error-view .primary-button {
  margin-top: 28px;
}

.secondary-action {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.55;
  margin: 20px 12px 0;
  text-align: center;
}

.secondary-action a {
  font-weight: 700;
}

.noscript-message {
  background: #fff2f1;
  border-radius: 10px;
  color: #912e2e;
  line-height: 1.5;
  margin-top: 24px;
  padding: 14px;
  text-align: center;
}

footer {
  align-items: center;
  color: rgba(255, 255, 255, .74);
  display: flex;
  flex-wrap: wrap;
  font-size: .78rem;
  gap: 8px;
  justify-content: center;
  margin-top: 24px;
}

footer a {
  color: rgba(255, 255, 255, .86);
  text-decoration: none;
}

footer a:hover {
  color: #fff;
  text-decoration: underline;
}

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

@media (max-width: 600px) {
  .page-shell {
    justify-content: flex-start;
    padding: 22px 12px 20px;
  }

  .account-card {
    border-radius: 20px;
    padding: 34px 24px 32px;
  }

  .brand-link {
    margin-bottom: 22px;
    max-width: 190px;
  }

  .secure-label {
    margin-bottom: 20px;
  }
}

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