* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: #0f172a;
  background: radial-gradient(circle at top left, #e0f2ff 0, #f9fafb 45%, #e5edff 100%);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

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

.hidden {
  display: none !important;
}

.recovery-main {
  min-height: 100vh;
  padding: 0 !important;
  background: transparent !important;
}

.recovery-shell {
  display: grid;
  min-height: 100vh;
  max-width: 72rem;
  margin: 0 auto;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 25px 60px rgba(30, 64, 175, 0.11);
  backdrop-filter: blur(20px);
}

.brand-panel {
  position: relative;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 3rem 2.5rem;
  color: #ffffff;
  background: linear-gradient(135deg, #1964ac 0%, #1964ac 52%, #4ca6ff 100%);
}

.brand-panel::before {
  position: absolute;
  top: 4rem;
  right: -2rem;
  width: 7rem;
  height: 7rem;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 2rem;
}

.brand-panel::after {
  position: absolute;
  bottom: 5rem;
  left: -2rem;
  width: 5rem;
  height: 5rem;
  content: "";
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.brand-link,
.brand-copy,
.brand-tagline {
  position: relative;
  z-index: 1;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.6rem 0.85rem;
  border-radius: 0.9rem;
  background: #ffffff;
}

.brand-logo {
  width: 9rem;
  height: auto;
  object-fit: contain;
}

.brand-copy {
  max-width: 23rem;
}

.brand-eyebrow,
.step-eyebrow {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.brand-eyebrow {
  color: #dbeafe;
}

.brand-copy h1 {
  margin: 1rem 0 0;
  font-size: 2.25rem;
  line-height: 1.16;
}

.brand-description {
  margin: 1rem 0 0;
  color: #dbeafe;
  font-size: 0.95rem;
  line-height: 1.75;
}

.brand-tagline {
  margin: 0;
  color: #dbeafe;
  font-size: 0.75rem;
}

.form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.form-wrap {
  width: 100%;
  max-width: 32rem;
}

.form-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  margin-bottom: 2rem;
}

.back-link {
  padding: 0.5rem 0.75rem;
  color: var(--primary-color);
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible {
  background: #eff6ff;
  outline: none;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.step-dot {
  display: block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: #e2e8f0;
  transition: width 180ms ease, background 180ms ease;
}

.step-dot.is-active {
  width: 2rem;
  background: var(--primary-color);
}

.step-dot.is-complete {
  background: var(--primary-color);
}

.status-message {
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid;
  border-radius: 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

.status-info {
  color: #1e40af;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.status-error {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}

.status-success {
  color: #15803d;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.step-eyebrow {
  color: var(--primary-color);
}

.step-title {
  margin: 0.5rem 0 0;
  color: #020617;
  font-size: clamp(1.5rem, 4vw, 1.875rem);
  line-height: 1.2;
}

.step-description {
  margin: 0.75rem 0 0;
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.6;
}

.recovery-form {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.75rem;
}

.field-group label {
  display: block;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 700;
}

.recovery-form input {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  outline: none;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.recovery-form input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px #dbeafe;
}

.recovery-form .otp-code-input {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.45em;
}

.primary-button,
.success-link {
  color: #ffffff;
  border: 0;
  border-radius: 0.75rem;
  background: var(--primary-color);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, opacity 160ms ease;
}

.primary-button {
  width: 100%;
  padding: 0.75rem 1rem;
}

.primary-button:hover,
.success-link:hover {
  background: var(--primary-color-hover);
}

.primary-button:focus-visible,
.success-link:focus-visible,
.secondary-button:focus-visible {
  outline: 3px solid #bfdbfe;
  outline-offset: 2px;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.otp-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.otp-actions button {
  padding: 0;
  color: var(--primary-color);
  border: 0;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.otp-actions button:first-child {
  color: #64748b;
}

.otp-actions button:disabled {
  color: #94a3b8;
  cursor: not-allowed;
}

.password-input-shell {
  position: relative;
}

.password-input-shell input {
  padding-right: 5.5rem;
}

.password-toggle {
  position: absolute;
  top: calc(50% + 0.25rem);
  right: 0.75rem;
  padding: 0.25rem 0.5rem;
  color: #64748b;
  border: 0;
  border-radius: 0.25rem;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: #f1f5f9;
}

#passwordMatchMessage {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  font-weight: 600;
}

.text-green-700 {
  color: #15803d;
}

.text-red-600 {
  color: #dc2626;
}

.password-rules {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  color: #64748b;
  font-size: 0.75rem;
  list-style: none;
}

.security-rule {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #ffffff;
}

.rule-mark {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  color: #94a3b8;
  border-radius: 999px;
  background: #f1f5f9;
  font-size: 0.625rem;
}

.security-rule.is-valid {
  color: #15803d;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.security-rule.is-valid .rule-mark {
  color: #ffffff;
  background: #22c55e;
}

.password-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.password-actions .primary-button {
  width: auto;
  padding-right: 1.25rem;
  padding-left: 1.25rem;
}

.secondary-button {
  padding: 0.625rem 1rem;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.secondary-button:hover {
  background: #f8fafc;
}

.success-step {
  text-align: center;
}

.success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  margin: 0 auto;
  color: #15803d;
  border-radius: 999px;
  background: #dcfce7;
  font-size: 1.5rem;
}

.success-step h2 {
  margin: 1.25rem 0 0;
  color: #020617;
  font-size: 1.875rem;
}

.success-step p {
  margin: 0.75rem 0 0;
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.6;
}

.success-link {
  display: inline-flex;
  margin-top: 1.75rem;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
}

@media (min-width: 640px) {
  .form-panel {
    padding-right: 2.5rem;
    padding-left: 2.5rem;
  }

  .password-rules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .recovery-main {
    padding: 1.5rem !important;
  }

  .recovery-shell {
    min-height: calc(100vh - 3rem);
    grid-template-columns: 0.82fr 1.18fr;
    border-radius: 2rem;
  }

  .brand-panel {
    display: flex;
  }

  .form-panel {
    padding-right: 3rem;
    padding-left: 3rem;
  }
}

@media (min-width: 1024px) {
  .recovery-main {
    padding: 2.5rem !important;
  }

  .recovery-shell {
    min-height: calc(100vh - 5rem);
  }

  .form-panel {
    padding-right: 4rem;
    padding-left: 4rem;
  }
}

@media (max-width: 420px) {
  .password-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .password-actions .primary-button,
  .secondary-button {
    width: 100%;
  }
}
