/* Approved registration v2. Scoped so classrooms and learning retain their layout. */
#school.school--registration {
  --reg-orange: #ef6416;
  --accent: var(--reg-orange);
  --accent-soft: #fcebdc;
  --accent-text: #a73c0b;
  --on-accent: #fff;
  padding: calc(var(--safe-t) + 18px) 18px calc(var(--safe-b) + 18px);
  background:
    radial-gradient(ellipse at 92% 18%, #f9dfbd55, transparent 45%),
    var(--bg-base);
}
[data-theme="dark"] #school.school--registration {
  --accent-soft: #432d1e;
  --accent-text: #ffb47d;
  background:
    radial-gradient(ellipse at 92% 18%, #603c2044, transparent 45%),
    var(--bg-base);
}
.reg-wrap {
  max-width: 460px;
}
.reg-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}
.reg-brand > div {
  flex: 1;
  min-width: 0;
}
.reg-brand .school-logo {
  width: 156px;
  max-width: 100%;
  height: 35px;
}
.reg-brand > span {
  font: 600 13px/1.4 var(--font-body);
  white-space: nowrap;
  color: var(--fg-muted);
}
.reg-brand .reg-back {
  width: 30px;
  min-width: 30px;
  height: 44px;
  padding: 4px;
  margin-left: -6px;
}
.reg-back .ico {
  width: 22px;
}
.reg-steps {
  margin: 18px 12px 10px;
  gap: 6px;
}
.reg-steps i {
  height: 6px;
}
.reg-hero {
  position: relative;
  min-height: 220px;
  padding: 20px 0 0;
  isolation: isolate;
}
.reg-hero-copy {
  position: relative;
  z-index: 2;
  pointer-events: none;
}
.reg-hero h2 {
  font: 900 31px/1.1 var(--font-head);
  letter-spacing: -0.015em;
  margin: 0 0 14px;
  width: 66%;
  color: var(--fg);
  text-wrap: balance;
}
.reg-hero em {
  font-style: normal;
  color: var(--reg-orange);
}
.reg-hero p {
  color: var(--fg-muted);
  font: 400 14px/1.5 var(--font-body);
  width: 60%;
  margin: 0;
}
.reg-illustration {
  position: absolute;
  width: 62%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  object-position: right bottom;
  right: -10px;
  bottom: 0;
  z-index: 1;
  pointer-events: none;
  user-select: none;
}
.reg-hero--welcome {
  min-height: 232px;
}
.reg-hero--welcome .reg-illustration {
  width: 87%;
  right: -18px;
  bottom: 0;
}
.reg-hero--welcome h2 {
  width: 69%;
}
.reg-hero--plan {
  min-height: 182px;
}
.reg-hero--plan h2 {
  width: 68%;
}
.reg-hero--plan .reg-illustration {
  width: 53%;
  max-height: 190px;
}
.reg-hero--team {
  min-height: 194px;
}
.reg-hero--team .reg-illustration {
  width: 57%;
  max-height: 198px;
  right: -6px;
}
.reg-content {
  position: relative;
  z-index: 3;
}
.school--registration .school-role {
  min-height: 84px;
  padding: 15px 14px;
  border-radius: 20px;
  margin-bottom: 12px;
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 3px 18px #5c2b0610;
}
.school--registration .school-role.is-selected {
  border-color: var(--reg-orange);
  background: linear-gradient(110deg, var(--accent-soft), var(--surface));
}
.school--registration .school-role b {
  font-size: 18px;
  font-weight: 900;
}
.school--registration .school-role small {
  font-size: 12px;
  line-height: 1.45;
}
.school--registration .school-role-icon {
  width: 48px;
  height: 48px;
  color: var(--accent-text);
  background: var(--surface-2);
}
.school--registration .school-role-icon .ico {
  width: 28px;
  height: 28px;
}
.school--registration .school-radio {
  width: 26px;
  height: 26px;
}
.reg-roles {
  margin: 0 0 22px;
}
.reg-footer {
  margin-top: 18px;
}
#school.school--registration .btn--primary {
  background: linear-gradient(125deg, #ff7b22, #f45a0c);
  border-color: #e95408;
  box-shadow: 0 3px 0 #d94d06;
  color: #fff;
  min-height: 52px;
  font: 900 18px/1.25 var(--font-head);
  letter-spacing: 0.005em;
}
#school.school--registration .btn--primary > span {
  margin-left: 8px;
  font-size: 26px;
  line-height: 1;
}
#school.school--registration .btn--ghost {
  box-shadow: none;
  border: 1px solid var(--border);
}
.reg-caption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 18px 0 4px;
  font-size: 12px;
}
.reg-caption .ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.reg-telegram {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  color: #fff;
  background: #2aa9df;
  border-radius: 50%;
  font-size: 15px;
}
.reg-card {
  display: block;
  min-width: 0;
  margin: 0 0 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 19px;
  background: var(--surface);
  box-shadow: 0 3px 18px #5c2b0609;
}
.reg-card legend {
  float: left;
  width: 100%;
  padding: 0;
  margin: 0 0 10px;
  font: 900 15px/1.35 var(--font-head);
  color: var(--fg);
}
.reg-card legend + * {
  clear: both;
}
.reg-field {
  font: 900 15px/1.4 var(--font-head);
}
.reg-field .field {
  display: block;
  width: 100%;
  min-height: 46px;
  margin-top: 9px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 13px;
  color: var(--fg);
  background: var(--bg-base);
  font: 500 16px/1.3 var(--font-body);
}
.reg-field .field[aria-invalid="true"] {
  border-color: var(--danger-text);
}
.reg-field-help {
  display: block;
  margin: 9px 0 0;
  font: 400 12px/1.5 var(--font-body);
  color: var(--fg-muted);
}
.reg-subject-card .reg-field-help {
  text-align: center;
  font-size: 11px;
}
.reg-segments {
  display: flex;
  gap: 6px;
  width: 100%;
}
.reg-segments label {
  flex: 1;
  position: relative;
  min-width: 0;
  cursor: pointer;
}
.reg-segments input,
.reg-subject input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.reg-segments label > span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 7px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--fg);
  font: 500 14px/1.25 var(--font-body);
  text-align: center;
}
.reg-segments label:has(input:checked) > span {
  background: var(--reg-orange);
  color: #fff;
  font-weight: 700;
}
.reg-segments label:has(input:focus-visible),
.reg-subject:has(input:focus-visible) {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
  border-radius: 12px;
}
.reg-grade .reg-segments label:last-child {
  flex: 1.7;
}
.reg-grade .reg-segments label:last-child > span {
  font-size: 12px;
}
.reg-skip-grade {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--fg-muted);
  font: 400 12px/1.4 var(--font-body);
  cursor: pointer;
  min-height: 24px;
}
.reg-skip-grade input {
  accent-color: var(--reg-orange);
}
.reg-subject-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.reg-subject {
  position: relative;
  cursor: pointer;
  min-width: 0;
}
.reg-subject-content {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 17px;
  align-items: center;
  gap: 5px;
  min-height: 48px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 8px 7px;
  color: var(--fg);
  font: 600 11px/1.35 var(--font-body);
}
.reg-subject-content > span {
  overflow-wrap: anywhere;
}
.reg-subject-content .ico {
  width: 20px;
  height: 20px;
  color: var(--accent-text);
}
.reg-subject-content i {
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 17px;
  height: 17px;
  font-style: normal;
  font-size: 11px;
  color: transparent;
}
.reg-subject:has(input:checked) .reg-subject-content {
  border-color: var(--reg-orange);
  background: var(--accent-soft);
}
.reg-subject:has(input:checked) i {
  background: var(--reg-orange);
  color: #fff;
  border-color: var(--reg-orange);
}
.reg-more-subjects {
  margin-top: 9px;
}
#school .reg-more-subjects > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  padding: 9px;
  color: var(--fg-muted);
  font: 400 13px/1.4 var(--font-body);
  cursor: pointer;
}
.reg-more-subjects > summary::-webkit-details-marker {
  display: none;
}
.reg-more-subjects[open] > summary {
  margin-bottom: 10px;
}
.reg-goal > p {
  margin: 0 0 10px;
  color: var(--fg-muted);
  font: 400 12px/1.4 var(--font-body);
}
.reg-goal .reg-unknown {
  flex: 2;
}
.reg-goal .reg-unknown > span {
  font-size: 12px;
}
.reg-invitation h3 {
  font: 900 21px/1.25 var(--font-head);
  margin: 14px 0 18px;
  overflow-wrap: anywhere;
}
.reg-teacher {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.reg-avatar {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--accent-text);
  font: 800 22px var(--font-head);
}
.reg-teacher b {
  font: 800 15px var(--font-head);
}
.reg-teacher p {
  margin-top: 5px;
  font: 400 13px var(--font-body);
  color: var(--fg-muted);
}
.reg-privacy {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  color: var(--fg-muted);
  font: 400 12px/1.5 var(--font-body);
}
.reg-privacy .ico {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
#school .reg-code-check {
  font-size: 14px;
  min-height: 42px;
  margin-bottom: 14px;
}
@media (max-width: 359px) {
  #school.school--registration {
    padding-inline: 14px;
  }
  .reg-brand .school-logo {
    width: 135px;
  }
  .reg-hero h2 {
    font-size: 27px;
  }
  .reg-hero p {
    font-size: 12px;
  }
  .reg-hero--welcome {
    min-height: 220px;
  }
  .reg-hero--plan {
    min-height: 176px;
  }
  .school--registration .school-role {
    padding: 12px 10px;
    gap: 10px;
    min-height: 80px;
  }
  .school--registration .school-role b {
    font-size: 16px;
  }
  .school--registration .school-role small {
    font-size: 11px;
  }
  .school--registration .school-role-icon {
    width: 40px;
    height: 40px;
  }
  .reg-card {
    padding: 12px;
  }
  .reg-subject-grid {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  .reg-illustration {
    animation: none !important;
  }
}
/* Keep the first Continue button in view on shorter Telegram webviews. */
@media (max-height: 740px) {
  .reg-hero--welcome {
    min-height: 185px;
    padding-top: 12px;
  }
  .reg-hero--welcome .reg-illustration {
    width: 78%;
    max-height: 182px;
    right: -12px;
  }
  .school--registration .reg-roles .school-role {
    min-height: 72px;
    padding-block: 10px;
    margin-bottom: 10px;
  }
  .reg-roles {
    margin-bottom: 14px;
  }
  .reg-content > .reg-footer {
    margin-top: 12px;
  }
  .reg-caption {
    margin-top: 14px;
  }
}
@media (max-height: 660px) and (max-width: 359px) {
  .reg-hero--welcome {
    min-height: 171px;
  }
  .reg-hero--welcome .reg-illustration {
    max-height: 170px;
  }
  .school--registration .reg-roles .school-role {
    min-height: 68px;
  }
}
.reg-subject:has([aria-invalid="true"]) .reg-subject-content,
.reg-segments label:has([aria-invalid="true"]) > span {
  border-color: var(--danger-text);
}
@media (max-height: 740px) {
  .reg-hero--welcome .reg-illustration {
    width: 74%;
  }
  .reg-hero--welcome p {
    font-size: 13px;
    width: 50%;
  }
}
