:root {
  --violet-900: #5b3d8e;
  --violet-700: #7759d7;
  --violet-600: #8a69e3;
  --violet-500: #8b5cf6;
  --violet-300: #c4b5fd;
  --violet-100: #ede9fe;
  --violet-50: #f5f3ff;
  --ink: #2e2255;
  --muted: #6b6390;
  --border: #ece8fb;
  --white: #ffffff;
  --pink: #ff3d78;
  --amber: #ffab2e;
  --green: #22c07a;
  --radius: 18px;
  --shadow: 0 24px 60px rgba(90, 60, 180, 0.14);
  --font: "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--violet-50);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  position: relative;
  overflow-x: hidden;
}

/* decorative background */
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(2px);
  z-index: 0;
  pointer-events: none;
}
.blob-1 {
  width: 420px; height: 420px;
  top: -160px; left: -140px;
  background: radial-gradient(circle at 30% 30%, #e3d6fb, #f1e9fe);
  border-radius: 55% 45% 60% 40% / 50% 55% 45% 50%;
}
.blob-2 {
  width: 480px; height: 480px;
  bottom: -200px; right: -160px;
  background: radial-gradient(circle at 70% 70%, #dccdf9, #f2ecfe);
  border-radius: 45% 55% 40% 60% / 55% 45% 60% 40%;
}
.dots {
  position: fixed;
  width: 130px; height: 130px;
  background-image: radial-gradient(var(--violet-300) 2px, transparent 2px);
  background-size: 18px 18px;
  opacity: .5;
  z-index: 0;
  pointer-events: none;
}
.dots-tr { top: 70px; right: 60px; }
.dots-bl { bottom: 70px; left: 60px; }

/* card */
.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(6px);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 32px 34px 26px;
  animation: rise .5s ease;
}

.back-home {
  position: absolute;
  top: 24px;
  left: 28px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--violet-600);
  font-size: 25px;
  line-height: 1;
  text-decoration: none;
  transition: background .18s ease, transform .18s ease;
}
.back-home:hover { background: var(--violet-100); transform: translateX(-2px); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.brand { text-align: center; }
.brand h1 {
  margin: 0;
  font-size: 44px;
  letter-spacing: 2px;
  font-weight: 800;
  color: var(--violet-700);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand h1 .fly { font-size: 36px; filter: hue-rotate(-10deg); }
.tagline { margin: 5px 0 0; color: var(--violet-500); font-size: 15px; }

.divider-icon {
  display: flex; align-items: center; gap: 14px;
  margin: 16px auto 6px; max-width: 280px;
}
.divider-icon::before, .divider-icon::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.avatar-badge {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--violet-100);
  display: grid; place-items: center;
  color: var(--violet-700);
}
.heart { text-align: center; font-size: 26px; margin: 16px 0 4px; color: var(--violet-500); }

h2.title {
  text-align: center;
  font-size: 32px;
  margin: 8px 0 5px;
  font-weight: 700;
  color: var(--ink);
}
p.subtitle { text-align: center; margin: 0 0 20px; color: var(--muted); font-size: 15px; }
p.subtitle b { color: var(--violet-600); }

.field { margin-bottom: 14px; }
.field > label {
  display: block; font-weight: 600; font-size: 15px;
  margin-bottom: 8px; color: var(--ink);
}
.control {
  display: flex; align-items: center; gap: 10px;
  background: #fdfcff;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 0 14px;
  transition: border-color .2s, box-shadow .2s;
}
.control:focus-within {
  border-color: var(--violet-500);
  box-shadow: 0 0 0 4px rgba(149, 117, 230, .16);
}
.control.error { border-color: var(--pink); }
.control .ico { color: var(--violet-500); display: grid; place-items: center; }
.control input, .control select {
  flex: 1; border: 0; outline: none; background: transparent;
  padding: 13px 0; font-size: 15px; font-family: inherit; color: var(--ink);
  appearance: none;
}
.control input::placeholder { color: #b3aac9; }
.toggle-eye {
  border: 0; background: transparent; cursor: pointer;
  color: var(--violet-500); padding: 4px; display: grid; place-items: center;
}
.hint { font-size: 13px; color: var(--muted); margin: 8px 2px 0; }
.msg-error { font-size: 13px; color: var(--pink); margin: 6px 2px 0; min-height: 0; }

/* password strength */
.strength-row {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; font-size: 12.5px; color: var(--muted);
  flex-wrap: nowrap; white-space: nowrap;
}
.bars { display: flex; gap: 6px; flex: 1; min-width: 120px; }
.bars span {
  height: 5px; flex: 1; border-radius: 99px; background: var(--violet-100);
  transition: background .25s;
}
.strength-label b { color: var(--pink); }

/* checkbox */
.check {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 15px; color: var(--ink); margin: 20px 0 24px;
  cursor: pointer;
}
.check input { width: 20px; height: 20px; accent-color: var(--violet-600); margin-top: 1px; }
.check a { color: var(--violet-600); text-decoration: none; font-weight: 600; }
.check a:hover { text-decoration: underline; }

/* buttons */
.btn {
  width: 100%; border: 0; cursor: pointer;
  border-radius: 12px; padding: 14px;
  font-size: 15px; font-weight: 600; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .15s, box-shadow .2s, opacity .2s;
}
.btn-primary {
  background: linear-gradient(90deg, var(--violet-700), var(--violet-600) 60%, #8a5cf0);
  color: #fff;
  box-shadow: 0 12px 24px rgba(109, 63, 214, .3);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: #fff; color: var(--violet-700);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--violet-50); }

.right-link { text-align: right; margin: -6px 0 18px; }
.right-link a, .foot a { color: var(--violet-600); font-weight: 600; text-decoration: none; }
.right-link a:hover, .foot a:hover { text-decoration: underline; }

.or, .divider {
  display: flex; align-items: center; gap: 14px;
  color: var(--muted); font-size: 15px; margin: 22px 0 16px;
}
.or::before, .or::after, .divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.btn-secondary {
  background: var(--violet-100); color: var(--violet-700);
  box-shadow: 0 4px 12px rgba(109, 63, 214, .12);
}
.btn-secondary:hover { background: var(--violet-300); }

.protected {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--muted); font-size: 14px; margin-top: 12px;
}

.foot {
  text-align: center; color: var(--muted); font-size: 15px;
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border);
}
.foot .heart-sm { display: block; color: var(--violet-500); margin-bottom: 10px; font-size: 20px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: var(--violet-700); color: #fff;
  padding: 14px 22px; border-radius: 14px; font-size: 15px;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--pink); }
.toast.ok { background: var(--green); }

@media (max-width: 560px) {
  .card { padding: 30px 22px 24px; border-radius: 22px; }
  .brand h1 { font-size: 40px; }
  h2.title { font-size: 30px; }
}
