/* Hobbiz auth pages — landingdraft design, ~87% scale */
:root {
  --purple: #794ff8;
  --purple-deep: #4f23c8;
  --purple-ink: #1c0a47;
  --purple-soft: #efe7ff;
  --lime: #d8ff3a;
  --pink: #ff7ec1;
  --pink-deep: #ff4f9e;
  --orange: #ff9446;
  --cream: #fbf7ee;
  --ink: #160830;
  --muted: #6a5f86;
  --line: rgba(28, 10, 71, 0.12);
  --shadow-card: 0 20px 50px -26px rgba(79, 35, 200, 0.32), 0 6px 16px -8px rgba(28, 10, 71, 0.16);
  --auth-card-max: 430px;
  --auth-radius: 18px;
  --auth-nav-h: 52px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; max-width: 100%; }
html { scroll-behavior: smooth; }
body {
  font-family: "Onest", system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* freelance/* подключает mobile-adapt.css — не даём ему ломать auth-layout */
body:has(.auth-page) {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.09 0 0 0 0 0.04 0 0 0 0 0.28 0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.04;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: multiply;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; border: none; background: none; }

/* ----- background ----- */
.bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}
.bg-blob--a { width: 340px; height: 340px; background: var(--purple-soft); top: -80px; right: -60px; }
.bg-blob--b { width: 280px; height: 280px; background: #ffe8f4; bottom: 10%; left: -80px; }
.bg-blob--c { width: 220px; height: 220px; background: #fff3d6; top: 40%; right: 15%; }
.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%);
}

/* ----- cursor (desktop) ----- */
.cursor-dot, .cursor-ring {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
}
body.cursor-on .cursor-dot,
body.cursor-on .cursor-ring { display: block; }
.cursor-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--purple);
}
.cursor-ring {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(121, 79, 248, 0.45);
  border-radius: 50%;
  transition: width 0.2s, height 0.2s, border-color 0.2s;
}
.cursor-ring.is-hover {
  width: 48px;
  height: 48px;
  border-color: var(--purple);
}

/* ----- nav ----- */
.nav {
  position: sticky;
  top: 10px;
  z-index: 50;
  margin: 10px auto 0;
  max-width: calc(var(--auth-card-max) + 80px);
  padding: 0 14px;
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px 8px 16px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 10px 24px -14px rgba(28, 10, 71, 0.2);
}
.nav__logo { height: 28px; width: auto; display: block; }
.nav__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--purple-ink);
  padding: 6px 12px;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}
