/* ——— Стартовая страница входа «Всем пять!» (ученик в центре внимания) ——— */
#screen-auth {
  --ink: #173B7B;
  --ink-soft: #3E557A;
  --blue: #1564D9;
  --blue-dark: #104FAE;
  --paper: #F3F7FD;
  --surface: #FFFFFF;
  --border-soft: #D5E0F0;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 0 0 28px;
  background:
    radial-gradient(circle at 10% 12%, rgba(255, 229, 0, 0.12) 0%, rgba(255, 229, 0, 0) 34%),
    radial-gradient(circle at 90% 16%, rgba(4, 176, 217, 0.10) 0%, rgba(4, 176, 217, 0) 36%),
    var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
}

#screen-auth .auth-stripe {
  height: 6px;
  width: 100%;
  flex: 0 0 6px;
  background: linear-gradient(
    to right,
    #F39800 0% 20%,
    #FFE500 20% 40%,
    #92BF22 40% 60%,
    #04B0D9 60% 80%,
    #E95098 80% 100%
  );
}

/* Мягкий геометрический фон с пятиугольниками логотипа */
#screen-auth .auth-bg-decor {
  position: absolute;
  inset: 6px 0 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
#screen-auth .auth-geo {
  position: absolute;
  display: block;
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
  opacity: 0.18;
}
#screen-auth .auth-geo--1 {
  width: 180px;
  height: 180px;
  left: -46px;
  bottom: 12%;
  background: linear-gradient(135deg, #F39800, #FFE500);
  transform: rotate(-14deg);
}
#screen-auth .auth-geo--2 {
  width: 140px;
  height: 140px;
  right: -34px;
  top: 90px;
  background: linear-gradient(135deg, #04B0D9, #92BF22);
  transform: rotate(18deg);
}
#screen-auth .auth-geo--3 {
  width: 96px;
  height: 96px;
  left: 46%;
  top: 24px;
  background: linear-gradient(135deg, #E95098, #F39800);
  opacity: 0.10;
  transform: rotate(28deg);
}

/* Верхняя компактная плашка */
#screen-auth .auth-topbar {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 14px 28px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#screen-auth .auth-topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #35558A;
  min-width: 0;
}
#screen-auth .auth-topbar-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#screen-auth .auth-pentagon-dot {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
  background: conic-gradient(#F39800 0 72deg, #FFE500 72deg 144deg, #92BF22 144deg 216deg, #04B0D9 216deg 288deg, #E95098 288deg 360deg);
}
#screen-auth .auth-role-pill {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid #CFDDF2;
  background: rgba(255, 255, 255, 0.88);
  color: #2B4C82;
  font-size: 0.83rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.12s ease;
}
#screen-auth .auth-role-pill:hover {
  background: #FFFFFF;
  border-color: #1564D9;
  color: #1564D9;
}
#screen-auth .auth-role-pill.is-teacher-active {
  background: #EAF2FF;
  border-color: #93C5FD;
  color: #1564D9;
}

/* Основная двухколоночная сцена первого экрана */
#screen-auth .auth-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1140px;
  margin: 8px auto 0;
  padding: 0 28px;
  display: grid;
  grid-template-columns: minmax(320px, 0.94fr) minmax(360px, 1.06fr);
  gap: 26px;
  align-items: stretch;
  flex: 1 0 auto;
}
#screen-auth .auth-stage.auth-main--solo {
  grid-template-columns: minmax(300px, 520px);
  justify-content: center;
}

/* Левая приветственная карточка с логотипом и маскотом (чистый #FFFFFF, чтобы PNG сливались бесшовно) */
#screen-auth .auth-brand-card {
  background: #FFFFFF;
  border-radius: 24px;
  border: 1px solid #D5E0F0;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.055);
  padding: 26px 28px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  overflow: hidden;
}
#screen-auth .auth-brand-head {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}
#screen-auth .auth-logo {
  width: 96px;
  height: auto;
  object-fit: contain;
  flex: 0 0 96px;
}
#screen-auth .auth-brand-copy {
  min-width: 0;
}
#screen-auth .auth-brand-card h1 {
  font-size: 2.45rem;
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin: 0 0 6px;
  font-weight: 900;
  color: #173B7B;
}
#screen-auth .auth-tagline {
  font-size: 0.98rem;
  line-height: 1.4;
  margin: 0;
  color: var(--ink-soft);
  font-weight: 600;
}

