/* Стили только для страницы входа/регистрации — без тяжёлого dashboard styles.css */

:root {
  --bg-start: #0f172a;
  --bg-end: #1e293b;
  --card-bg: rgba(15, 23, 42, 0.78);
  --card-border: rgba(255, 255, 255, 0.14);
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --accent: #8b5cf6;
  --accent-hover: #7c3aed;
  --input-bg: rgba(255, 255, 255, 0.08);
  --input-border: rgba(255, 255, 255, 0.2);
  --danger: #f43f5e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  background: linear-gradient(145deg, var(--bg-start), var(--bg-end));
  min-height: 100vh;
}

.auth-body {
  overflow-x: hidden;
}

.auth-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.auth-bg__blob {
  position: absolute;
  width: 40%;
  height: 40%;
  border-radius: 999px;
  filter: blur(120px);
}

.auth-bg__blob--left {
  top: -10%;
  left: -10%;
  background: rgba(79, 70, 229, 0.12);
}

.auth-bg__blob--right {
  right: -10%;
  bottom: -10%;
  background: rgba(147, 51, 234, 0.12);
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  z-index: 10;
}

.auth-page--landing {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-shell {
  width: min(100%, 560px);
}

.auth-card {
  width: min(640px, 100%);
  padding: 30px;
  border-radius: 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(8px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.3);
}

.auth-card--landing {
  width: 100%;
  padding: 8px;
  border-radius: 40px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 1) 100%);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  backdrop-filter: none;
}

.auth-card__tabs {
  gap: 0;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-card__body {
  padding: 32px 32px 28px;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}

.auth-logo__icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #6366f1;
  color: #fff;
  transform: rotate(3deg);
}

.auth-logo__svg {
  width: 24px;
  height: 24px;
}

.auth-logo__text {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-logo__text span {
  color: #818cf8;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.tab {
  flex: 1;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #94a3b8;
  padding: 20px 12px;
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-bottom-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab.is-active {
  color: #fff;
  border-bottom-color: #6366f1;
}

.form {
  display: none;
  gap: 20px;
}

.form.is-active {
  display: grid;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
}

.field span {
  margin-left: 4px;
  color: #64748b;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 16px;
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.6);
  font-size: 1rem;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

input:focus {
  outline: none;
  border-color: #818cf8;
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.1);
}

input:invalid.user-touched {
  border-color: var(--danger);
}

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #ffffff;
  width: 30px;
  height: 30px;
  padding: 0;
  cursor: pointer;
}

.btn-primary {
  margin-top: 2px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #f8f5ff;
  padding: 11px 14px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
  padding: 16px;
  border-radius: 18px;
  background: #4f46e5;
  box-shadow: 0 20px 40px rgba(79, 70, 229, 0.2);
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.auth-submit:hover {
  background: #6366f1;
}

.register-consents {
  display: grid;
  gap: 6px;
  margin-top: -4px;
}

.consent-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 6px 8px;
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.35);
}

.consent-row__checkbox {
  margin: 2px 0 0;
  width: 16px;
  height: 16px;
  min-width: 16px;
  padding: 0;
  border-radius: 4px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: rgba(15, 23, 42, 0.95);
  box-shadow: none;
  appearance: auto;
  -webkit-appearance: checkbox;
  flex-shrink: 0;
}

.consent-row__checkbox:focus {
  box-shadow: none;
}

.consent-row a {
  color: #93c5fd;
  font-size: 0.78rem;
  line-height: 1.22;
  text-decoration: none;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.consent-row a:hover,
.consent-row a:focus-visible {
  text-decoration: underline;
}

.consent-row--error {
  border-color: rgba(244, 63, 94, 0.9);
  background: rgba(127, 29, 29, 0.22);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  display: block;
  margin: 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hint {
  min-height: 20px;
  margin: -3px 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.hint.error {
  color: var(--danger);
}

.hint.success {
  color: #c4b5fd;
}

.request-message {
  min-height: 20px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.88rem;
  color: transparent;
}

.request-message.error {
  color: #fecdd3;
  border-color: rgba(244, 63, 94, 0.5);
  background: rgba(244, 63, 94, 0.14);
}

.request-message.success {
  color: #ddd6fe;
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(139, 92, 246, 0.14);
}

.request-message.info {
  color: var(--text-muted);
  border-color: var(--card-border);
  background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 640px) {
  .auth-card__body {
    padding: 24px 20px 22px;
  }

  .auth-grid {
    grid-template-columns: 1fr;
  }
}

/* Мобильные устройства: слабее blur и меньше слоёв композитинга */
@media (max-width: 768px) {
  .auth-bg__blob {
    filter: blur(48px);
    width: 55%;
    height: 32%;
  }

  .auth-card {
    backdrop-filter: none;
  }

  .tab {
    transition-duration: 0.15s;
  }

  input {
    transition-duration: 0.12s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-bg__blob {
    filter: blur(24px);
  }

  .tab,
  input {
    transition: none;
  }
}
