/* =========================================================
   ANTS HEALTH — страница авторизации
   Единый стиль с платформой
   ========================================================= */

:root {
  --primary: #1f6b52;
  --primary-dark: #14543f;
  --primary-light: #2e8a6b;
  --primary-soft: #b8e0d0;
  --accent: #d4a657;
  --bg-page: #f1f4f2;
  --bg-card: #ffffff;
  --bg-card-alt: #f7faf8;
  --bg-header: #e9ede9;
  --border: #d4dcd7;
  --border-strong: #b9c5be;
  --text: #1e2a25;
  --text-muted: #6a7870;
  --text-soft: #8c9a92;
  --danger: #c84e4e;
  --success: #2e8a6b;
  --warning: #d4a657;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(20, 84, 63, 0.06);
  --shadow: 0 4px 14px rgba(20, 84, 63, 0.08);
  --shadow-lg: 0 10px 30px rgba(20, 84, 63, 0.12);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Playfair Display', 'Times New Roman', Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===================== LAYOUT ===================== */
.layout {
  display: grid;
  grid-template-columns: 208px 1fr;
  min-height: 100vh;
}

/* ===================== SIDEBAR ===================== */
/* === FULL-HEIGHT SIDEBAR FIX === */
.sidebar {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: relative;
  align-self: stretch;
  min-height: 100vh;
  height: auto;
}
.sidebar-top { text-align: center; padding: 0 20px 28px; }
.logo { width: 90px; height: 100px; margin: 0 auto 10px; }
.logo svg { width: 100%; height: 100%; }
.brand-name {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  margin: 4px 0 2px;
  color: #fff;
}
.brand-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  margin: 0;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 20px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  color: rgba(255,255,255,0.9);
  font-size: 14px;
  transition: all 0.15s;
}
.nav-item:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
  text-decoration: none;
  transform: translateX(2px);
}
.nav-icon {
  width: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.85);
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.sidebar-footer-label {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}
.sidebar-footer-link {
  color: #fff;
  font-size: 13px;
  text-decoration: none;
}
.sidebar-footer-link:hover { color: var(--primary-soft); text-decoration: none; }

/* ===================== MAIN ===================== */
.main { display: flex; flex-direction: column; min-height: 100vh; }

.header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.page-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  padding: 8px 18px;
  border-radius: 8px;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.4px;
  box-shadow: var(--shadow-sm);
}
.header-extra {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
}
.header-muted { color: var(--text-muted); }
.header-link {
  color: var(--primary);
  font-weight: 600;
}

.content {
  flex: 1;
  padding: 36px 40px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

/* ===================== AUTH LAYOUT ===================== */
.auth-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  gap: 22px;
  align-items: start;
  width: 100%;
}

/* Карточка логина */
.auth-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 34px 40px 36px;
  box-shadow: var(--shadow);
}
.auth-heading { margin-bottom: 24px; }
.auth-heading h2 {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0 0 6px;
}
.auth-heading p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-muted);
}

/* Форма */
.form { display: flex; flex-direction: column; gap: 18px; }
.form-row { display: flex; flex-direction: column; gap: 7px; }
.form-row label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.req { color: var(--danger); margin-left: 2px; }
.label-link {
  font-size: 12.5px;
  color: var(--primary);
  font-weight: 500;
}

/* Input с иконкой */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap .input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-soft);
  display: inline-flex;
  pointer-events: none;
}
.input-wrap input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: all 0.15s;
}
.input-wrap input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31,107,82,0.12);
}
.input-wrap input:focus + .pw-toggle,
.input-wrap:focus-within .input-icon { color: var(--primary); }

.pw-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-soft);
  padding: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.15s;
}
.pw-toggle:hover { color: var(--primary); background: var(--bg-card-alt); }

/* Чекбокс */
.form-inline { display: flex; align-items: center; gap: 12px; }
.checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.checkbox input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* Кнопки */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  line-height: 1.2;
  font-family: inherit;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.btn-full { width: 100%; }

/* Разделитель */
.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-soft);
  font-size: 12px;
  margin: 2px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* SSO-кнопки */
.sso-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-sso {
  background: #fff;
  color: var(--text);
  border: 1.5px solid var(--border-strong);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s;
  line-height: 1.2;
}
.btn-sso:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--bg-card-alt);
}
.sso-ic { font-size: 15px; }

/* ===================== SIDE COLUMN ===================== */
.side-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 20px;
}

