html:has(.olympiad-signup[open]) {
  overflow: hidden;
}

.olympiad-signup {
  box-sizing: border-box;
  width: 600px;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  max-height: calc(100dvh - 32px);
  overscroll-behavior: contain;
  color: #251d49;
  background: #fff;
  font: 400 15px/1.5 Manrope, Arial, sans-serif;
  border: 1px solid #e5dff4;
  border-radius: 20px;
  padding: 0;
  box-shadow: 0 16px 48px rgb(30 19 57 / 20%);
}

.olympiad-signup::backdrop {
  background: rgb(22 17 38 / 66%);
}

.olympiad-signup__content {
  position: relative;
  padding: clamp(18px, 4vw, 34px);
}

.olympiad-signup__close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #332266;
  font: 400 30px/1 Arial, sans-serif;
  cursor: pointer;
}

.olympiad-signup__close:hover {
  background: #f6f3fe;
}

.olympiad-signup h2 {
  margin: 0 32px 4px 0;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 750;
  line-height: 1.2;
}

.olympiad-signup p {
  margin: 8px 0 0;
}

.olympiad-fields {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
  margin: 20px 0 18px;
}

.olympiad-fields label {
  min-width: 0;
  font-weight: 700;
}

.olympiad-fields label:first-child {
  grid-column: 1 / -1;
}

.olympiad-fields input {
  box-sizing: border-box;
  display: block;
  width: 100%;
  margin-top: 4px;
  border: 1px solid #c9bfdd;
  border-radius: 10px;
  background: white;
  color: inherit;
  padding: 9px 11px;
  font: inherit;
  font-weight: 400;
  font-size: 16px;
}

.olympiad-field-error {
  display: block;
  color: #a3233d;
  font-size: 13px;
}

.olympiad-consents {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
  font-size: 13px;
}

.olympiad-consents > div {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.olympiad-consents input {
  accent-color: #5636a1;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
}

.t-records .olympiad-consents a {
  color: #513398;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.olympiad-signup :is(a, button, input):focus-visible {
  outline: 2px solid #6b45c5;
  outline-offset: 3px;
}

.olympiad-action {
  border: 1px solid #332266;
  border-radius: 10px;
  background: #332266;
  color: white;
  font: inherit;
  font-weight: 750;
  min-height: 44px;
  padding: 9px 16px;
  cursor: pointer;
}

.olympiad-action--secondary {
  background: white;
  color: #332266;
}

.olympiad-action:disabled {
  opacity: .54;
  cursor: default;
}

.olympiad-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.olympiad-signup [hidden],
#olympiad-status:empty,
.olympiad-field-error:empty {
  display: none;
}

@media (max-width: 490px) {
  .olympiad-signup { max-width: calc(100% - 24px); }
  .olympiad-fields { grid-template-columns: 1fr; }
}
