﻿

@keyframes authCardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes authIconIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes authAlertIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@keyframes authSpin {
  to { transform: rotate(360deg); }
}

@keyframes authDonePop {
  0% { opacity: 0; transform: scale(0.6); }
  70% { transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes authCheckDraw {
  from { stroke-dashoffset: 24; }
  to { stroke-dashoffset: 0; }
}

.auth-card {
  opacity: 0;
  animation: authCardIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.05s forwards;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.4);
}

.auth-logo {
  animation: authIconIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.auth-icon {
  animation: authIconIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

.auth-card h1,
.auth-card .lead,
.auth-switch {
  animation: authAlertIn 0.45s ease 0.16s both;
}

.auth-card .form {
  animation: authAlertIn 0.45s ease 0.22s both;
}

.auth-foot {
  animation: authAlertIn 0.45s ease 0.28s both;
}


.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-mut);
}

.auth-alert.is-visible {
  animation: authAlertIn 0.35s ease forwards, authShake 0.42s ease 0.1s;
}

.auth-alert__ic {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  stroke-width: 2;
  fill: none;
}

.auth-alert--err {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.22);
}

.auth-alert--err .auth-alert__ic {
  stroke: #f87171;
}

.auth-alert--ok {
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.22);
}

.auth-alert--ok .auth-alert__ic {
  stroke: #4ade80;
}

.field.is-invalid .input input,
.field.is-ok .input input {
  transition: border-color 0.15s;
}

.field.is-invalid .input input {
  border-color: rgba(248, 113, 113, 0.45);
}

.field.is-ok .input input {
  border-color: rgba(74, 222, 128, 0.35);
}

.field.is-invalid label {
  color: #f87171;
}

.dash-field.is-invalid label {
  color: #f87171;
}
.dash-field.is-invalid input {
  border-color: rgba(248, 113, 113, 0.45);
}
.dash-field.is-ok input {
  border-color: rgba(74, 222, 128, 0.35);
}

.field-hint {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  min-height: 0;
}
.field-hint.is-err { color: #f87171; }
.field-hint.is-ok { color: #4ade80; }
.field-hint[hidden] { display: none; }


.auth-card--done .auth-icon {
  display: none;
}

.auth-done {
  text-align: center;
  animation: authAlertIn 0.45s ease 0.1s both;
}

.auth-done__icon {
  width: 58px;
  height: 58px;
  margin: 4px auto 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.28);
  animation: authDonePop 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

.auth-done__icon svg {
  width: 28px;
  height: 28px;
  stroke: #4ade80;
  stroke-width: 2.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: authCheckDraw 0.45s ease 0.45s forwards;
}

.auth-done h1 {
  animation: none;
}

.rcv-ok-lead {
  color: var(--text-mut);
  font-size: 15px;
  line-height: 1.6;
  margin-top: 8px;
  text-wrap: balance;
}

.rcv-ok-lead strong {
  color: var(--text);
}


.btn.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-top-color: var(--accent-ink);
  border-radius: 50%;
  animation: authSpin 0.65s linear infinite;
}

.btn-ghost.is-loading::after {
  border-color: rgba(255, 255, 255, 0.15);
  border-top-color: var(--text);
}


.wwp-toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(22, 22, 22, 0.96);
  border: 1px solid var(--brd-2);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  opacity: 0;
  transform: translateX(-50%) translateY(14px);
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.wwp-toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.wwp-toast::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wwp-toast--ok::before {
  background: #4ade80;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

.wwp-toast--err::before {
  background: #f87171;
  box-shadow: 0 0 10px rgba(248, 113, 113, 0.45);
}

.wwp-toast--info::before {
  background: #fbbf24;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}


.checkout-grid {
  animation: checkoutIn 0.35s ease both;
}

@keyframes checkoutIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.checkout-grid .err {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .auth-card,
  .auth-logo,
  .auth-icon,
  .auth-card h1,
  .auth-card .lead,
  .auth-switch,
  .auth-card .form,
  .auth-foot,
  .auth-alert.is-visible,
  .auth-done,
  .auth-done__icon,
  .auth-done__icon svg,
  .checkout-grid {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    stroke-dashoffset: 0 !important;
  }

  .wwp-toast {
    transition: none;
  }
}

.captcha-field {
  margin-top: 0;
}

.captcha-panel {
  display: flex;
  align-items: stretch;
  min-height: 56px;
  border: 1px solid var(--brd);
  border-radius: 12px;
  background: var(--bg);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.captcha-panel:focus-within {
  border-color: var(--brd-2);
}

.captcha-media {
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  border-right: 1px solid var(--brd);
  background: #111;
}

.captcha-img {
  display: block;
  width: 180px;
  height: 56px;
  object-fit: contain;
  border: 0;
  background: #111;
}

.captcha-refresh {
  width: 44px;
  min-height: 56px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-left: 1px solid var(--brd);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-mut);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.captcha-refresh:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.captcha-refresh:disabled {
  opacity: 0.55;
  cursor: wait;
}

.captcha-refresh svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.captcha-answer {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 0.08em;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 12px 16px;
}

.captcha-answer::placeholder {
  color: var(--text-dim);
}

.captcha-answer:focus {
  outline: none;
}

.captcha-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 16px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--brd);
}
.auth-or span { flex: 0 0 auto; }

.auth-tg {
  display: block;
  width: 100%;
  margin: 0;
}

.auth-tg__btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--brd);
  border-radius: 12px;
  background: #0a0a0a;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.auth-tg__btn:hover {
  border-color: var(--brd-2);
  background: #111;
}
.auth-tg__btn.is-busy {
  opacity: 0.7;
  pointer-events: none;
}