/* Живой индикатор статуса урока */
#screen-auth .auth-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  align-self: flex-start;
  max-width: 100%;
  padding: 8px 14px;
  border-radius: 14px;
  background: #F4F8FF;
  border: 1px solid #DCE8FA;
  color: #264A80;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.3;
}
#screen-auth .auth-live-pill.is-live {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #0F6E43;
}
#screen-auth .auth-live-pill.is-stream {
  background: #FFF1F2;
  border-color: #FECDD3;
  color: #BE123C;
}
#screen-auth .auth-live-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: #60A5FA;
}
#screen-auth .auth-live-pill.is-live .auth-live-dot {
  background: #16A34A;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.18);
}
#screen-auth .auth-live-pill.is-stream .auth-live-dot {
  background: #E11D48;
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.18);
}

/* Маскот на ступеньках */
#screen-auth .auth-mascot-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 180px;
  padding: 4px 0;
}
#screen-auth .auth-mascot {
  width: 100%;
  max-width: 315px;
  max-height: 275px;
  object-fit: contain;
  display: block;
}
@media (prefers-reduced-motion: no-preference) {
  #screen-auth .auth-mascot {
    animation: vsem5MascotFloat 4.6s ease-in-out infinite;
  }
}
@keyframes vsem5MascotFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Три дружелюбных шага внизу бренд-карточки */
#screen-auth .auth-steps-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#screen-auth .step-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
#screen-auth .step-chip--1 {
  background: #FFF7ED;
  color: #9A3412;
  border: 1px solid #FED7AA;
}
#screen-auth .step-chip--2 {
  background: #F0FDF4;
  color: #15803D;
  border: 1px solid #BBF7D0;
}
#screen-auth .step-chip--3 {
  background: #FDF2F8;
  color: #9D174D;
  border: 1px solid #FBCFE8;
}

/* Правая главная карточка действия (ученик / учитель) */
#screen-auth .auth-action-card {
  position: relative;
  background: #FFFFFF;
  border-radius: 24px;
  border: 1px solid #CEDCF0;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.07);
  padding: 28px 30px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

#screen-auth .auth-students,
#screen-auth .auth-login {
  display: flex;
  flex-direction: column;
  width: 100%;
}
#screen-auth .auth-students.hidden,
#screen-auth .auth-login.hidden {
  display: none;
}

#screen-auth .auth-card-head {
  margin-bottom: 16px;
}
#screen-auth .auth-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
#screen-auth .auth-role-badge--student {
  background: #E0F2FE;
  color: #0369A1;
}
#screen-auth .auth-role-badge--teacher {
  background: #EEF2FF;
  color: #3730A3;
}
#screen-auth .auth-card-head h2 {
  margin: 0 0 6px;
  font-size: 1.625rem;
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.16;
  color: #173B7B;
}
#screen-auth .auth-hint {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.45;
  color: #475569;
}

/* Плашка приглашения ?lesson=... и выбор активного урока */
#screen-auth .auth-lesson-box {
  margin-bottom: 16px;
  padding: 0;
  background: transparent;
  border: none;
}
#screen-auth .auth-invite-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  border-radius: 16px;
  background: #EFF6FF;
  border: 1.5px solid #93C5FD;
}
#screen-auth .auth-invite-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
#screen-auth .auth-invite-kicker {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0369A1;
}
#screen-auth .auth-invite-title {
  font-size: 0.94rem;
  font-weight: 800;
  color: #173B7B;
  line-height: 1.3;
}
#screen-auth .auth-multi-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 13px;
  border-radius: 12px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  font-size: 0.84rem;
  color: #475569;
}
#screen-auth .auth-lesson-select-wrap {
  margin-top: 8px;
}
#screen-auth #auth-lesson-select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1.5px solid #CBD8EE;
  background: #FFFFFF;
  color: #173B7B;
  font-size: 0.94rem;
  font-weight: 600;
  font-family: inherit;
}
#screen-auth .auth-link-btn {
  width: auto;
  margin: 0;
  padding: 4px 8px;
  border: none;
  background: transparent;
  color: #1564D9;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 8px;
}
#screen-auth .auth-link-btn:hover {
  background: rgba(21, 100, 217, 0.08);
  text-decoration: underline;
}