.panel-info {
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.panel-info::before {
  content: '';
  position: absolute;
  top: -50px; right: -50px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(255,255,255,0.12), transparent);
  border-radius: 50%;
}
.panel-info h3 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}
.panel-info h3 .dot {
  width: 9px; height: 9px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 4px rgba(212,166,87,0.25);
}
.panel-info p { margin: 0 0 14px; font-size: 13.5px; line-height: 1.55; opacity: 0.95; position: relative; }
.panel-info ul { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.7; opacity: 0.92; position: relative; }
.panel-info ul li { margin-bottom: 5px; }
.panel-info strong { color: #fff; opacity: 1; font-weight: 600; }

.institution-box {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.institution-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, rgba(212,166,87,0.18), rgba(212,166,87,0.08));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.institution-body { flex: 1; min-width: 0; }
.institution-label {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
  font-weight: 600;
}
.institution-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--primary-dark);
  margin-bottom: 6px;
  font-family: var(--font-serif);
  line-height: 1.3;
}
.institution-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.panel-stats {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}
.panel-stats h4 {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}
.stat-row:last-child { border-bottom: none; }
.stat-label { color: var(--text-muted); }
.stat-value { font-weight: 700; color: var(--primary-dark); font-family: var(--font-serif); font-size: 15px; }

/* ===================== FOOTER ===================== */
.footer {
  padding: 18px 40px;
  border-top: 1px solid var(--border);
  background: var(--bg-header);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--text-muted);
}
.footer-links a { color: var(--text-muted); margin: 0 2px; }
.footer-links a:hover { color: var(--primary); }
.footer-links span { margin: 0 4px; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1050px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .side-col { position: static; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .content, .header, .footer { padding: 20px; }
  .auth-card { padding: 24px 22px; }
  .sso-row { grid-template-columns: 1fr; }
  .header { flex-direction: column; align-items: flex-start; }
}

/* --- Страница входа без сайдбара: одна колонка на всю ширину --- */
.layout--auth {
  grid-template-columns: 1fr !important;
}

/* ===================== STEPPER (восстановление/смена пароля) ===================== */
.steps { display: flex; align-items: center; gap: 0; margin-bottom: 26px; }
.step { display: flex; align-items: center; gap: 9px; flex: 1; }
.step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-card-alt); border: 1.5px solid var(--border-strong);
  color: var(--text-soft); font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.step-label { font-size: 12.5px; color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.step-line { flex: 1; height: 2px; background: var(--border); margin: 0 6px; min-width: 18px; }
.step.done .step-num { background: var(--primary); border-color: var(--primary); color: #fff; }
.step.done .step-label { color: var(--text); }
.step.active .step-num { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 0 0 4px rgba(31,107,82,0.15); }
.step.active .step-label { color: var(--primary-dark); font-weight: 600; }

/* ===================== ПОДСКАЗКА ПОЛЯ ===================== */
.field-hint { font-size: 12px; color: var(--text-muted); margin-top: -2px; }

/* ===================== КНОПКА-ПРИЗРАК ===================== */
.btn-ghost {
  background: #fff; color: var(--text); border: 1.5px solid var(--border-strong);
  padding: 11px 18px; border-radius: 8px; font-size: 14px; font-weight: 500;
  font-family: inherit; cursor: pointer; transition: all 0.15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; line-height: 1.2;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); background: var(--bg-card-alt); }

/* ===================== РЕЗУЛЬТАТ (письмо отправлено / пароль обновлён) ===================== */
.result-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 44px 40px; box-shadow: var(--shadow); text-align: center; max-width: 520px; margin: 0 auto;
}
.result-icon { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 22px; display: flex; align-items: center; justify-content: center; }
.result-icon.icon-mail { background: linear-gradient(135deg, rgba(31,107,82,0.14), rgba(31,107,82,0.06)); color: var(--primary); }
.result-icon.icon-check { background: linear-gradient(135deg, rgba(46,138,107,0.16), rgba(46,138,107,0.06)); color: var(--success); }
.result-card h2 { font-family: var(--font-serif); font-size: 25px; color: var(--primary-dark); margin: 0 0 10px; font-weight: 700; }
.result-card p { font-size: 14px; color: var(--text-muted); margin: 0 0 8px; line-height: 1.6; }
.result-card .email-hl { color: var(--text); font-weight: 600; }
.result-actions { margin-top: 26px; display: flex; flex-direction: column; gap: 12px; }
.result-note { margin-top: 22px; padding-top: 20px; border-top: 1px dashed var(--border); font-size: 12.5px; color: var(--text-soft); }
.result-note a { font-weight: 600; }
.result-inner { text-align: center; }
.result-inner .result-icon { margin: 4px auto 14px; }
.result-inner h2 { font-family: var(--font-serif); font-size: 24px; font-weight: 700; color: var(--primary-dark); margin: 0 0 8px; }
.result-inner p { font-size: 14px; color: var(--text-muted); margin: 0 0 8px; line-height: 1.6; }
.result-inner .result-actions { margin-top: 20px; }
.result-inner .result-note { margin-top: 16px; }
