/* Login page styles — extracted from inline <style> */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

.skip-link {
  position: fixed;
  top: 0;
  left: 16px;
  z-index: 10000;
  padding: 12px 24px;
  background: var(--login-accent);
  color: #fff;
  border-radius: 0 0 8px 8px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transform: translateY(-100%);
  transition: transform 0.2s;
}
.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid #fff;
  outline-offset: 2px;
}

:root {
  /* Палитра «Классика» (как в админке) — светлая */
  --login-accent: var(--color-accent, #FF6B35);
  --login-accent-hover: var(--color-accent-hover, #E85A25);
  --login-bg: var(--color-bg-page, #F8F9FB);
  --login-card-bg: #EFF2F8;            /* off-white — мягче на тёмном */
  --login-card-border: #E4E8F1;
  --login-input-bg: #FFFFFF;
  --login-text: #2A3142;               /* мягкий слейт, не чёрный */
  --login-text-secondary: #5A6273;
  --login-text-muted: #8A91A0;
  /* Текст поверх тёмного фона (вне карточки) */
  --login-on-bg: rgba(255,255,255,.92);
  --login-on-bg-muted: rgba(255,255,255,.58);
  --login-error: var(--color-error, #DC2626);
  --login-radius: 16px;
  --login-radius-sm: 12px;
  --login-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  font-family: var(--login-font);
  background:
    radial-gradient(1000px 600px at 50% -4%, rgba(96,134,214,.20), transparent 60%),
    linear-gradient(180deg, #283655 0%, #1E2945 55%, #1A2240 100%);
  background-color: #1E2945;
  color: var(--login-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.login-page {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 20px 64px;
}
.login-card { max-width: 460px; }
.login-register-link { max-width: 460px; }

.login-logo { margin-bottom: 40px; }
.login-logo img {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1); /* белое лого на тёмном фоне */
}

.login-card {
  width: 100%;
  background: var(--login-card-bg);
  border: 1px solid var(--login-card-border);
  border-radius: var(--login-radius);
  padding: 40px 32px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(10,16,40,.18), 0 16px 44px rgba(10,16,40,.30);
}

.login-screen {
  display: none;
  animation: loginFadeUp 0.3s ease-out;
}
.login-screen.active { display: block; }

@keyframes loginFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen-title {
  font-size: clamp(20px, 5vw, 24px);
  font-weight: 800;
  margin-bottom: 8px;
  text-align: center;
}

.screen-desc {
  font-size: 14px;
  color: var(--login-text-secondary);
  line-height: 1.6;
  text-align: center;
  margin-bottom: 32px;
}

.form-group { margin-bottom: 24px; }

/* Инпуты/лейбл — в стиле формы регистрации (.wizard-label / .wizard-input) */
.form-label {
  display: block;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 10px;
  letter-spacing: 0;
  text-transform: none;
}

.form-input {
  width: 100%;
  padding: 20px 24px;
  background: #fff;
  border: 2px solid #E4E8F1;
  border-radius: 16px;
  color: #1a1a1a;
  font-size: 18px;
  font-family: var(--font-family);
  transition: border-color 0.25s, box-shadow 0.25s, background-color 0.25s;
  -webkit-appearance: none;
  appearance: none;
}
.form-input:focus {
  outline: none;
  border-color: #111827;
  box-shadow: 0 0 0 4px rgba(255,107,53,.1);
  background-color: #FAFCFF;
}
.form-input::placeholder { color: var(--login-text-muted); }

.form-error {
  font-size: 13px;
  color: var(--login-error);
  margin-top: 6px;
  min-height: 18px;
}

.btn-primary {
  width: 100%;
  padding: 22px 32px;
  background: var(--login-accent);
  color: #fff;
  border: none;
  border-radius: 9999px;
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-family);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn-primary { box-shadow: 0 6px 16px rgba(255,107,53,.22); }
.btn-primary:hover:not(:disabled) { background: var(--login-accent-hover); box-shadow: 0 8px 20px rgba(255,107,53,.32); }
.btn-primary:active:not(:disabled) { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.alert-error {
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid rgba(255, 68, 68, 0.3);
  border-radius: var(--login-radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--login-error);
  margin-top: 16px;
  text-align: center;
}

/* OTP Screen */
.otp-email-hint {
  font-size: 14px;
  color: var(--login-text-secondary);
  text-align: center;
  margin-bottom: 28px;
}

.otp-digits {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}

.otp-digit {
  width: 48px;
  height: 56px;
  background: var(--login-input-bg);
  border: 1.5px solid var(--login-card-border);
  border-radius: var(--login-radius-sm);
  color: var(--login-text);
  font-size: 24px;
  font-weight: 700;
  font-family: var(--login-font);
  text-align: center;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.otp-digit:focus {
  outline: none;
  border-color: var(--login-accent);
}
.otp-digit.filled { border-color: var(--login-accent); }

.otp-error {
  font-size: 13px;
  color: var(--login-error);
  text-align: center;
  margin-bottom: 16px;
  min-height: 18px;
}

.otp-actions {
  text-align: center;
  margin-top: 24px;
}

.otp-timer {
  font-size: 13px;
  color: var(--login-text-muted);
}

.btn-link {
  background: none;
  border: none;
  color: var(--login-accent);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--login-font);
  cursor: pointer;
  padding: 0;
}
.btn-link:hover { text-decoration: underline; }

.otp-change {
  margin-top: 16px;
  text-align: center;
}
.otp-change .btn-link {
  color: var(--login-text-muted);
  font-weight: 500;
}

#otp-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

/* Register link */
.login-register-link {
  margin-top: 24px;
  text-align: center;
  font-size: 14px;
  color: var(--login-on-bg-muted);
}
.login-register-link a {
  color: var(--login-accent);
  text-decoration: none;
  font-weight: 600;
}
.login-register-link a:hover { text-decoration: underline; }

/* Footer */
.login-footer {
  margin-top: 24px;
  text-align: center;
}

.login-contacts {
  font-size: 13px;
  color: var(--login-on-bg-muted);
  line-height: 1.8;
}
.login-contacts a {
  color: var(--login-on-bg);
  text-decoration: none;
  transition: color 0.2s;
}
.login-contacts a:hover { color: var(--login-accent); }

.login-admin-link {
  margin-top: 16px;
  font-size: 12px;
}
.login-admin-link a {
  color: var(--login-on-bg-muted);
  text-decoration: none;
}
.login-admin-link a:hover { color: var(--login-text-secondary); }

/* Responsive */
@media (max-width: 480px) {
  body { padding: 16px 12px; }
  .login-card { padding: 32px 20px; }
  .otp-digit { width: 42px; height: 50px; font-size: 20px; }
  .otp-digits { gap: 6px; }
}

@media (max-width: 360px) {
  .otp-digit { width: 38px; height: 46px; font-size: 18px; }
  .otp-digits { gap: 5px; }
  .login-card { padding: 28px 16px; }
}