/* Быстрый вход последних учеников этого устройства (1 клик) */
#screen-auth .auth-recent-box {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 18px;
  background: #F7FAFF;
  border: 1px solid #DFEAFA;
}
#screen-auth .auth-section-caption {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #536E99;
  margin-bottom: 8px;
}
#screen-auth .auth-recent-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
#screen-auth .recent-student-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
#screen-auth .recent-student-btn {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 9px 12px;
  border-radius: 13px;
  border: 1.5px solid #D4E2F7;
  background: #FFFFFF;
  color: #173B7B;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
#screen-auth .recent-student-btn:hover {
  border-color: #1564D9;
  background: #F0F7FF;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}
#screen-auth .recent-student-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
#screen-auth .recent-student-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #173B7B;
  line-height: 1.25;
}
#screen-auth .recent-student-go {
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 800;
  color: #1564D9;
}
#screen-auth .recent-student-remove {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #526580;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#screen-auth .recent-student-remove:hover {
  background: #FEE2E2;
  color: #DC2626;
}

/* Поле живого поиска ученика */
#screen-auth .auth-field-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 800;
  color: #2B4B80;
  margin: 0 0 6px;
}
#screen-auth .auth-optional {
  font-weight: 500;
  color: #526580;
}
#screen-auth .auth-search-field {
  position: relative;
  display: flex;
  align-items: center;
}
#screen-auth .auth-search-icon {
  position: absolute;
  left: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4E6382;
  pointer-events: none;
}
#screen-auth #student-name-filter {
  width: 100%;
  height: 52px;
  min-height: 52px;
  box-sizing: border-box;
  padding: 0 42px 0 44px;
  border: 2px solid #CBD8EE;
  border-radius: 14px;
  background: #FBFDFF;
  color: #173B7B;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
#screen-auth #student-name-filter::placeholder {
  color: #5A6E8C;
  font-weight: 500;
}
#screen-auth #student-name-filter:focus {
  outline: none;
  background: #FFFFFF;
  border-color: #1564D9;
  box-shadow: 0 0 0 4px rgba(21, 100, 217, 0.13);
}
#screen-auth .auth-search-clear {
  position: absolute;
  right: 10px;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #E8F0FC;
  color: #3D5B8C;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#screen-auth .auth-search-clear:hover {
  background: #D5E4FA;
  color: #173B7B;
}
#screen-auth .auth-search-clear.hidden {
  display: none;
}

/* Список найденных учеников */
#screen-auth .student-filter-list {
  margin-top: 10px;
  max-height: 236px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}
#screen-auth .student-filter-list:empty {
  margin-top: 0;
}
#screen-auth .student-filter-list .person {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  padding: 10px 13px;
  border: 1.5px solid #E1EAF6;
  border-radius: 14px;
  background: #FFFFFF;
  color: #173B7B;
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  margin: 0;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.1s ease;
}
#screen-auth .student-filter-list .person:hover,
#screen-auth .student-filter-list .person.is-active {
  border-color: #1564D9;
  background: #EFF6FF;
}
#screen-auth .person-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}
#screen-auth .person-avatar--c0 { background: #FFF3D6; color: #B45309; }
#screen-auth .person-avatar--c1 { background: #E0F2FE; color: #0369A1; }
#screen-auth .person-avatar--c2 { background: #DCFCE7; color: #15803D; }
#screen-auth .person-avatar--c3 { background: #FCE7F3; color: #BE185D; }
#screen-auth .person-avatar--c4 { background: #FEF9C3; color: #854D0E; }
#screen-auth .person-avatar--emoji {
  background: #EFF6FF;
  border: 1.5px solid #BFDBFE;
  font-size: 1.22rem;
  line-height: 1;
  letter-spacing: 0;
}

#screen-auth .person-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
#screen-auth .person-name {
  overflow: hidden;
  text-overflow: ellipsis;
}
#screen-auth mark.person-hl {
  background: #FEF08A;
  color: inherit;
  padding: 0 2px;
  border-radius: 4px;
}
#screen-auth .person-class-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  background: #F1F5F9;
  color: #475569;
}
#screen-auth .person-lock {
  font-size: 0.82rem;
  opacity: 0.85;
}
#screen-auth .person-enter-arrow {
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 800;
  color: #1564D9;
  opacity: 0;
  transform: translateX(-3px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}
