/* Окно входа в стиле Windows 11 */
:root {
  --login-bg: rgba(255, 255, 255, 0.65);
  --login-border: rgba(0, 0, 0, 0.06);
  --login-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
  --login-text: #1a1a1a;
  --login-muted: #5c5c5c;
  --accent: #0067c0;
  --accent-hover: #005a9e;
  --field-bg: rgba(255, 255, 255, 0.85);
  --field-border: rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] {
  --login-bg: rgba(44, 44, 44, 0.72);
  --login-border: rgba(255, 255, 255, 0.08);
  --login-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --login-text: #fff;
  --login-muted: rgba(255, 255, 255, 0.7);
  --accent: #60cdff;
  --accent-hover: #4cc2f7;
  --field-bg: rgba(0, 0, 0, 0.25);
  --field-border: rgba(255, 255, 255, 0.12);
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 150px;
  box-sizing: border-box;
  pointer-events: none;
}

.login-backdrop-blur {
  position: absolute;
  inset: 0;
  pointer-events: none;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  z-index: 0;
}

[data-theme="light"] .login-backdrop-blur {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .login-backdrop-blur {
  background: rgba(0, 0, 0, 0.2);
}

.login-overlay .login-card {
  position: relative;
  z-index: 5;
  pointer-events: auto;
}

.login-card {
  width: 100%;
  max-width: 400px;
  border-radius: 8px;
  padding: 28px 28px 24px;
  background: var(--login-bg);
  border: 1px solid var(--login-border);
  box-shadow: var(--login-shadow);
  backdrop-filter: blur(40px) saturate(1.2);
  -webkit-backdrop-filter: blur(40px) saturate(1.2);
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--login-text);
}

/* Как на imedai.ru/login: эмблема 🩺 + название + латинский девиз */
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 4px;
}

.login-logo-icon {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 10px;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.login-tagline {
  font-size: 13px;
  font-style: italic;
  color: var(--login-muted);
  text-align: center;
  margin: 0 0 14px;
  line-height: 1.4;
  max-width: 100%;
}

.login-sub {
  font-size: 13px;
  color: var(--login-muted);
  text-align: center;
  margin: 0 0 22px;
  line-height: 1.35;
}

.win-field {
  margin-bottom: 14px;
}

.win-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--login-muted);
}

