/* ── СБРОС И БАЗОВЫЕ СТИЛИ ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #060b18;
  --bg2:        #0a1020;
  --bg3:        #0d1526;
  --card:       #0f1a2e;
  --border:     rgba(30, 58, 110, 0.7);
  --border-focus: rgba(59, 130, 246, 0.65);
  --blue:       #3b82f6;
  --blue-mid:   #2563a8;
  --blue-light: #60a5fa;
  --blue-pale:  #93c5fd;
  --blue-ghost: #bfdbfe;
  --text:       #e2e8f0;
  --muted:      #94a3b8;
  --dim:        #64748b;
  --error:      #f87171;
  --success:    #86efac;
}

html, body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
}

/* Звёздный фон */
body {
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(29, 78, 216, 0.14) 0%, transparent 65%),
    var(--bg);
  background-attachment: fixed;
}

/* Сетка */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(30, 58, 110, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 58, 110, 0.055) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* Скроллбар */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: #1e3a6e; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue-mid); }

/* ── HEADER PLACEHOLDER ── */
#header-placeholder { position: relative; z-index: 2; }

/* ── СТРАНИЦА РЕГИСТРАЦИИ ── */
.auth-page {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px 48px;
}

/* Логотип над формой */
.auth-brand {
  text-align: center;
  margin-bottom: 28px;
}

.auth-brand-name {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.14em;
  background: linear-gradient(90deg, #93c5fd 0%, #fff 42%, #60a5fa 65%, #93c5fd 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
}

.auth-brand-sub {
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

/* Карточка формы */
.auth-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(145deg, rgba(13, 21, 38, 0.97), rgba(10, 16, 32, 0.97));
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(24px);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(30, 58, 110, 0.2);
}

/* Шапка карточки */
.auth-card-header {
  display: flex;
  justify-content: space-between;
  padding: 24px 28px 0;
  border-bottom: 1px solid rgba(30, 58, 110, 0.4);
  padding-bottom: 0;
}

.auth-card-title {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--blue-pale);
  padding-bottom: 14px;
  flex: 1;
  text-align: center;
  display: inline-block;
  background-color: transparent;
  border-color: transparent;
  transition: all 0.3s ease;
}
.auth-card-title:hover {
  font-size:17px;
  transition: all 0.3s ease;
}

.auth-card-title.enabled {
  border-bottom: 2px solid var(--blue);
}

/* Тело формы */
.auth-card-body {
  padding: 28px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Поле ввода */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group label,
.field-label {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--dim);
  display: block;
  margin-bottom: 6px;
}

/* Стили для input — применятся к #username, #password, #password2 */
input[type="text"],
input[type="password"],
input[type="email"],
input:not([type]) {
  width: 100%;
  background: rgba(10, 16, 32, 0.85);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 7px;
  padding: 12px 16px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.22s, box-shadow 0.22s;
  display: block;
}

input::placeholder { color: #334155; }

input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.13), inset 0 1px 3px rgba(0,0,0,0.3);
}

input:hover:not(:focus) {
  border-color: rgba(37, 99, 168, 0.9);
}

/* Иконки внутри поля (опционально) */
.field-wrap {
  position: relative;
}
.field-wrap .field-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dim);
  font-size: 14px;
  pointer-events: none;
}

/* Кнопка отправки */
.btn-register {
  width: 100%;
  padding: 13px;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #3b82f6 100%);
  border: 1px solid rgba(96, 165, 250, 0.4);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.24s ease;
  position: relative;
  overflow: hidden;
  margin-top: 4px;
}

.btn-register::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.24s;
}

button[onclick="register()"]:hover::before,
.btn-register:hover::before { opacity: 1; }

button[onclick="register()"]:hover,
.btn-register:hover {
  border-color: rgba(147, 197, 253, 0.7);
  box-shadow: 0 0 22px rgba(59, 130, 246, 0.5), 0 0 48px rgba(59, 130, 246, 0.18);
  transform: translateY(-2px);
}

button[onclick="register()"]:active,
.btn-register:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Результат / сообщение */
.result {
  font-size: 13px;
  line-height: 1.5;
  border-radius: 6px;
  padding: 0;
  transition: all 0.22s;
  min-height: 0;
}

#result:not(:empty) {
  padding: 10px 14px;
}

.result.error {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: var(--error);
}

.result.success {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: var(--success);
}

/* Ссылка «войти» */
.auth-footer-text {
  text-align: center;
  color: var(--dim);
  font-size: 13px;
  margin-top: 4px;
}

.auth-footer-text a,
.auth-link {
  color: var(--blue-light);
  text-decoration: none;
  transition: color 0.18s;
}

.auth-footer-text a:hover,
.auth-link:hover { color: var(--blue-pale); text-decoration: underline; }

/* Декоративная линия-разделитель */
.auth-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(37, 99, 168, 0.5) 30%, rgba(59, 130, 246, 0.4) 50%, rgba(37, 99, 168, 0.5) 70%, transparent);
  margin: 4px 0;
}

/* ── АНИМАЦИИ ── */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-card {
  animation: fadeInUp 0.55s ease forwards;
}

/* ── АДАПТИВ ── */
@media (max-width: 480px) {
  .auth-card-body { padding: 22px 18px 26px; }
  .auth-card-header { padding: 20px 18px 0; }
}