#screen-auth .student-filter-list .person:hover .person-enter-arrow,
#screen-auth .student-filter-list .person.is-active .person-enter-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Пустая выдача поиска с дружелюбной подсказкой */
#screen-auth .student-empty-card {
  padding: 14px 16px;
  border-radius: 14px;
  background: #FFFBEB;
  border: 1px dashed #FCD34D;
  color: #78350F;
  font-size: 0.88rem;
  line-height: 1.45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
#screen-auth .student-empty-card .auth-newbie-inline-btn {
  width: auto;
  margin: 0;
  padding: 8px 14px;
  border-radius: 11px;
  border: none;
  background: #15803D;
  color: #FFFFFF;
  font-size: 0.84rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
}
#screen-auth .student-empty-card .auth-newbie-inline-btn:hover {
  background: #166534;
}

#screen-auth .auth-students-status {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: #475569;
  min-height: 18px;
}
#screen-auth .auth-students-status:empty {
  display: none;
}

/* Блок ввода пароля ученика */
#screen-auth .student-pass-box {
  margin-top: 8px;
  padding: 18px;
  border: 1.5px solid #C7DBF7;
  border-radius: 18px;
  background: #F6FAFF;
}
#screen-auth .student-pass-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
#screen-auth .student-pass-name {
  font-size: 1.02rem;
  font-weight: 800;
  color: #173B7B;
}
#screen-auth .student-pass-sub {
  font-size: 0.82rem;
  color: #475569;
}
#screen-auth .student-pass-box input[type="password"],
#screen-auth .student-pass-box input[type="text"] {
  width: 100%;
  height: 48px;
  box-sizing: border-box;
  padding: 0 88px 0 14px;
  border: 1.5px solid #C5D4EB;
  border-radius: 12px;
  background: #FFFFFF;
  color: #173B7B;
  font-family: inherit;
  font-size: 16px;
}
#screen-auth .student-pass-box input[type="password"]:focus,
#screen-auth .student-pass-box input[type="text"]:focus {
  outline: none;
  border-color: #1564D9;
  box-shadow: 0 0 0 3px rgba(21, 100, 217, 0.14);
}
#screen-auth .student-pass-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
#screen-auth .auth-ghost-btn {
  width: 100%;
  height: 42px;
  margin: 0;
  border-radius: 12px;
  border: 1px solid #D3E0F2;
  background: #FFFFFF;
  color: #35558A;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
#screen-auth .auth-ghost-btn:hover {
  background: #EFF5FF;
  border-color: #B4C9E8;
}

/* Переключатель и встроенная мини-форма «Я впервые на уроке» */
#screen-auth .student-newbie-wrap {
  margin-top: 16px;
}
#screen-auth .student-newbie-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 0 2px;
  border-top: 1px solid #E8EFF9;
  background: transparent;
  font-size: 0.88rem;
  color: #3E557A;
}
#screen-auth .auth-newbie-btn {
  width: auto;
  margin: 0;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid #86EFAC;
  background: #F0FDF4;
  color: #15803D;
  font-size: 0.84rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
#screen-auth .auth-newbie-btn:hover {
  background: #DCFCE7;
  border-color: #22C55E;
}

#screen-auth .student-register-panel {
  padding: 18px;
  border-radius: 18px;
  background: #F7FBF8;
  border: 1.5px solid #BBF7D0;
}
#screen-auth .student-reg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
#screen-auth .student-reg-head h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
  color: #173B7B;
}
#screen-auth .student-reg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
#screen-auth .student-reg-class-row {
  margin-bottom: 12px;
}
#screen-auth .student-register-panel input[type="text"] {
  width: 100%;
  height: 46px;
  box-sizing: border-box;
  padding: 0 13px;
  border: 1.5px solid #C8D9EC;
  border-radius: 12px;
  background: #FFFFFF;
  color: #173B7B;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
}
#screen-auth .student-register-panel input[type="text"]:focus {
  outline: none;
  border-color: #16A34A;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

