.tr-registration {
  --tr-bg: #f7f4ee;
  --tr-surface: #fffdfa;
  --tr-card: #ffffff;
  --tr-line: #e6ded1;
  --tr-line-strong: #d8cfbf;
  --tr-text: #173126;
  --tr-text-soft: #66756d;
  --tr-text-muted: #889289;
  --tr-green: #0e4b3f;
  --tr-green-strong: #0b3d33;
  --tr-danger: #b42318;
  --tr-danger-bg: #fff2f0;
  --tr-danger-line: #ffd2cc;
  --tr-success: #027a48;
  --tr-success-bg: #ecfdf3;
  --tr-shadow: 0 28px 80px rgba(17, 35, 29, 0.18);
  --tr-radius-xl: 26px;
  --tr-radius-lg: 18px;
  --tr-radius-md: 14px;
  --tr-radius-sm: 12px;

  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  font-family: "Manrope", Inter, Arial, sans-serif;
}

.tr-registration.is-open {
  display: block;
}

.tr-registration__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 24, 18, 0.42);
  backdrop-filter: blur(6px);
}

.tr-registration__dialog {
  position: absolute;
  inset: 16px;
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: auto;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #fffdfa 0%, #f7f4ee 100%);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--tr-radius-xl);
  overflow: hidden;
  box-shadow: var(--tr-shadow);
}

.tr-registration__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px 14px;
  border-bottom: 1px solid var(--tr-line);
  background: rgba(255, 253, 250, 0.96);
}

.tr-registration__header-copy {
  min-width: 0;
}

.tr-registration__eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tr-text-muted);
  font-weight: 800;
}

.tr-registration__title {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(22px, 2.8vw, 30px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--tr-green-strong);
}

.tr-registration__close {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border: 1px solid var(--tr-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--tr-green-strong);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.tr-registration__close:hover {
  transform: translateY(-1px);
  background: #fff;
  border-color: var(--tr-line-strong);
}

.tr-registration__body {
  overflow: auto;
  padding: 24px 28px 22px;
}

.tr-registration__body::-webkit-scrollbar {
  width: 10px;
}

.tr-registration__body::-webkit-scrollbar-thumb {
  background: rgba(14, 75, 63, 0.18);
  border-radius: 999px;
}

.tr-registration__loading {
  padding: 40px 0;
  text-align: center;
  color: var(--tr-text-soft);
  font-size: 15px;
}

.tr-registration__content {
  display: grid;
  gap: 16px;
}

.tr-registration__form {
  display: grid;
  gap: 16px;
}

.tr-registration__section,
.tr-registration__success {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius-lg);
  padding: 20px;
}

/* LIGHT SUMMARY */
.tr-registration__summary {
  display: grid;
  gap: 14px;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0 2px 4px;
}

.tr-registration__course {
  margin: 0 0 4px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(30px, 3.4vw, 40px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--tr-green-strong);
}

.tr-registration__summary-list {
  display: grid;
  gap: 0;
}

.tr-registration__summary-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px 16px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid rgba(230, 222, 209, 0.82);
}

.tr-registration__summary-row--term {
  grid-template-columns: 92px minmax(0, 1fr) auto;
}

.tr-registration__summary-row:last-of-type {
  border-bottom: 0;
}

.tr-registration__summary-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--tr-text-muted);
  font-weight: 800;
  padding-top: 4px;
}

.tr-registration__summary-content {
  min-width: 0;
  color: var(--tr-text);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 600;
}

.tr-registration__summary-content strong {
  display: block;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 800;
  color: var(--tr-green-strong);
}

.tr-registration__summary-content span {
  display: block;
  color: var(--tr-text-soft);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 500;
}

.tr-registration__summary-content--price strong {
  font-size: 16px;
}

.tr-registration__inline-action {
  align-self: start;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  color: var(--tr-text-soft);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.tr-registration__inline-action:hover {
  color: var(--tr-green);
}

.tr-registration__terms {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 2px 0 4px 108px;
}

.tr-registration__term-option {
  width: 100%;
  border: 1px solid var(--tr-line);
  background: #fff;
  padding: 14px 15px;
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.tr-registration__term-option:hover {
  transform: translateY(-1px);
  border-color: var(--tr-line-strong);
}

.tr-registration__term-option.is-active {
  border-color: rgba(14, 75, 63, 0.42);
  box-shadow: inset 0 0 0 1px rgba(14, 75, 63, 0.16);
  background: #fffefb;
}

.tr-registration__term-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.tr-registration__term-title {
  color: var(--tr-green-strong);
  font-size: 15px;
  font-weight: 800;
}

.tr-registration__term-price {
  color: var(--tr-green-strong);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.tr-registration__term-meta {
  margin-top: 6px;
  color: var(--tr-text-soft);
  font-size: 14px;
  line-height: 1.5;
}

.tr-registration__subtle-link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--tr-text-soft);
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.tr-registration__subtle-link:hover {
  color: var(--tr-green);
}

/* FORM AS MAIN PART */
.tr-registration__section-head {
  margin-bottom: 12px;
}

.tr-registration__section-head h4 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  color: var(--tr-green-strong);
  font-weight: 800;
}

.tr-registration__section-head p,
.tr-registration__helper,
.tr-registration__mode-helper {
  margin: 6px 0 0;
  color: var(--tr-text-soft);
  font-size: 13px;
  line-height: 1.55;
}

.tr-registration__mode-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tr-registration__mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--tr-line);
  border-radius: 999px;
  background: #fff;
  color: var(--tr-green-strong);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.tr-registration__mode-chip:hover {
  border-color: var(--tr-line-strong);
}

