/* Auth pages: login, register, verify email */

:root {
  --bg: #06080d;
  --text: #ecf6d2;
  --muted: #9cb077;
  --accent: #aef31f;
}

.auth-body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.auth-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(72px, 10vh) 20px 32px;
  isolation: isolate;
  width: 100%;
  box-sizing: border-box;
}

.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.auth-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}

.auth-glow--a {
  width: min(520px, 70vw);
  height: min(520px, 70vw);
  top: -12%;
  left: -8%;
  background: radial-gradient(circle, rgba(174, 243, 31, 0.35) 0%, transparent 68%);
}

.auth-glow--b {
  width: min(440px, 60vw);
  height: min(440px, 60vw);
  right: -10%;
  bottom: -18%;
  background: radial-gradient(circle, rgba(120, 180, 40, 0.22) 0%, transparent 70%);
}

.auth-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(174, 243, 31, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(174, 243, 31, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, #000 20%, transparent 100%);
}

.auth-back {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  left: max(18px, env(safe-area-inset-left));
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(174, 243, 31, 0.22);
  background: rgba(8, 12, 18, 0.72);
  backdrop-filter: blur(10px);
  color: #d7ecac;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.auth-back:hover {
  color: var(--accent);
  border-color: rgba(174, 243, 31, 0.45);
  transform: translateY(-1px);
}

.auth-back-icon {
  color: var(--accent);
  font-size: 1rem;
  line-height: 1;
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  flex-shrink: 0;
}

.auth-page .auth-card {
  position: relative;
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(174, 243, 31, 0.22);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 24px 64px rgba(0, 0, 0, 0.5);
  background: linear-gradient(180deg, rgba(14, 19, 28, 0.98) 0%, rgba(8, 11, 17, 0.99) 100%);
}

.auth-card-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent) 20%, #d4ff6a 50%, var(--accent) 80%, transparent);
  z-index: 2;
}

.auth-page .auth-card-brand {
  padding: 22px 26px 18px;
  text-align: center;
  background: linear-gradient(180deg, rgba(174, 243, 31, 0.08) 0%, transparent 100%);
  border-bottom: 1px solid rgba(174, 243, 31, 0.1);
}

.auth-card-brand .auth-brand-logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #f0ffd1;
}

.auth-card-brand .auth-brand-eyebrow {
  margin-top: 6px;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.auth-page .auth-card-inner {
  padding: 26px 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: rgba(5, 9, 14, 0.65);
}

.auth-page .auth-card-head {
  margin-bottom: 20px;
}

.auth-page .auth-badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #111;
  background: var(--accent);
}

.auth-page .auth-title {
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f0ffd1;
  margin: 0 0 8px;
  line-height: 1.15;
}

.auth-page .auth-lead {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
  max-width: 38ch;
}

.auth-page .auth-card-body {
  display: flex;
  flex-direction: column;
}

.auth-page .auth-form {
  display: grid;
  gap: 14px;
  width: 100%;
}

.auth-page .auth-form--secondary {
  margin-top: 12px;
  gap: 0;
}

.auth-page .auth-group {
  margin-bottom: 0;
}

.auth-page .auth-group label {
  display: block;
  font-size: 0.74rem;
  color: #bdd48f;
  margin-bottom: 6px;
  letter-spacing: 0.4px;
  font-weight: 500;
}

.auth-page .auth-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(174, 243, 31, 0.22);
  border-radius: 10px;
  background: rgba(7, 12, 18, 0.95);
  color: #eef9d7;
  padding: 12px 13px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-page .auth-input:focus {
  border-color: rgba(174, 243, 31, 0.52);
  box-shadow: 0 0 0 3px rgba(174, 243, 31, 0.15);
}

.auth-page .auth-input.invalid {
  border-color: #ff7b7b;
  box-shadow: 0 0 0 3px rgba(255, 123, 123, 0.14);
}

.auth-page .auth-input:-webkit-autofill,
.auth-page .auth-input:-webkit-autofill:hover,
.auth-page .auth-input:-webkit-autofill:focus,
.auth-page .auth-input:-webkit-autofill:active {
  -webkit-text-fill-color: #eef9d7 !important;
  caret-color: #eef9d7;
  border: 1px solid rgba(174, 243, 31, 0.22) !important;
  -webkit-box-shadow: 0 0 0 1000px rgba(7, 12, 18, 0.95) inset !important;
  box-shadow: 0 0 0 1000px rgba(7, 12, 18, 0.95) inset !important;
}

.auth-page .field-error {
  color: #ff9a9a;
  font-size: 0.72rem;
  margin-top: 4px;
  min-height: 1em;
  line-height: 1.2;
}

