/* Страницы входа, регистрации и сброса пароля (templates/authentificates/). */

:root {
  --brand: #7b2cdb;
  --brand-2: #a630c8;
  --brand-grad: linear-gradient(135deg, #7b2cdb 0%, #9330d3 55%, #a630c8 100%);
  --brand-soft: #f3ecfd;
  --ink: #1e1b2e;
  --ink-2: #3b3650;
  --muted: #6b6880;
  --hint: #a39db8;
  --line: #e7e3f0;
  --bg: #f7f5fb;
  --danger: #d93d42;
  --warning: #b86e00;
  --success: #15803d;
  --radius: 14px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[v-cloak] {
  display: none;
}

body.auth {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter var', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.auth-shell {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  min-height: 100vh;
}

/* ---- Левая часть: фото продукта ---------------------------------------- */

.auth-visual {
  position: relative;
  margin: 20px 0 20px 20px;
  border-radius: 28px;
  overflow: hidden;
  min-height: calc(100vh - 40px);
  background: #2a0f4f;
  box-shadow: 0 30px 60px -30px rgba(43, 15, 79, 0.55);
}

.auth-visual__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.auth-visual__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(42, 15, 79, 0) 28%, rgba(50, 15, 94, 0.72) 58%, rgba(50, 14, 96, 0.97) 100%),
    linear-gradient(135deg, rgba(123, 44, 219, 0.18), rgba(166, 48, 200, 0.12));
}

.auth-visual__content {
  position: absolute;
  left: 44px;
  right: 44px;
  bottom: 44px;
  color: #fff;
}

.auth-badge,
.auth-chips span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.28);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.auth-badge i,
.auth-chips i {
  font-size: 16px;
}

.auth-visual h2 {
  margin: 18px 0 12px;
  font-size: clamp(30px, 3.1vw, 44px);
  line-height: 1.08;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.auth-visual p {
  margin: 0;
  max-width: 460px;
  font-size: 15.5px;
  line-height: 1.6;
  opacity: 0.88;
}

.auth-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.auth-chips span {
  background: rgba(255, 255, 255, 0.1);
  font-weight: 500;
}

/* ---- Правая часть: форма ----------------------------------------------- */

.auth-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 28px 72px;
  overflow: hidden;
}

.auth-panel::before,
.auth-panel::after {
  content: '';
  position: absolute;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.32;
  pointer-events: none;
}

.auth-panel::before {
  top: -160px;
  right: -140px;
  background: #b98cf6;
}

.auth-panel::after {
  bottom: -200px;
  left: -160px;
  background: #e7a3ec;
}

.auth-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  animation: auth-rise 0.45s ease both;
}

@keyframes auth-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.auth-logo img {
  display: block;
  height: 42px;
  width: auto;
}

.auth-title {
  margin: 36px 0 8px;
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.auth-sub {
  margin: 0 0 26px;
  color: var(--muted);
  line-height: 1.55;
}

/* бонус за регистрацию (register.html; сумма — из «Tizim sozlamalari») */
.auth-bonus {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -8px 0 22px;
  padding: 12px 14px;
  border: 1px solid #eadffb;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f6efff 0%, #fcf0fd 100%);
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.45;
}

.auth-bonus b {
  color: var(--brand);
  white-space: nowrap;
}

.auth-bonus__ico {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--brand-grad);
  box-shadow: 0 8px 18px -10px rgba(123, 44, 219, 0.8);
  color: #fff;
  font-size: 20px;
}

/* ---- Сообщения -------------------------------------------------------- */

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14px;
  line-height: 1.45;
}

.auth-alert i {
  font-size: 19px;
  line-height: 1.1;
  flex: none;
}

.auth-alert--danger {
  color: var(--danger);
  background: #fdeeee;
  border-color: #f8d3d4;
}

.auth-alert--warning {
  color: var(--warning);
  background: #fff6e5;
  border-color: #fde3b0;
}