.tr-registration__mode-chip:has(input:checked) {
  border-color: rgba(14, 75, 63, 0.42);
  box-shadow: inset 0 0 0 1px rgba(14, 75, 63, 0.16);
  background: #fffefb;
}

.tr-registration__mode-chip input {
  margin: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--tr-green);
}

.tr-registration__mode-chip span {
  font-size: 14px;
  font-weight: 700;
}

.tr-registration__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.tr-registration__field {
  display: grid;
  gap: 7px;
}

.tr-registration__field--full {
  grid-column: 1 / -1;
}

.tr-registration__field label {
  font-size: 13px;
  font-weight: 800;
  color: var(--tr-green-strong);
}

.tr-registration__field input {
  min-height: 52px;
  border: 1px solid var(--tr-line);
  border-radius: 14px;
  padding: 0 14px;
  font-size: 15px;
  color: var(--tr-green-strong);
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.tr-registration__field input::placeholder {
  color: #9aa39c;
}

.tr-registration__field input:focus {
  outline: none;
  border-color: rgba(14, 75, 63, 0.42);
  box-shadow: 0 0 0 4px rgba(14, 75, 63, 0.08);
}

.tr-registration__field-error {
  min-height: 16px;
  color: var(--tr-danger);
  font-size: 12px;
  line-height: 1.4;
}

.tr-registration__toggle,
.tr-registration__checkbox {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  column-gap: 12px;
  color: var(--tr-green-strong);
  font-size: 14px;
  line-height: 1.55;
}

.tr-registration__toggle input,
.tr-registration__checkbox input {
  margin: 3px 0 0;
  width: 18px;
  height: 18px;
  accent-color: var(--tr-green);
}

.tr-registration__toggle span,
.tr-registration__checkbox span {
  display: block;
  min-width: 0;
}

.tr-registration__checkboxes {
  display: grid;
  gap: 14px;
}

.tr-registration__invoice {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(230, 222, 209, 0.8);
}

.tr-registration__success {
  text-align: center;
  padding: 36px 20px;
}

.tr-registration__success-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 14px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--tr-success-bg);
  color: var(--tr-success);
  font-size: 30px;
  font-weight: 800;
}

.tr-registration__success h3 {
  margin: 0 0 8px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 28px;
  color: var(--tr-green-strong);
}

.tr-registration__success p {
  margin: 0;
  color: var(--tr-text-soft);
  line-height: 1.65;
}

.tr-registration__footer {
  padding: 16px 28px 20px;
  border-top: 1px solid var(--tr-line);
  background: rgba(255, 253, 250, 0.97);
}

.tr-registration__footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.tr-registration__footer-helper {
  margin: 0;
  color: var(--tr-text-soft);
  font-size: 14px;
  line-height: 1.55;
  max-width: 460px;
}

.tr-registration__submit {
  flex: 0 0 auto;
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  padding: 0 24px;
  background: linear-gradient(135deg, var(--tr-green), var(--tr-green-strong));
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  box-shadow: 0 14px 28px rgba(14, 75, 63, 0.18);
}

.tr-registration__submit:hover {
  transform: translateY(-1px);
}

.tr-registration__submit[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.tr-registration__alert {
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
}

.tr-registration__alert--error {
  background: var(--tr-danger-bg);
  color: var(--tr-danger);
  border: 1px solid var(--tr-danger-line);
}

.is-hidden {
  display: none !important;
}

body.tr-registration-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .tr-registration__dialog {
    inset: auto 0 0 0;
    width: 100%;
    max-height: 96vh;
    border-radius: 24px 24px 0 0;
  }

  .tr-registration__header,
  .tr-registration__body,
  .tr-registration__footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .tr-registration__title {
    font-size: 34px;
  }

  .tr-registration__section,
  .tr-registration__success {
    padding: 16px;
  }

  .tr-registration__summary-row,
  .tr-registration__summary-row--term {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .tr-registration__terms {
    padding-left: 0;
  }

  .tr-registration__term-top,
  .tr-registration__footer-actions {
    display: grid;
    gap: 10px;
  }

  .tr-registration__summary-content strong {
    font-size: 15px;
  }

  .tr-registration__summary-content--price strong {
    font-size: 16px;
  }

  .tr-registration__grid {
    grid-template-columns: 1fr;
  }

  .tr-registration__footer-helper {
    max-width: none;
  }

  .tr-registration__submit {
    width: 100%;
  }
}