.nav__back:hover { background: var(--purple-soft); color: var(--purple); }
.nav__lang {
  border: 1px solid rgba(121, 79, 248, 0.28);
  background: rgba(121, 79, 248, 0.08);
  color: var(--purple);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.nav__lang:hover { background: rgba(121, 79, 248, 0.16); }
.nav__lang[aria-pressed="true"] { background: var(--purple); color: #fff; }

/* ----- page ----- */
.auth-page {
  position: relative;
  z-index: 2;
  max-width: calc(var(--auth-card-max) + 120px);
  margin: 0 auto;
  padding: 20px 16px 48px;
  overflow: visible;
}

.auth-stage {
  position: relative;
  max-width: calc(var(--auth-card-max) + 100px);
  margin: 0 auto;
  overflow: visible;
}

.deco-stickers {
  position: absolute;
  inset: -16px -56px;
  pointer-events: none;
  overflow: visible;
  z-index: 0;
}
.sticker {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 2px solid var(--purple-ink);
  box-shadow: 3px 3px 0 var(--purple-ink);
  white-space: nowrap;
  animation: auth-float 5s ease-in-out infinite;
}
.sticker--lime { background: var(--lime); color: var(--purple-ink); }
.sticker--pink { background: var(--pink); color: #fff; }
.sticker--orange { background: var(--orange); color: var(--purple-ink); }
.sticker--white { background: #fff; }
.ds1 { top: 8%; left: -4%; animation-delay: 0s; }
.ds2 { top: 18%; right: -8%; animation-delay: 0.8s; }
.ds3 { bottom: 28%; left: -6%; animation-delay: 1.4s; }
.ds4 { bottom: 12%; right: -4%; animation-delay: 2s; }
@keyframes auth-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}

/* ----- card ----- */
.auth-card {
  position: relative;
  z-index: 2;
  max-width: var(--auth-card-max);
  margin: 0 auto;
  padding: 26px 24px 28px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--line);
  border-radius: var(--auth-radius);
  box-shadow: var(--shadow-card);
  overflow: visible;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.auth-card.in { opacity: 1; transform: none; }

.auth-card__head { margin-bottom: 20px; }
.auth-card__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
}
.auth-card__eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 3px rgba(216, 255, 58, 0.35);
}
.auth-card h1 {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: clamp(1.5rem, 4.2vw, 1.85rem);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 8px;
  letter-spacing: -0.03em;
  color: var(--purple-ink);
}
.auth-card h1 .script {
  font-family: "Caveat", cursive;
  font-weight: 700;
  color: var(--purple);
  font-size: 1.15em;
}
.auth-card__sub {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
}

.progress-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.progress-bar__step {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  transition: background 0.3s;
}
.progress-bar__step.is-active { background: linear-gradient(90deg, var(--purple), var(--pink)); }

/* ----- oauth ----- */
.oauth-block { margin-bottom: 16px; }
#oauth-buttons { margin-bottom: 8px; min-height: 44px; }
#oauth-buttons .oauth-button,
.vkid-button {
  border-radius: 12px !important;
  transition: transform 0.2s !important;
}
.vkid-wrapper { min-height: 44px; }

.social-hint {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin: 10px 0 8px;
  line-height: 1.35;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.divider span { padding: 0 4px; white-space: nowrap; }

/* ----- form ----- */
.form { display: grid; gap: 14px; }
.form-field { display: grid; gap: 5px; }
.form-field__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--purple-ink);
}
.form-field__label .req { color: var(--pink-deep); }
.form-field input,
.form-field .form-control {
  width: 100%;
  padding: 11px 14px;
  font-size: 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-field input:focus,
.form-field .form-control:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(121, 79, 248, 0.12);
}

/* Icons sit on the input row (grid), not the whole field incl. validation text */
.form-field--has-icon > .form-field__label { grid-row: 1; }
.form-field--has-icon > input,
.form-field--has-icon > .form-control {
  grid-row: 2;
  grid-column: 1;
  padding-left: 42px;
}
.form-field--has-icon:has(.password-toggle) > input,
.form-field--has-icon:has(.password-toggle) > .form-control {
  padding-right: 46px;
}
.form-field--has-icon > .form-field__icon,
.form-field--has-icon > .password-toggle {
  grid-row: 2;
  grid-column: 1;
  align-self: center;
  z-index: 2;
}
.form-field--has-icon > .invalid-feedback,
.form-field--has-icon > .valid-feedback {
  grid-row: 3;
}
.form-field--has-icon > .form-field__icon {
  justify-self: start;
  margin: 0;
  padding-left: 14px;
  font-size: 14px;
  color: var(--purple);
  pointer-events: none;
  line-height: 1;
}
.password-toggle {
  justify-self: end;
  margin: 0 14px 0 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
}
.password-toggle:hover { color: var(--purple); background: var(--purple-soft); }

.auth-forgot {
  font-size: 12px;
  color: var(--purple);
  font-weight: 600;
  justify-self: end;
  margin-top: -6px;
}
.auth-forgot:hover { text-decoration: underline; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--purple-deep));
  border: none;
  border-radius: 999px;
  box-shadow: 0 10px 28px -10px rgba(79, 35, 200, 0.55);
  transition: transform 0.15s, box-shadow 0.2s;
  margin-top: 4px;
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px -10px rgba(79, 35, 200, 0.6);
}
.btn-primary:disabled { opacity: 0.65; cursor: not-allowed; }

