:root {
  --wine: #7d243b;
  --wine-dark: #651b30;
  --ink: #261a1e;
  --muted: #82767a;
  --line: rgba(82, 29, 45, .12);
  --soft: #f4e9ec;
  --surface: rgba(255, 255, 255, .88);
  --danger: #b52d45;
  --success: #31705a;
  font-family: "Roboto Condensed", Arial, sans-serif;
  color: var(--ink);
  background: #f8f5f6;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: #f8f5f6; -webkit-text-size-adjust: 100%; }
body {
  min-width: 320px; min-height: 100vh; margin: 0;
  background:
    radial-gradient(circle at 8% 4%, rgba(125,36,59,.12), transparent 29rem),
    radial-gradient(circle at 92% 90%, rgba(125,36,59,.07), transparent 26rem),
    #f8f5f6;
  color: var(--ink); -webkit-font-smoothing: antialiased;
}
.auth-short { height: 100svh; min-height: 0; overflow: hidden; }
.auth-short .auth-shell { height: 100%; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: none; }
@supports (height: 100dvh) { .auth-short { height: 100dvh; } }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
.auth-shell {
  width: min(560px, 100%); min-height: 100vh; margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 20px calc(30px + env(safe-area-inset-bottom));
}
.auth-home {
  display: inline-flex; align-items: center; gap: 4px; min-height: 42px; margin-bottom: 12px;
  color: var(--wine); font-size: 15px; font-weight: 700; -webkit-tap-highlight-color: transparent;
}
.auth-home span { margin-top: -2px; font-size: 30px; font-weight: 300; line-height: 18px; }
.auth-card {
  position: relative; overflow: hidden; padding: 28px;
  border: 1px solid rgba(82,29,45,.09); border-radius: 30px;
  background: var(--surface); box-shadow: 0 24px 70px rgba(75,33,46,.12);
  backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%);
}
.auth-card::before {
  position: absolute; width: 190px; height: 190px; top: -115px; right: -85px; content: "";
  border-radius: 50%; background: rgba(125,36,59,.07); pointer-events: none;
}
.auth-brand { position: relative; display: flex; align-items: center; gap: 10px; margin-bottom: 30px; }
.auth-brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px; overflow: hidden; border-radius: 14px;
  background: #fff; box-shadow: 0 9px 24px rgba(101,27,48,.2);
}
.auth-brand-logo { display: block; width: 100%; height: 100%; object-fit: cover; }
.auth-brand b, .auth-brand small { display: block; }
.auth-brand b { font-size: 16px; line-height: 1.1; }
.auth-brand small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.auth-heading { position: relative; margin-bottom: 24px; }
.auth-heading > span { color: var(--wine); font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.auth-heading h1 { margin: 5px 0 0; font-size: clamp(34px, 9vw, 44px); line-height: .98; letter-spacing: -.045em; }
.auth-heading p { max-width: 390px; margin: 11px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.field { display: block; margin: 15px 0; }
.field-label { display: block; margin: 0 0 7px 2px; color: #584a4f; font-size: 13px; font-weight: 700; }
.field-label em { margin-left: 5px; color: var(--muted); font-size: 10px; font-style: normal; font-weight: 500; }
.field > input, .phone-input, .password-input {
  display: flex; width: 100%; min-height: 52px; align-items: center;
  border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.92);
  box-shadow: 0 7px 22px rgba(82,29,45,.035); transition: border-color .18s, box-shadow .18s, background .18s;
}
.field > input { padding: 0 15px; outline: 0; color: var(--ink); }
.phone-input b {
  display: grid; place-items: center; align-self: stretch; min-width: 54px;
  border-right: 1px solid var(--line); color: var(--ink); font-size: 16px;
}
.phone-input input, .password-input input {
  width: 100%; min-width: 0; height: 50px; padding: 0 14px; border: 0; outline: 0; background: transparent; color: var(--ink);
}
.password-input input { padding-right: 4px; }
.password-toggle {
  display: grid; place-items: center; flex: 0 0 46px; width: 46px; height: 46px;
  margin-right: 2px; padding: 0; border: 0; border-radius: 14px; background: transparent;
  color: #8b7d82; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.password-toggle svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle.is-visible { color: var(--wine); background: var(--soft); }
.field:focus-within > input, .field:focus-within .phone-input, .field:focus-within .password-input {
  border-color: rgba(125,36,59,.48); box-shadow: 0 0 0 4px rgba(125,36,59,.08), 0 8px 24px rgba(82,29,45,.05);
}
.field-error, .field-hint { display: block; min-height: 16px; margin: 5px 2px 0; font-size: 11px; line-height: 1.3; }
.field-error { color: var(--danger); }
.field-hint { color: var(--muted); }
.field.is-error > input, .field.is-error .phone-input, .field.is-error .password-input { border-color: rgba(181,45,69,.62); background: #fffafb; box-shadow: 0 0 0 4px rgba(181,45,69,.07); }
.field.is-valid > input, .field.is-valid .phone-input { border-color: rgba(49,112,90,.38); }
.field.is-valid .field-error { color: var(--success); }
.field.is-checking .field-error::after { content: "Проверяем…"; color: var(--muted); }
.referral-code-field { margin-top: 18px; padding: 14px; border: 1px solid rgba(125,36,59,.09); border-radius: 18px; background: rgba(125,36,59,.025); }
.referral-code-field .field-label { color: var(--wine); }
.referral-code-field .referral-code-input { min-height: 48px; color: var(--wine); font-size: 17px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.referral-code-field.is-applied { border-color: rgba(49,112,90,.22); background: rgba(49,112,90,.045); }
.referral-code-field.is-applied .field-hint { color: var(--success); }
.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 18px 2px 8px; color: #66575c; font-size: 12px; line-height: 1.35; }
.check input { width: 19px; height: 19px; margin: -1px 0 0; accent-color: var(--wine); }
.consent-error { margin: 0 2px 10px; }
.btn {
  width: 100%; min-height: 52px; margin-top: 7px; padding: 0 18px; border: 0; border-radius: 16px;
  background: linear-gradient(145deg, #842940, #6b1f34); color: #fff;
  box-shadow: 0 12px 28px rgba(107,31,52,.2); font-family: inherit; font-size: 15px; font-weight: 750;
  cursor: pointer; transition: transform .16s, opacity .16s; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .55; cursor: default; }
.msg { min-height: 18px; margin: 10px 3px 0; color: var(--danger); font-size: 12px; text-align: center; }
.msg.ok { color: var(--success); }
.auth-links { display: flex; justify-content: space-between; gap: 16px; margin-top: 22px; font-size: 13px; font-weight: 700; }
.auth-links a { color: var(--wine); }
.auth-links.single { justify-content: center; }
.confirm-box { margin-top: 18px; }
.confirm-divider { display: flex; align-items: center; gap: 10px; margin: 4px 0 18px; color: var(--muted); font-size: 11px; }
.confirm-divider::before, .confirm-divider::after { height: 1px; flex: 1; content: ""; background: var(--line); }
.code-input { font-size: 20px; font-weight: 700; letter-spacing: .22em; }
.hidden { display: none !important; }
@media (max-width: 600px) {
  .auth-shell { padding-right: 14px; padding-left: 14px; }
  .auth-home { margin-left: 3px; }
  .auth-card { padding: 23px 19px 24px; border-radius: 25px; }
  .auth-brand { margin-bottom: 26px; }
  .auth-heading { margin-bottom: 21px; }
  .auth-grid { grid-template-columns: 1fr; gap: 0; }
  .field { margin: 13px 0; }
}
@media (max-width: 370px) {
  .auth-shell { padding-right: 10px; padding-left: 10px; }
  .auth-card { padding-right: 16px; padding-left: 16px; }
  .auth-links { gap: 10px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
