:root {
  --bg: #0f1320;
  --bg-2: #151a26;
  --card: #ffffff;
  --text: #20242d;
  --muted: #747b8d;
  --link: #3b82f6;
  --link-hover: #2563eb;
  --line: #d9deea;
  --button: #060b1b;
  --button-hover: #0d1327;
  --error-bg: #fef2f2;
  --error-text: #991b1b;
  --error-line: #f3b4b4;
  --shadow: 0 32px 65px rgba(7, 10, 18, 0.28);
  --font: 'Manrope', sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg);
}

body {
  min-height: 100vh;
  overflow: hidden;
}

.page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.12), transparent 20%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
  isolation: isolate;
}

.page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at center, black 0%, black 58%, transparent 92%);
  opacity: 0.55;
  z-index: 0;
  pointer-events: none;
}

.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 472px;
  background: var(--card);
  border-radius: 16px;
  padding: 34px 30px 28px;
  box-shadow: var(--shadow);
  text-align: center;
}

.card::before {
  content: '';
  position: absolute;
  inset: -20px -26px auto auto;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 68%);
  filter: blur(12px);
  pointer-events: none;
}

.mark {
  width: 48px;
  height: 48px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--button);
  color: #fff;
  display: grid;
  place-items: center;
}

.mark-icon {
  width: 22px;
  height: 22px;
}

h1 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 1.8rem;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.sub {
  max-width: 360px;
  margin: 0 auto 24px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.alert {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--error-bg);
  color: var(--error-text);
  font-size: 0.88rem;
  text-align: left;
  border: 1px solid var(--error-line);
}

.alert.success {
  background: #f0fdf4;
  color: #166534;
  border-color: #b7e4c1;
}

.field {
  text-align: left;
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  color: #495167;
  font-size: 0.9rem;
  font-weight: 700;
}

.field input {
  width: 100%;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  color: var(--text);
  font: inherit;
  font-size: 0.94rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input::placeholder {
  color: #8b92a3;
}

.field input:focus {
  border-color: #b8bfce;
  box-shadow: 0 0 0 4px rgba(6, 11, 27, 0.05);
}

.field input.input-error {
  border-color: var(--error-line);
  box-shadow: none;
}

.field-error {
  display: block;
  margin-top: 7px;
  color: var(--error-text);
  font-size: 0.82rem;
  font-weight: 600;
}

.primary-btn {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 8px;
  background: var(--button);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.primary-btn:hover {
  background: var(--button-hover);
}

.primary-btn:disabled {
  cursor: wait;
  opacity: 0.92;
}

.primary-btn.is-loading::after {
  content: '';
  width: 14px;
  height: 14px;
  margin-left: 10px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex: 0 0 auto;
}

.back-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--link);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}

.back-link:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.footer-muted {
  color: var(--muted);
}

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

@media (max-width: 700px) {
  .card {
    max-width: 100%;
    padding: 34px 22px 28px;
    border-radius: 18px;
  }

  .mark {
    width: 48px;
    height: 48px;
    margin-bottom: 18px;
    font-size: 18px;
  }

  h1 {
    font-size: 1.75rem;
  }

  .sub {
    font-size: 0.92rem;
    margin-bottom: 24px;
  }
}