/* Предупреждение о полном тёзке (защита от случайных дублей) */
#screen-auth .reg-duplicate-box {
  margin: 10px 0;
  padding: 13px 14px;
  border-radius: 14px;
  background: #EFF6FF;
  border: 1.5px solid #93C5FD;
  color: #1E3A8A;
  font-size: 0.88rem;
  line-height: 1.45;
}
#screen-auth .reg-duplicate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
#screen-auth .reg-dup-login-btn {
  flex: 1 1 auto;
  width: auto;
  margin: 0;
  padding: 9px 14px;
  border-radius: 11px;
  border: none;
  background: #1564D9;
  color: #FFFFFF;
  font-size: 0.86rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
}
#screen-auth .reg-dup-login-btn:hover {
  background: #104FAE;
}
#screen-auth .reg-dup-force-btn {
  width: auto;
  margin: 0;
  padding: 9px 12px;
  border-radius: 11px;
  border: 1px solid #BFDBFE;
  background: #FFFFFF;
  color: #33558B;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
#screen-auth .reg-dup-force-btn:hover {
  background: #F8FAFC;
}

/* Кнопки отправки и сообщения об ошибках */
#screen-auth .auth-submit {
  width: 100%;
  height: 50px;
  min-height: 50px;
  margin-top: 10px;
  border: 0;
  border-radius: 14px;
  color: #FFFFFF;
  background: #1564D9;
  font-size: 1rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
  transition: transform 0.12s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}
#screen-auth .auth-submit:hover {
  background: #104FAE;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
}
#screen-auth .auth-submit:active {
  transform: translateY(0);
}
#screen-auth .auth-submit:disabled {
  opacity: 0.58;
  cursor: default;
  transform: none;
  box-shadow: none;
}
#screen-auth .auth-submit--green {
  background: #15803D;
}
#screen-auth .auth-submit--green:hover {
  background: #166534;
}

#screen-auth .auth-error-msg,
#screen-auth #login-msg {
  margin: 10px 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  color: #DC2626;
  min-height: 0;
}
#screen-auth .auth-error-msg:empty,
#screen-auth #login-msg:empty {
  display: none;
}

/* Скромная ссылка на вход учителя в подвале карточки ученика */
#screen-auth .auth-card-foot {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #EDF2FA;
  text-align: center;
}
#screen-auth .auth-teacher-foot-link {
  width: auto;
  margin: 0;
  padding: 4px 10px;
  border: none;
  background: transparent;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border-radius: 8px;
}
#screen-auth .auth-teacher-foot-link:hover {
  color: #1564D9;
  background: #F0F6FF;
}

/* Вторичная панель входа для преподавателя */
#screen-auth .auth-back-student-btn {
  align-self: flex-start;
  width: auto;
  margin: 0 0 14px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #D5E2F4;
  background: #F8FBFF;
  color: #274B82;
  font-size: 0.83rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
#screen-auth .auth-back-student-btn:hover {
  background: #EAF3FF;
  border-color: #93C5FD;
  color: #1564D9;
}
#screen-auth .auth-login label {
  display: block;
  font-size: 0.86rem;
  font-weight: 800;
  margin: 14px 0 6px;
  color: #173B7B;
}
#screen-auth .auth-login input {
  width: 100%;
  height: 48px;
  min-height: 48px;
  box-sizing: border-box;
  border: 1.5px solid #CBD8EE;
  border-radius: 13px;
  padding: 0 14px;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  color: #173B7B;
  background: #FBFDFF;
}
#screen-auth .auth-login input:focus {
  outline: none;
  background: #FFFFFF;
  border-color: #1564D9;
  box-shadow: 0 0 0 4px rgba(21, 100, 217, 0.13);
}
#screen-auth .auth-pass-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
#screen-auth .auth-pass-wrap input {
  padding-right: 88px;
}
#screen-auth .auth-pass-eye {
  position: absolute;
  right: 8px;
  width: auto;
  height: 32px;
  margin: 0;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid #D8E4F5;
  background: #F4F8FF;
  color: #36568A;
  font-size: 0.76rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
#screen-auth .auth-pass-eye:hover {
  background: #E6F0FF;
  color: #1564D9;
}

