:root {
  color: #173f34;
  background: #eaf5ef;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(234, 245, 239, 0.88), rgba(211, 238, 225, 0.9)),
    radial-gradient(circle at 15% 15%, #fff 0 8%, transparent 38%),
    #eaf5ef;
}

button,
input {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.reset-card {
  width: min(100%, 510px);
  overflow: hidden;
  border: 1px solid rgba(23, 99, 79, 0.16);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 70px rgba(17, 67, 54, 0.18);
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 28px;
  color: #fff;
  background: linear-gradient(135deg, #17634f, #268367);
}

.brand-logo {
  flex: 0 0 auto;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.brand-name {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.environment-badge {
  width: fit-content;
  margin: 7px 0 0;
  padding: 3px 9px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

form,
.state-panel {
  padding: 30px 32px 28px;
}

.state-panel {
  text-align: center;
}

h1 {
  margin: 0;
  color: #173f34;
  font-size: clamp(1.55rem, 5vw, 2rem);
  line-height: 1.18;
}

.intro-copy {
  margin-bottom: 26px;
}

.intro-copy > p,
.state-panel > p {
  margin: 10px 0 0;
  color: #526a63;
  line-height: 1.5;
}

.account-email {
  overflow-wrap: anywhere;
  color: #173f34 !important;
  font-weight: 750;
}

.field-group + .field-group {
  margin-top: 22px;
}

label {
  display: block;
  margin: 0 0 8px;
  color: #173f34;
  font-weight: 750;
}

.password-field {
  position: relative;
}

.password-field input {
  width: 100%;
  min-height: 54px;
  padding: 12px 54px 12px 15px;
  border: 2px solid #b9cdc5;
  border-radius: 14px;
  outline: none;
  color: #153a31;
  background: #fbfdfc;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.password-field input:focus {
  border-color: #21785f;
  box-shadow: 0 0 0 4px rgba(33, 120, 95, 0.14);
}

.password-field input[aria-invalid="true"] {
  border-color: #c94343;
}

.visibility-button {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 42px;
  height: 42px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  color: #365a50;
  background: transparent;
  cursor: pointer;
}

.visibility-button:hover,
.visibility-button:focus-visible {
  background: #e6f2ed;
  outline: none;
}

.visibility-button span {
  font-size: 1.25rem;
}

.field-help,
.match-status,
.strength p,
.hint-copy {
  margin: 7px 2px 0;
  color: #60766f;
  font-size: 0.88rem;
  line-height: 1.4;
}

.strength {
  margin-top: 13px;
}

.strength-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce8e3;
}

.strength-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #9aa9a3;
  transition: width 180ms ease, background-color 180ms ease;
}

.match-status.is-match {
  color: #177149;
  font-weight: 750;
}

.match-status.is-mismatch {
  color: #b33131;
  font-weight: 650;
}

.form-error {
  margin-top: 20px;
  padding: 12px 14px;
  border: 1px solid #f0b1b1;
  border-radius: 12px;
  color: #8f2424;
  background: #fff1f1;
  line-height: 1.45;
}

.primary-button {
  width: 100%;
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
  border: 0;
  border-radius: 15px;
  color: #fff;
  background: #17634f;
  box-shadow: 0 8px 20px rgba(23, 99, 79, 0.22);
  font-weight: 800;
  cursor: pointer;
}

.primary-button:hover:not(:disabled) {
  background: #0f523f;
}

.primary-button:focus-visible {
  outline: 4px solid rgba(33, 120, 95, 0.24);
  outline-offset: 2px;
}

.primary-button:disabled {
  color: #82918c;
  background: #dce5e1;
  box-shadow: none;
  cursor: not-allowed;
}

.spinner,
.button-spinner {
  display: inline-block;
  border: 3px solid rgba(23, 99, 79, 0.2);
  border-top-color: #17634f;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.spinner {
  width: 44px;
  height: 44px;
  margin: 8px 0 22px;
}

.button-spinner {
  width: 20px;
  height: 20px;
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}

.state-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin: 4px auto 22px;
  border-radius: 50%;
  font-size: 2rem;
  font-weight: 900;
}

.state-icon-error {
  color: #a42d2d;
  background: #ffe5e5;
}

.state-icon-success {
  color: #126b43;
  background: #dcf5e7;
}

footer {
  padding: 15px 24px 18px;
  border-top: 1px solid #e2ebe7;
  color: #6d817a;
  background: #f7faf8;
  font-size: 0.78rem;
  text-align: center;
}

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

@media (max-width: 520px) {
  .page-shell {
    padding: 0;
    place-items: stretch;
  }

  .reset-card {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .brand-header {
    padding: 20px;
  }

  form,
  .state-panel {
    padding: 28px 20px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