.auth-alert--success {
  color: var(--success);
  background: #eafaf0;
  border-color: #c6efd4;
}

/* ---- Поля ------------------------------------------------------------- */

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.field__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.field__head .link {
  font-size: 13.5px;
}

.control {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 16px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.control:hover {
  border-color: #d6cee8;
}

.control:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(123, 44, 219, 0.13);
}

.control > i {
  flex: none;
  font-size: 20px;
  color: var(--hint);
  transition: color 0.15s ease;
}

.control:focus-within > i {
  color: var(--brand);
}

.control__prefix {
  flex: none;
  padding-right: 10px;
  border-right: 1.5px solid var(--line);
  font-weight: 600;
  line-height: 22px;
}

.control input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 15.5px;
  color: var(--ink);
}

.control input::placeholder {
  color: #b4afc6;
}

.control input.otp {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.45em;
}

.control input.otp::placeholder {
  letter-spacing: 0.3em;
  font-weight: 500;
}

.control__btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-right: -6px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--hint);
  font-size: 20px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.control__btn:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

/* ---- Кнопки и ссылки -------------------------------------------------- */

.btn-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 54px;
  margin-top: 8px;
  border: 0;
  border-radius: var(--radius);
  background: var(--brand-grad);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 26px -10px rgba(123, 44, 219, 0.6);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-brand:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 16px 30px -10px rgba(123, 44, 219, 0.65);
}

.btn-brand:active {
  transform: none;
}

.btn-brand:disabled {
  cursor: progress;
  opacity: 0.75;
  transform: none;
}

.btn-brand i {
  font-size: 19px;
  transition: transform 0.15s ease;
}

.btn-brand:hover i {
  transform: translateX(3px);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.75s linear infinite;
}

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

.link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  cursor: pointer;
}

.link:hover {
  text-decoration: underline;
}

.link:disabled {
  color: var(--hint);
  text-decoration: none;
  cursor: default;
}

:focus-visible {
  outline: 3px solid rgba(123, 44, 219, 0.35);
  outline-offset: 2px;
}

.control input:focus-visible {
  outline: none;
}

/* ---- Шаги регистрации / сброса ---------------------------------------- */

.steps {
  display: flex;
  gap: 10px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.steps li {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #efecf5;
  color: var(--hint);
  font-size: 13.5px;
  font-weight: 600;
}

.steps li span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  font-size: 12.5px;
}

.steps li.is-active {
  background: var(--brand-soft);
  color: var(--brand);
}

.steps li.is-active span {
  background: var(--brand-grad);
  color: #fff;
}

.steps li.is-done {
  color: var(--success);
}

.steps li.is-done span {
  background: #dcfce7;
}

.sent-to {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #f7f2fe;
  border: 1px solid #eadffb;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.4;
}

.sent-to > i {
  flex: none;
  font-size: 22px;
  color: var(--brand);
}

.sent-to .link {
  margin-left: auto;
  font-size: 13.5px;
  white-space: nowrap;
}

.resend {
  margin: 16px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.auth-switch {
  margin: 28px 0 0;
  text-align: center;
  color: var(--muted);
}

.auth-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  z-index: 1;
  margin: 0;
  text-align: center;
  font-size: 12.5px;
  color: #aba6bd;
}

/* ---- Адаптив --------------------------------------------------------- */

@media (max-width: 1100px) {
  .auth-visual__content {
    left: 32px;
    right: 32px;
    bottom: 32px;
  }
}

@media (max-width: 920px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    display: none;
  }

  .auth-panel {
    min-height: 100vh;
    align-items: flex-start;
    padding-top: 56px;
  }
}

@media (max-width: 420px) {
  .auth-panel {
    padding: 40px 20px 72px;
  }

  .auth-title {
    margin-top: 30px;
    font-size: 26px;
  }

  .steps li {
    padding: 9px 10px;
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-box,
  .btn-brand,
  .btn-brand i {
    animation: none;
    transition: none;
  }
}