/* Скрываем встроенные в браузер (Edge / Chromium / WebKit) кнопки раскрытия и очистки пароля — оставляем только нашу кнопку */
#screen-auth input::-ms-reveal {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
#screen-auth input::-ms-clear {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
#screen-auth input::-webkit-reveal {
  display: none !important;
}
#screen-auth input::-webkit-contacts-auto-fill-button {
  visibility: hidden;
  display: none !important;
  pointer-events: none;
}

/* Нижний официальный блок «Организаторы движения» (на белой карточке + общие правила .organizers-map) */
#screen-auth .auth-organizers {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1140px;
  margin: 22px auto 0;
  padding: 0 28px;
}
#screen-auth .organizers-card {
  background: #FFFFFF;
  border-radius: 20px;
  border: 1px solid #D5E0F0;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.045);
  padding: 12px 20px;
}
#screen-auth .organizers-card.hidden {
  display: none;
}

.organizers-map {
  position: relative;
  display: block;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
}
.organizers-map > img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}
.organizers-map > img[hidden],
.organizers-map.hidden {
  display: none;
}
.organizers-hotspots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.organizers-hotspots a {
  position: absolute;
  top: 0;
  bottom: 0;
  display: block;
  pointer-events: auto;
  border-radius: 8px;
}
.organizers-hotspots a:focus-visible {
  outline: 3px solid #1564D9;
  outline-offset: -3px;
}
.final-parents .organizers-map {
  max-width: 100%;
  margin: 0;
}

/* ——— Адаптация под планшеты и телефоны: поиск ученика сразу на первом экране! ——— */
@media (max-width: 880px) {
  #screen-auth .auth-topbar {
    padding: 10px 16px 4px;
  }
  #screen-auth .auth-stage {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 0 16px;
    margin-top: 6px;
  }
  #screen-auth .auth-stage.auth-main--solo {
    grid-template-columns: 1fr;
  }
  /* Превращаем бренд-панель в компактную дружелюбную шапку с мини-маскотом */
  #screen-auth .auth-brand-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 12px;
    row-gap: 8px;
    padding: 14px 16px;
    border-radius: 22px;
  }
  #screen-auth .auth-brand-head {
    grid-column: 1;
    grid-row: 1;
    gap: 12px;
  }
  #screen-auth .auth-logo {
    width: 60px;
    flex-basis: 60px;
  }
  #screen-auth .auth-brand-card h1 {
    font-size: 1.65rem;
    margin-bottom: 2px;
  }
  #screen-auth .auth-card-head h2 {
    font-size: 1.375rem;
  }
  #screen-auth .auth-tagline {
    font-size: 0.84rem;
  }
  #screen-auth .auth-live-pill {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 0.8rem;
    padding: 6px 11px;
  }
  #screen-auth .auth-mascot-wrap {
    grid-column: 2;
    grid-row: 1;
    min-height: 0;
    padding: 0;
  }
  #screen-auth .auth-mascot {
    width: 78px;
    max-height: 78px;
  }
  #screen-auth .auth-steps-pills {
    display: none;
  }
  #screen-auth .auth-action-card {
    padding: 20px 18px 18px;
    border-radius: 22px;
  }
  #screen-auth .auth-organizers {
    padding: 0 16px;
    margin-top: 16px;
  }
  #screen-auth .organizers-card {
    padding: 10px 12px;
    border-radius: 18px;
  }
}

@media (max-width: 520px) {
  #screen-auth .auth-topbar-title {
    font-size: 0.78rem;
  }
  #screen-auth .auth-role-pill {
    padding: 6px 11px;
    font-size: 0.78rem;
  }
  #screen-auth .student-reg-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  #screen-auth .student-newbie-bar {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  #screen-auth .auth-newbie-btn {
    width: 100%;
  }
}

/* ——— Карточки выбора активного урока (Урок + Преподаватель) и быстрые кнопки классов ——— */
#screen-auth .auth-session-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 2px;
}
#screen-auth .auth-session-cards.hidden {
  display: none;
}
#screen-auth .auth-session-card {
  width: 100%;
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1.5px solid #D4E2F7;
  background: #FFFFFF;
  color: #173B7B;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