.alt-link {
  margin: 18px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.alt-link a {
  color: var(--purple);
  font-weight: 600;
}
.alt-link a:hover { text-decoration: underline; }

/* registration extras */
.req-card,
.password-requirements {
  padding: 12px 14px;
  background: linear-gradient(135deg, #faf8ff, #f3eeff);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 12px;
  color: var(--muted);
}
.req-card__title,
.password-requirements > div:first-child {
  font-weight: 700;
  color: var(--purple-ink);
  margin-bottom: 6px;
  font-size: 12px;
}
.req-card__list,
.password-requirements ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.req-card__list li,
.password-requirements li {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 12px;
}
.req-card__list li i,
.password-requirements li::before {
  font-size: 12px;
  color: var(--muted);
}
.req-card__list li.ok,
.password-requirements li.ok { color: #0d9668; }
.req-card__list li.ok i { color: #0d9668; }

.check-row,
.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  position: relative;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.check-row input[type="checkbox"],
.form-check-input {
  position: absolute;
  opacity: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
}
.check-row__box,
.form-check-input + .form-check-label::before,
.form-check .form-check-input + label::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-radius: 5px;
  background: #fff;
  margin-top: 1px;
}
.check-row input:checked ~ .check-row__box,
.form-check-input:checked + .form-check-label::before {
  background: var(--purple);
  border-color: var(--purple);
}
.check-row label,
.form-check-label { cursor: pointer; }
.check-row a,
.form-check-label a { color: var(--purple); font-weight: 600; }

.auth-step-title {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--purple-ink);
}
.auth-step-sub {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.45;
}

/* registration steps */
.auth-card .step { display: none; }
.auth-card .step.active { display: block; animation: auth-fade-in 0.35s ease; }
@keyframes auth-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.auth-card .progress {
  height: 5px;
  margin-bottom: 18px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.auth-card .progress-bar {
  background: linear-gradient(90deg, var(--purple), var(--pink));
  height: 100%;
  transition: width 0.35s ease;
}

.code-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 16px 0;
}
.code-inputs input {
  width: 48px;
  height: 48px;
  padding: 0;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  border: 2px solid var(--line);
  border-radius: 12px;
}
.code-inputs input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(121, 79, 248, 0.12);
  outline: none;
}

.timer { font-size: 12px; color: var(--muted); text-align: center; margin-top: 12px; }
.btn-link {
  color: var(--purple);
  font-weight: 600;
  font-size: 13px;
  background: none;
  border: none;
  padding: 4px 8px;
}
.btn-link:disabled { opacity: 0.45; cursor: not-allowed; }

/* alerts (bootstrap compat) */
.auth-alert,
.login-error-alert,
.alert {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 12px;
}
.alert-danger,
.login-error-alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.invalid-feedback,
.valid-feedback {
  font-size: 11px;
  margin-top: 4px;
}
.invalid-feedback { color: #dc2626; }
.valid-feedback { color: #0d9668; }
.form-control.is-invalid { border-color: #ef4444 !important; }
.form-control.is-valid { border-color: #10b981 !important; }

/* legacy bootstrap field mapping inside auth-card */
.auth-card .mb-3 { margin-bottom: 0; }
.auth-card .form-label { font-size: 12px; font-weight: 600; color: var(--purple-ink); margin-bottom: 5px; display: block; }
.auth-card .form-control:not(.code-inputs input) {
  width: 100%;
  padding: 11px 14px;
  font-size: 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
}
.auth-card .w-100 { width: 100%; }
.auth-card .text-center { text-align: center; }
.auth-card .mt-3, .auth-card .mt-4 { margin-top: 14px; }
.auth-card .mb-4 { margin-bottom: 16px; }
.auth-card h2.h4, .auth-card h2 {
  font-family: "Unbounded", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--purple-ink);
  margin: 0 0 16px;
}

.auth-reg-social-title {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin: 0 0 12px;
}

@media (max-width: 520px) {
  :root { --auth-card-max: min(100%, 390px); }
  .auth-page { padding: 14px 12px 36px; max-width: 100%; }
  .auth-stage { max-width: 100%; }
  .deco-stickers { inset: -8px -12px; }
  .auth-card { padding: 22px 18px 24px; }
  .sticker { display: none; }
  .nav { padding: 0 10px; }
  .code-inputs input { width: 44px; height: 44px; font-size: 18px; }
}

@media (min-width: 521px) and (max-width: 900px) {
  .sticker { font-size: 10px; padding: 6px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card, .sticker { animation: none !important; transition: none !important; }
  .auth-card { opacity: 1; transform: none; }
}

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