.auth-page .auth-input--code {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.auth-page .auth-flash {
  padding: 11px 13px;
  border-radius: 12px;
  font-size: 0.84rem;
  margin-bottom: 16px;
  line-height: 1.4;
}

.auth-page .auth-flash--success {
  background: rgba(174, 243, 31, 0.1);
  border: 1px solid rgba(174, 243, 31, 0.32);
  color: #e8ffc8;
}

.auth-page .auth-flash--error {
  background: rgba(255, 90, 90, 0.08);
  border: 1px solid rgba(255, 120, 120, 0.35);
  color: #ffd0d0;
}

.auth-page .auth-dev-hint {
  font-size: 0.78rem;
  color: #8fa86c;
  margin: 0 0 14px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(174, 243, 31, 0.06);
  border: 1px dashed rgba(174, 243, 31, 0.2);
}

.auth-page .auth-dev-hint a {
  color: var(--accent);
  margin-left: 4px;
}

.auth-page .auth-links {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(174, 243, 31, 0.12);
  display: grid;
  gap: 8px;
  text-align: center;
}

.auth-page .auth-links p {
  font-size: 0.84rem;
  color: var(--muted);
  margin: 0;
}

.auth-page .auth-links a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  margin-left: 6px;
}

.auth-page .auth-links a:hover {
  text-decoration: underline;
}

.auth-page .auth-label-optional::after {
  content: " · необязательно";
  font-weight: 400;
  color: #7d9460;
  font-size: 0.68rem;
  letter-spacing: 0;
}

.auth-page .auth-submit {
  width: 100%;
  margin-top: 4px;
  border: none;
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  color: #111;
  background: linear-gradient(180deg, #c8f541 0%, var(--accent) 45%, #8fc41a 100%);
  box-shadow: 0 4px 0 #5a8a12, 0 12px 28px rgba(174, 243, 31, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.auth-page .auth-submit:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 4px 0 #5a8a12, 0 16px 32px rgba(174, 243, 31, 0.3);
}

.auth-page .auth-submit:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #5a8a12, 0 6px 16px rgba(174, 243, 31, 0.18);
}

.auth-page .auth-submit--ghost {
  background: transparent;
  color: #d7ecac;
  border: 1px solid rgba(174, 243, 31, 0.28);
  box-shadow: none;
}

.auth-page .auth-submit--ghost:hover {
  background: rgba(174, 243, 31, 0.08);
  box-shadow: none;
  transform: translateY(-1px);
}

.auth-page .auth-submit--ghost:active {
  transform: translateY(0);
}

@media (max-width: 480px) {
  .auth-page {
    padding: 64px 16px 24px;
  }

  .auth-shell {
    max-width: 100%;
  }

  .auth-page .auth-card {
    border-radius: 16px;
  }

  .auth-page .auth-card-inner {
    padding: 20px 18px 22px;
  }

  .auth-page .auth-card-brand {
    padding: 18px 18px 14px;
  }

  .auth-back span:not(.auth-back-icon) {
    display: none;
  }

  .auth-back {
    padding: 9px 12px;
  }
}

.auth-page .auth-oauth {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(174, 243, 31, 0.12);
}

.auth-page .auth-oauth-label {
  margin: 0 0 12px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-page .auth-oauth-buttons {
  display: grid;
  gap: 10px;
}

.auth-page .auth-oauth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border: 1px solid rgba(174, 243, 31, 0.24);
  border-radius: 12px;
  padding: 11px 14px;
  background: rgba(8, 12, 18, 0.85);
  color: #e8f5c8;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.auth-page .auth-oauth-btn__icon {
  display: inline-flex;
  flex-shrink: 0;
}

.auth-page .auth-oauth-btn__label {
  line-height: 1;
}

.auth-page .auth-oauth-btn--yandex {
  border-color: rgba(252, 63, 29, 0.45);
  background: rgba(252, 63, 29, 0.1);
  color: #fff;
}

.auth-page .auth-oauth-btn--yandex:hover {
  border-color: rgba(252, 63, 29, 0.75);
  background: rgba(252, 63, 29, 0.18);
}

.auth-page .auth-oauth-btn--yandex .auth-oauth-btn__icon {
  color: #fc3f1d;
}

.auth-page .auth-oauth-btn--vk {
  border-color: rgba(0, 119, 255, 0.45);
  background: rgba(0, 119, 255, 0.1);
  color: #fff;
}

.auth-page .auth-oauth-btn--vk .auth-oauth-btn__icon {
  color: #0077ff;
}

.auth-page .auth-oauth-btn--vk:hover {
  border-color: rgba(0, 119, 255, 0.75);
  background: rgba(0, 119, 255, 0.18);
}

.auth-page .auth-oauth-btn:hover {
  border-color: rgba(174, 243, 31, 0.45);
  background: rgba(174, 243, 31, 0.08);
  transform: translateY(-1px);
}

.auth-page .auth-oauth form {
  margin: 0;
}