#screen-auth .auth-session-card:hover {
  border-color: #1564D9;
  background: #F4F9FF;
}
#screen-auth .auth-session-card.is-class-match {
  border-color: #34D399;
  background: #F0FDF4;
}
#screen-auth .auth-session-card.is-selected {
  border-color: #1564D9;
  background: #EFF6FF;
  box-shadow: 0 0 0 3px rgba(21, 100, 217, 0.12);
}
#screen-auth .session-card-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
#screen-auth .session-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
#screen-auth .session-card-cls {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: #E0F2FE;
  color: #0369A1;
}
#screen-auth .session-card-match {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: #DCFCE7;
  color: #15803D;
}
#screen-auth .session-card-live {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: #FEE2E2;
  color: #B91C1C;
}
#screen-auth .session-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #173B7B;
  line-height: 1.25;
}
#screen-auth .session-card-teacher {
  font-size: 0.82rem;
  font-weight: 600;
  color: #4B658E;
}
#screen-auth .session-card-check {
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 800;
  color: #1564D9;
  white-space: nowrap;
}

#screen-auth .auth-class-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
#screen-auth .auth-class-chip {
  width: auto;
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px solid #CBD8EE;
  background: #F8FAFC;
  color: #2B4B80;
  font-size: 0.82rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.14s ease;
}
#screen-auth .auth-class-chip:hover {
  border-color: #1564D9;
  background: #EFF6FF;
  color: #1564D9;
}
#screen-auth .auth-class-chip.is-active {
  border-color: #16A34A;
  background: #DCFCE7;
  color: #15803D;
}

/* ——— Профиль символики «Санкт-Петербургская математическая олимпиада начальной школы» (matolimp) ——— */
body[data-brand="matolimp"] #screen-auth {
  --ink: #0F172A;
  --ink-soft: #475569;
  --paper: #F5F6F8;
  background:
    radial-gradient(circle at 10% 14%, rgba(245, 158, 11, 0.11) 0%, rgba(245, 158, 11, 0) 36%),
    radial-gradient(circle at 90% 18%, rgba(0, 133, 66, 0.09) 0%, rgba(0, 133, 66, 0) 38%),
    var(--paper);
}
body[data-brand="matolimp"] #screen-auth .auth-stripe {
  background: linear-gradient(to right, #0F172A 0% 24%, #008542 24% 68%, #F59E0B 68% 100%);
}
body[data-brand="matolimp"] #screen-auth .auth-pentagon-dot {
  clip-path: none;
  border-radius: 50%;
  background: radial-gradient(circle, #F59E0B 0% 38%, #008542 42% 100%);
}
body[data-brand="matolimp"] #screen-auth .auth-topbar-brand {
  color: #1E293B;
}
body[data-brand="matolimp"] #screen-auth .auth-geo {
  clip-path: none;
  border-radius: 50%;
}
body[data-brand="matolimp"] #screen-auth .auth-geo--1 {
  background: linear-gradient(135deg, #F59E0B, #FDE68A);
  opacity: 0.16;
}
body[data-brand="matolimp"] #screen-auth .auth-geo--2 {
  background: linear-gradient(135deg, #008542, #34D399);
  opacity: 0.13;
}
body[data-brand="matolimp"] #screen-auth .auth-geo--3 {
  background: linear-gradient(135deg, #0F172A, #F59E0B);
  opacity: 0.07;
}
body[data-brand="matolimp"] #screen-auth .auth-logo {
  width: 72px;
  flex: 0 0 72px;
}
body[data-brand="matolimp"] #screen-auth .auth-brand-card h1 {
  font-size: 2.05rem;
  color: #0F172A;
}
body[data-brand="matolimp"] #screen-auth .auth-mascot {
  animation: none;
  max-width: 350px;
  max-height: 255px;
}
body[data-brand="matolimp"] .organizers-map {
  max-width: 1020px;
}
@media (max-width: 880px) {
  body[data-brand="matolimp"] #screen-auth .auth-logo {
    width: 52px;
    flex-basis: 52px;
  }
  body[data-brand="matolimp"] #screen-auth .auth-brand-card h1 {
    font-size: 1.45rem;
  }
  body[data-brand="matolimp"] #screen-auth .auth-mascot {
    width: 92px;
    max-height: 68px;
  }
}
