/* auth.css — слой стилей под /sing/* (signin, signup) для Overdozz */

/* fallback-переменные на случай если основной theme не подгрузился */
:root {
  --auth-text: var(--text-color, #ebebeb);
  --auth-text-muted: var(--text-color-alower, rgba(255, 255, 255, 0.48));
  --auth-bg: var(--bg-color, #090909);
  --auth-surface: var(--bg-second-color, #161519);
  --auth-border: var(--border-color, rgba(255, 255, 255, 0.08));
  --auth-accent: var(--accent-color, #70abdb);
  --auth-input-bg: color-mix(in srgb, var(--auth-surface), black 20%);
  --auth-input-border: var(--auth-border);
  --auth-error: #ff6b6b;
  --auth-radius: 14px;
}

html, body {
  background: var(--auth-bg);
  color: var(--auth-text);
}

/* основной контейнер */
.auth-shell {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 96px 24px 64px;
  position: relative;
  overflow: hidden;
}

.auth-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 50% 0%, color-mix(in srgb, var(--auth-accent) 28%, transparent) 0%, transparent 70%),
    radial-gradient(40% 40% at 100% 100%, color-mix(in srgb, var(--auth-accent) 12%, transparent) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--auth-surface) 92%, transparent), var(--auth-surface));
  border: 1px solid var(--auth-border);
  border-radius: 20px;
  padding: 36px 32px 28px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 30px 80px -40px rgba(0, 0, 0, 0.7),
    0 10px 30px -20px color-mix(in srgb, var(--auth-accent) 35%, transparent);
}

.auth-card .auth-head {
  text-align: center;
  margin-bottom: 28px;
}

.auth-card .auth-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--auth-accent) 14%, transparent);
  color: var(--auth-accent);
  font-size: 22px;
  margin-bottom: 16px;
  border: 1px solid color-mix(in srgb, var(--auth-accent) 35%, transparent);
}

.auth-card h1 {
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.auth-card .auth-sub {
  margin: 0;
  color: var(--auth-text-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* поля */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-field-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.auth-field label {
  font-size: 13px;
  color: var(--auth-text-muted);
  letter-spacing: 0.01em;
}

.auth-field-link {
  font-size: 12.5px;
  color: var(--auth-accent);
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.auth-field-link:hover { opacity: 0.8; }

.auth-input {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--auth-input-bg);
  border: 1px solid var(--auth-input-border);
  border-radius: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-input i.auth-input-icon {
  position: absolute;
  left: 14px;
  font-size: 14px;
  color: var(--auth-text-muted);
  pointer-events: none;
}

.auth-input input {
  width: 100%;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--auth-text);
  font-size: 14.5px;
  padding: 13px 14px 13px 42px;
  font-family: inherit;
}

.auth-input input::placeholder {
  color: color-mix(in srgb, var(--auth-text) 35%, transparent);
}

.auth-input:focus-within {
  border-color: color-mix(in srgb, var(--auth-accent) 60%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-accent) 18%, transparent);
}

.auth-input.has-toggle input { padding-right: 44px; }

.auth-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  color: var(--auth-text-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}
.auth-toggle:hover {
  color: var(--auth-text);
  background: color-mix(in srgb, var(--auth-text) 6%, transparent);
}

/* чекбокс */
.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--auth-text-muted);
  user-select: none;
  line-height: 1.45;
}

.auth-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--auth-border);
  border-radius: 5px;
  background: var(--auth-input-bg);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  margin-top: 1px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.auth-check input[type="checkbox"]:checked {
  background: var(--auth-accent);
  border-color: var(--auth-accent);
}
.auth-check input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #0b0d10;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.auth-check a {
  color: var(--auth-accent);
  text-decoration: none;
}
.auth-check a:hover { text-decoration: underline; }

/* сообщение об ошибке */
.auth-message {
  min-height: 18px;
  font-size: 13px;
  color: var(--auth-error);
  margin-top: -4px;
}
.auth-message.is-success { color: #5ed29c; }

/* кнопки */
.auth-submit {
  width: 100%;
  appearance: none;
  border: 1px solid var(--btn-primary-border, var(--auth-accent));
  background: var(--btn-primary-bg, var(--auth-accent));
  color: var(--btn-primary-text, #0b0d10);
  font-size: 14.5px;
  font-weight: 600;
  padding: 13px 16px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: filter 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}
.auth-submit:hover { filter: brightness(1.08); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* нижняя ссылка */
.auth-footer-line {
  margin: 22px 0 0;
  text-align: center;
  font-size: 13.5px;
  color: var(--auth-text-muted);
}
.auth-footer-line a {
  color: var(--auth-accent);
  text-decoration: none;
  font-weight: 500;
}
.auth-footer-line a:hover { text-decoration: underline; }

/* разделитель */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 -4px;
  color: var(--auth-text-muted);
  font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--auth-border);
}

/* доп подгон под Next-шапку, чтобы не было прыжков */
.auth-shell main { width: 100%; }

/* страничка-кнопки в хедере для других страниц */
.header-auth-actions .btn-auth {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--border-color, var(--auth-border));
  color: var(--text-color, var(--auth-text));
  background: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.header-auth-actions .btn-auth:hover {
  border-color: color-mix(in srgb, var(--accent-color, var(--auth-accent)) 50%, transparent);
}
.header-auth-actions .btn-auth.is-primary {
  background: var(--btn-primary-bg, var(--auth-accent));
  border-color: var(--btn-primary-border, var(--auth-accent));
  color: var(--btn-primary-text, #0b0d10);
}
.header-auth-actions .btn-auth.is-primary:hover {
  filter: brightness(1.08);
}
.header-auth-actions {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

/* адаптив */
@media (max-width: 520px) {
  .auth-card {
    padding: 28px 22px 22px;
    border-radius: 16px;
  }
  .auth-card h1 { font-size: 22px; }
}