.win-field input {
  width: 100%;
  box-sizing: border-box;
  height: 36px;
  padding: 0 12px;
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--login-text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.win-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.field-error {
  font-size: 12px;
  color: #c42b1c;
  margin-top: 4px;
}

[data-theme="dark"] .field-error {
  color: #ff99a4;
}

/* Как «Рассчитать» в SCORAD (Win11: .allergology-section-root--win11 .gcs-btn-calculate) */
.btn-primary {
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
  margin-top: 8px;
  padding: 8px 18px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.25;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease, border-color 0.15s ease;
}

[data-theme="dark"] .btn-primary {
  color: #000;
  border-color: rgba(0, 0, 0, 0.08);
}

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

.btn-primary:active {
  transform: scale(0.99);
}

.login-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  padding: 3px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .login-tabs {
  background: rgba(255, 255, 255, 0.06);
}

.login-tab {
  flex: 1;
  height: 32px;
  border: none;
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--login-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.login-tab[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.85);
  color: var(--login-text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .login-tab[aria-selected="true"] {
  background: rgba(60, 60, 60, 0.95);
  color: #fff;
}

.login-panel {
  display: none;
}

.login-panel.is-active {
  display: block;
}

.flash-stack {
  margin-bottom: 14px;
}

.flash {
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.flash-error {
  background: rgba(196, 43, 28, 0.1);
  color: #a4262c;
  border: 1px solid rgba(196, 43, 28, 0.2);
}

[data-theme="dark"] .flash-error {
  background: rgba(255, 153, 164, 0.12);
  color: #ffb3bc;
  border-color: rgba(255, 153, 164, 0.25);
}

.flash-success {
  background: rgba(16, 124, 16, 0.1);
  color: #107c10;
  border: 1px solid rgba(16, 124, 16, 0.2);
}

[data-theme="dark"] .flash-success {
  background: rgba(108, 203, 95, 0.12);
  color: #6ccb5f;
  border-color: rgba(108, 203, 95, 0.25);
}

.hint-small {
  font-size: 11px;
  color: var(--login-muted);
  margin-top: 14px;
  line-height: 1.4;
}

.login-forgot-hint {
  text-align: center;
}

.login-forgot-hint a {
  color: var(--accent);
  text-decoration: none;
}

.login-forgot-hint a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.win-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0 16px;
  font-size: 13px;
  color: var(--login-text);
  cursor: pointer;
  line-height: 1.35;
}

.win-check input {
  margin-top: 3px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.win-check a {
  color: var(--accent);
  text-decoration: none;
}

.win-check a:hover {
  text-decoration: underline;
}

.captcha-wrap {
  margin: 14px 0 8px;
}

#authAlert {
  margin-bottom: 12px;
}

.auth-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 48px;
  z-index: 1;
  padding: 8px 16px 10px;
  box-sizing: border-box;
  pointer-events: none;
  text-align: center;
}

.auth-footer-inner {
  margin: 0 auto;
  max-width: 720px;
  pointer-events: auto;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 11px;
  line-height: 1.45;
  color: #ffffff;
  text-shadow: none;
}

/* Мобильная вёрстка: прокрутка всей страницы на iOS + дисклеймер под карточкой */
@media (max-width: 560px) {
  html.page-lockscreen,
  body.page-lockscreen {
    position: relative !important;
    height: auto !important;
    max-height: none !important;
    min-height: 100vh !important;
    min-height: 100svh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: auto !important;
  }

  body.page-lockscreen .hero-stack {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100svh !important;
    height: -webkit-fill-available !important;
    z-index: 0 !important;
    pointer-events: none !important;
  }

  body.page-lockscreen .login-overlay {
    position: relative !important;
    z-index: 20 !important;
    width: 100% !important;
    min-height: 100vh !important;
    min-height: 100svh !important;
    min-height: -webkit-fill-available !important;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: auto;
    padding-top: max(10px, env(safe-area-inset-top, 0px));
    padding-right: max(10px, env(safe-area-inset-right, 0px));
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    padding-left: max(10px, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
  }

  .login-overlay .login-card {
    flex-shrink: 0;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    max-width: min(336px, calc(100vw - 20px));
    padding: 18px 14px 16px;
    box-sizing: border-box;
  }

  .login-logo-icon {
    font-size: 40px;
    margin-bottom: 8px;
  }

  .login-title {
    font-size: 19px;
  }

  .login-tagline {
    font-size: 12px;
    margin-bottom: 10px;
  }

  .login-sub {
    font-size: 12px;
    margin-bottom: 16px;
  }

  .login-tabs {
    margin-bottom: 14px;
  }

  .captcha-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .captcha-wrap .smart-captcha,
  .captcha-wrap [id="captcha-container"] {
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .auth-footer {
    position: static;
    margin-top: 18px;
    margin-bottom: 4px;
    padding: 10px max(6px, env(safe-area-inset-left)) 8px max(6px, env(safe-area-inset-right));
    flex-shrink: 0;
  }

  .auth-footer-inner {
    font-size: 10px;
    line-height: 1.5;
  }
}

/* Cookie / Метрика: модальное окно поверх входа (Win11, как login-card) */
.cookie-consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
  pointer-events: auto;
}

.cookie-consent-overlay[hidden] {
  display: none !important;
}

.cookie-consent-backdrop {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  background: rgba(0, 0, 0, 0.18);
  z-index: 0;
}

[data-theme="dark"] .cookie-consent-backdrop {
  background: rgba(0, 0, 0, 0.42);
}

.cookie-consent-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: 0;
  padding: 22px 22px 18px;
  border-radius: 8px;
  background: var(--login-bg);
  border: 1px solid var(--login-border);
  box-shadow: var(--login-shadow);
  backdrop-filter: blur(40px) saturate(1.2);
  -webkit-backdrop-filter: blur(40px) saturate(1.2);
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--login-text);
}

.cookie-consent-icon {
  font-size: 40px;
  line-height: 1;
  text-align: center;
  margin: 0 0 12px;
}

.cookie-consent-text {
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 18px;
  color: var(--login-text);
}

.cookie-consent-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.cookie-consent-link:hover {
  text-decoration: underline;
}

.cookie-consent-accept {
  margin-top: 0;
}

/* Глобальный пресет кнопок для экрана входа */
.login-overlay button,
.cookie-consent-card button {
  font-weight: 400 !important;
  padding: 16px 36px !important;
  border-radius: 5px !important;
  min-height: 52px !important;
  justify-content: center !important;
  text-align: center !important;
}

@media (prefers-reduced-motion: reduce) {
  .login-backdrop-blur {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }

  .cookie-consent-backdrop {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
}


.auth-footer-links {
  margin-top: 8px;
  pointer-events: auto;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 11px;
  line-height: 1.45;
  color: #ffffff;
  text-align: center;
}

.auth-footer-link,
.auth-footer-link:visited,
.auth-footer-link:active {
  color: #ffffff;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-footer-link:hover {
  color: #ffffff;
  opacity: 0.92;
}


.register-consents {
  margin: 8px 0 12px;
}

.register-consents .win-check {
  margin: 0 0 10px;
}

.register-consents .win-check:last-child {
  margin-bottom: 0;
}