.auth-tg__ic {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #229ED9;
  color: #fff;
}
.auth-tg__ic svg {
  width: 22px;
  height: 22px;
}

.auth-tg__txt {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.auth-tg__txt strong {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.auth-tg__txt em {
  font-style: normal;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  line-height: 1.3;
}

.auth-tg__chev {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  stroke: var(--text-dim);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* legacy cabinet / guest */
.btn-telegram {
  gap: 10px;
  background: #0a0a0a !important;
  color: var(--text) !important;
  border: 1px solid var(--brd) !important;
  box-shadow: none !important;
  font-weight: 700 !important;
}
.btn-telegram:hover {
  border-color: var(--brd-2) !important;
  background: #111 !important;
  color: var(--text) !important;
}
.btn-telegram.is-busy {
  opacity: 0.72;
  pointer-events: none;
}
.btn-telegram__ic {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: #229ED9;
}

@media (max-width: 420px) {
  .auth-card { padding: 24px 18px 22px; }
  .captcha-panel {
    flex-direction: column;
  }

  .captcha-media {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--brd);
  }

  .captcha-img {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }
}


.login-page {
  background: var(--bg);
  min-height: 100vh;
  position: relative;
  isolation: isolate;
}

.login-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(48% 32% at 50% -8%, rgba(255, 255, 255, 0.045), transparent 70%);
}

.login-app {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 420px);
  gap: 24px;
  align-items: stretch;
  padding-top: 124px;
  padding-bottom: 40px;
  animation: loginIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes loginIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.login-banner {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--brd);
  border-radius: 16px;
  background: #0c0c0c;
}

.login-banner__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 82% center;
}

.login-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(10, 10, 10, 0.96) 0%,
    rgba(10, 10, 10, 0.82) 42%,
    rgba(10, 10, 10, 0.28) 72%,
    rgba(10, 10, 10, 0.08) 100%
  );
}

.login-banner__body {
  position: relative;
  z-index: 1;
  padding: 36px 40px;
  max-width: 28rem;
}

.login-k {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.login-banner h1 {
  margin: 12px 0 0;
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.login-banner p {
  margin: 14px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-mut);
}

.login-points {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-points li {
  position: relative;
  padding-left: 22px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text);
}

.login-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ededed;
}

.login-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--brd);
  border-radius: 16px;
  padding: 28px 28px 24px;
}

.login-tabs {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 0 0 22px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--brd);
}

.login-tabs a {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dim);
  padding: 0 0 12px;
  margin-bottom: -13px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.login-tabs a:hover { color: var(--text-mut); }

.login-tabs a.is-on {
  color: var(--text);
  border-bottom-color: #ededed;
}

.login-card .auth-done {
  text-align: left;
  animation: none;
}
.login-card .auth-done h1 {
  text-align: left;
  margin: 0;
  font-size: 22px;
}
.login-page .auth-done__icon {
  margin: 0 0 16px;
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--brd-2);
}
.login-page .auth-done__icon svg {
  stroke: #ededed;
}

.login-card .form { margin-top: 0; }

.login-card .input input {
  background: #0a0a0a;
  color-scheme: dark;
}

.login-card .input input:focus {
  background: #0a0a0a;
  border-color: var(--brd-2);
}

.login-card input:-webkit-autofill,
.login-card input:-webkit-autofill:hover,
.login-card input:-webkit-autofill:focus {
  -webkit-text-fill-color: #ededed;
  caret-color: #ededed;
  box-shadow: 0 0 0 1000px #0a0a0a inset;
  transition: background-color 9999s ease-out;
}

.login-card .auth-submit { margin-top: 8px; }

.login-card .auth-tg { margin: 0 0 2px; }
.login-card .auth-or { margin: 16px 0; }

.login-foot {
  margin: 16px 0 0;
  font-size: 13px;
}

.login-foot a {
  color: var(--text-mut);
  font-weight: 500;
  transition: color 0.15s;
}

.login-foot a:hover { color: var(--text); }

.login-page footer { margin-top: 8px; }

.login-page .field.is-invalid .input input,
.login-page .field.is-ok .input input {
  border-color: var(--brd-2);
}

.login-page .field.is-invalid label,
.login-page .field.is-ok label {
  color: var(--text-mut);
}

html.is-reload .login-app { animation: none; }

@media (max-width: 880px) {
  .login-app {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-top: 108px;
  }
  .login-card { order: -1; }
  .login-points { display: none; }
  .login-banner { min-height: 0; }
  .login-banner__img { object-position: 78% center; opacity: 0.5; }
  .login-banner::after {
    background: linear-gradient(180deg, rgba(10, 10, 10, 0.88) 0%, rgba(10, 10, 10, 0.92) 100%);
  }
  .login-banner__body {
    max-width: none;
    padding: 22px 20px;
  }
  .login-banner h1 { font-size: 24px; }
  .login-banner p { margin-top: 10px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .login-app { animation: none; }
}
