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

* { box-sizing: border-box; }

html {
  min-width: 320px;
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  padding-top: env(safe-area-inset-top);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  background:
    radial-gradient(circle at 12% 12%, rgba(34, 197, 94, 0.13), transparent 31rem),
    radial-gradient(circle at 92% 90%, rgba(22, 163, 74, 0.08), transparent 28rem),
    #f5f3ef;
}

button, input { font: inherit; }

.shell {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  width: min(980px, calc(100% - 40px));
  min-height: 610px;
  margin: clamp(28px, 7vh, 76px) auto;
  overflow: hidden;
  border: 1px solid #e7e5e4;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(28, 25, 23, 0.12);
}

.brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 58px;
  overflow: hidden;
  background: linear-gradient(145deg, #ecfdf3, #f7fff9 72%);
}

.brand-panel::after {
  position: absolute;
  right: -110px;
  bottom: -125px;
  width: 290px;
  height: 290px;
  border: 44px solid rgba(22, 163, 74, 0.07);
  border-radius: 50%;
  content: "";
}

.logo {
  width: 72px;
  height: 72px;
  padding: 2px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(22, 163, 74, 0.18);
}

.logo svg { display: block; width: 100%; height: 100%; }

.brand-name {
  margin: 18px 0 42px;
  color: #15803d;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-panel h1 {
  max-width: 390px;
  margin: 0 0 18px;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.brand-copy {
  max-width: 380px;
  margin: 0;
  color: #57534e;
  font-size: 17px;
  line-height: 1.65;
}

.trust-note {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  margin-top: 34px;
  padding: 9px 13px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  color: #166534;
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 700;
}

.trust-note span:first-child {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #16a34a;
}

.form-panel {
  display: grid;
  min-height: 610px;
  padding: 62px 68px;
  place-items: center;
}

#reset-form, .state-card { width: min(100%, 410px); }

.eyebrow {
  margin-bottom: 5px;
  color: #78716c;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.masked-email {
  margin: 0 0 30px;
  color: #1c1917;
  font-size: 16px;
  font-weight: 700;
}

label {
  display: block;
  margin: 0 0 8px;
  color: #292524;
  font-size: 14px;
  font-weight: 700;
}

.password-field { position: relative; }

input {
  width: 100%;
  height: 52px;
  padding: 0 88px 0 15px;
  border: 1.5px solid #d6d3d1;
  border-radius: 12px;
  outline: 0;
  color: #1c1917;
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus {
  border-color: #16a34a;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
}

input[aria-invalid="true"] { border-color: #dc2626; }

.visibility-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  min-width: 44px;
  min-height: 44px;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  transform: translateY(-50%);
  color: #15803d;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.strength {
  height: 4px;
  margin: 10px 2px 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7e5e4;
}

.strength span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #16a34a;
  transition: width 180ms ease;
}

.requirements {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 14px;
  margin: 0 0 24px;
  padding: 0;
  color: #78716c;
  font-size: 12px;
  list-style: none;
}

.requirements li::before { margin-right: 6px; content: "○"; }
.requirements li.met { color: #15803d; }
.requirements li.met::before { content: "✓"; }
.requirements li.failed { color: #b91c1c; }
.requirements li.failed::before { content: "!"; }
.requirements .server-rule { grid-column: 1 / -1; }

.field-error {
  min-height: 18px;
  margin: 7px 0 15px;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 650;
}

.primary-button {
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: #16a34a;
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(22, 163, 74, 0.2);
}

.primary-button:hover:not(:disabled) { background: #15803d; }
.primary-button:disabled { cursor: not-allowed; opacity: 0.48; box-shadow: none; }

.privacy-copy {
  margin: 16px 12px 0;
  color: #a8a29e;
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}

.state-card { text-align: center; }
.state-card h2 { margin: 18px 0 9px; font-size: 25px; letter-spacing: -0.03em; }
.state-card p { margin: 0; color: #78716c; line-height: 1.6; }

.state-icon {
  display: grid;
  width: 62px;
  height: 62px;
  margin: 0 auto;
  place-items: center;
  border-radius: 50%;
  font-size: 28px;
  font-weight: 800;
}

.success-icon { color: #15803d; background: #dcfce7; }
.error-icon { color: #b91c1c; background: #fee2e2; }

.spinner, .button-spinner {
  border: 3px solid #dcfce7;
  border-top-color: #16a34a;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.spinner { width: 42px; height: 42px; margin: 0 auto 18px; }
.button-spinner { width: 18px; height: 18px; border-color: rgba(255,255,255,.4); border-top-color: #fff; }

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

[hidden] { display: none !important; }

@media (max-width: 780px) {
  .shell { grid-template-columns: 1fr; width: min(100% - 24px, 580px); margin: 12px auto; }
  .brand-panel { padding: 34px 28px 30px; }
  .brand-name { margin: 12px 0 25px; }
  .brand-panel h1 { font-size: 34px; }
  .brand-copy { font-size: 15px; }
  .trust-note { margin-top: 22px; }
  .form-panel { min-height: 520px; padding: 40px 28px; }
}

@media (max-width: 430px) {
  .shell { width: 100%; min-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .brand-panel { padding: 26px 22px 24px; }
  .logo { width: 58px; height: 58px; border-radius: 16px; }
  .brand-name { margin-bottom: 20px; }
  .brand-panel h1 { font-size: 30px; }
  .form-panel { min-height: auto; padding: 34px 22px 44px; }
  .requirements { grid-template-columns: 1fr; }
  .requirements .server-rule { grid-column: auto; }
}

@media (hover: hover) and (pointer: fine) {
  .visibility-toggle:hover { background: #f0fdf4; }
}

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