:root {
  color-scheme: dark;
}

.payment-page .hero {
  display: none;
}

.payment-main {
  max-width: 1120px;
  margin: 32px auto 48px;
  padding: 0 24px;
}

.payment-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 40px;
  padding: 0 8px;
  flex-wrap: wrap;
}

.payment-header h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 650;
  letter-spacing: 0.4px;
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid rgba(208, 168, 92, 0.22);
  background: linear-gradient(135deg, rgba(23, 32, 40, 0.95), rgba(15, 22, 29, 0.95));
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.12s ease;
}

.language-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(208, 168, 92, 0.14);
  border-color: rgba(240, 208, 138, 0.45);
}

.language-toggle__flag {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 0 1px rgba(208, 168, 92, 0.32);
  flex-shrink: 0;
}

.language-toggle__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.language-toggle__option {
  color: var(--muted);
  opacity: 0.55;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.language-toggle__option.is-active {
  color: var(--accent2);
  opacity: 1;
}

.language-toggle__separator {
  color: var(--muted);
  opacity: 0.45;
}

.language-toggle[data-lang="ru"] .language-toggle__flag {
  background-image: url('/img/patches/flag-ru.svg');
}

.language-toggle[data-lang="en"] .language-toggle__flag {
  background-image: url('/img/patches/flag-en.svg');
}

.payment-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
}

.payment-card,
.payment-side-card {
  background: linear-gradient(180deg, rgba(31, 39, 48, 0.92), rgba(18, 24, 31, 0.9));
  border: 1px solid rgba(240, 208, 138, 0.26);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(6, 10, 14, 0.42);
}

.payment-card {
  padding: 36px 40px;
  display: grid;
  gap: 40px;
}

.payment-side-card {
  padding: 30px;
  display: grid;
  gap: 28px;
  align-content: start;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 19px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 16px;
}

.form-section {
  display: grid;
  gap: 20px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-header .section-title {
  margin: 0;
}

.purchase-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid rgba(240, 208, 138, 0.28);
  background: linear-gradient(135deg, rgba(35, 44, 54, 0.9), rgba(17, 23, 31, 0.9));
  box-shadow: 0 6px 18px rgba(9, 13, 18, 0.32);
}

.purchase-toggle__option {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.purchase-toggle__option.is-active {
  background: rgba(240, 208, 138, 0.16);
  color: var(--accent2);
  box-shadow: inset 0 0 0 1px rgba(240, 208, 138, 0.36);
}

.purchase-toggle__option:hover {
  color: var(--text);
}

.purchase-toggle__option:focus-visible {
  outline: 2px solid rgba(240, 208, 138, 0.55);
  outline-offset: 2px;
}

.mutagen-option {
  display: grid;
  gap: 12px;
}

.mutagen-hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

#subscription-options.is-hidden,
#subscription-options[hidden],
.mutagen-option.is-hidden,
.mutagen-option[hidden] {
  display: none !important;
}

.promo-field {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
}

.promo-field__input {
  flex: 1 1 auto;
  max-width: 100%;
  transition: flex-basis 0.2s ease, max-width 0.2s ease;
}

.promo-apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, rgba(240, 208, 138, 0.85), rgba(208, 168, 92, 0.85));
  color: #0f141b;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.promo-apply:hover:not(:disabled) {
  transform: translateY(-1px);
}

.promo-apply:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.promo-apply.is-busy {
  cursor: progress;
}



.promo-field--checking .promo-field__input .input-control {
  border-color: rgba(208, 168, 92, 0.35);
  box-shadow: none;
}

.promo-status {
  display: none;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  line-height: 1.3;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  margin-top: 10px;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.promo-field--active + .promo-status,
.promo-field--checking + .promo-status,
.promo-field--invalid + .promo-status,
.promo-field--valid + .promo-status {
  display: inline-flex;
}

.promo-field--checking + .promo-status {
  color: var(--muted);
}

.promo-field--valid + .promo-status {
  color: #4cd27a;
  border-color: rgba(76, 210, 122, 0.45);
  background: rgba(46, 138, 74, 0.18);
}

.promo-field--invalid + .promo-status {
  color: #d24c4c;
  border-color: rgba(210, 76, 76, 0.45);
  background: rgba(82, 26, 26, 0.22);
}

.promo-field--invalid .promo-field__input .input-control {
  border-color: rgba(210, 76, 76, 0.65);
  box-shadow: 0 0 0 1px rgba(210, 76, 76, 0.3);
}

.promo-field--valid .promo-field__input .input-control {
  border-color: rgba(76, 210, 122, 0.55);
}

.summary-row.discount span:last-child {
  color: #4cd27a;
  font-weight: 600;
}

.summary-row[hidden] {
  display: none !important;
}

.form-section + .form-section {
  margin-top: 8px;
}

.form-fields {
  display: grid;
  gap: 18px;
}

.player-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(208, 168, 92, 0.32);
  background: linear-gradient(135deg, rgba(35, 44, 54, 0.9), rgba(16, 22, 30, 0.9));
  box-shadow: 0 8px 20px rgba(6, 10, 14, 0.32);
  transition: border-color 0.15s ease;
}

.player-preview.is-hidden {
  display: none;
}

.player-preview__avatar {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  border: 1px solid rgba(240, 208, 138, 0.32);
  background: rgba(15, 21, 28, 0.65);
  overflow: hidden;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.player-preview__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.player-preview__details {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.player-preview__name-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.player-preview__name {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-preview__not-mine {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  border: 1px dashed rgba(208, 168, 92, 0.35);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: default;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.player-preview__not-mine:hover {
  color: var(--accent2);
  border-color: rgba(240, 208, 138, 0.55);
  background: rgba(240, 208, 138, 0.08);
}

.player-preview__not-mine::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  background: rgba(12, 18, 24, 0.95);
  border: 1px solid rgba(240, 208, 138, 0.45);
  color: var(--text);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 5;
}

.player-preview__not-mine:hover::after {
  opacity: 1;
  transform: translate(-50%, -4px);
}

.player-preview-message {
  min-height: 18px;
  font-size: 13px;
  color: var(--muted);
  margin-top: -4px;
}

.player-preview-message.is-error {
  color: #d24c4c;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.field-label {
  font-weight: 500;
  color: var(--text);
}

.input-control {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid rgba(208, 168, 92, 0.28);
  background: linear-gradient(180deg, rgba(15, 21, 28, 0.95), rgba(9, 13, 18, 0.95));
  color: var(--text);
  font-size: 15px;
  box-sizing: border-box;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.input-control:focus {
  outline: none;
  border-color: rgba(240, 208, 138, 0.55);
  box-shadow: 0 0 0 2px rgba(208, 168, 92, 0.18);
}

.plan-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid rgba(240, 208, 138, 0.28);
  background: linear-gradient(180deg, rgba(35, 44, 54, 0.94), rgba(17, 23, 31, 0.92));
  text-align: left;
  cursor: default;
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.12s ease;
  min-height: 148px;
  box-shadow: 0 3px 8px rgba(9, 13, 18, 0.3);
}

.plan-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(240, 208, 138, 0.18);
  border-color: rgba(240, 208, 138, 0.55);
}

.plan-card.is-active {
  border-color: rgba(240, 208, 138, 0.75);
  box-shadow: 0 6px 14px rgba(240, 208, 138, 0.22);
}

.plan-card:focus-visible {
  outline: 2px solid rgba(240, 208, 138, 0.6);
  outline-offset: 2px;
}

.plan-price {
  font-size: 24px;
  color: var(--accent2);
  font-weight: 700;
}

.plan-duration {
  font-size: 17px;
  color: var(--text);
}

.plan-meta {
  font-size: 13px;
  color: var(--muted);
}

.summary-panel {
  background: linear-gradient(180deg, rgba(43, 33, 22, 0.4), rgba(26, 18, 12, 0.42));
  border: 1px solid rgba(240, 208, 138, 0.28);
  border-radius: 14px;
  padding: 20px 22px;
  display: grid;
  gap: 12px;
  box-shadow: 0 10px 24px rgba(18, 12, 8, 0.28);
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 15px;
}

.summary-row span:first-child {
  color: var(--muted);
}

.summary-row span:last-child {
  color: var(--text);
  font-weight: 500;
}

.summary-row.total span:last-child {
  color: var(--accent2);
  font-size: 18px;
}

.notice {
  font-size: 14px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(92, 35, 35, 0.92), rgba(44, 16, 16, 0.92));
  border: 1px solid rgba(240, 128, 128, 0.36);
  border-radius: 16px;
  padding: 20px;
  line-height: 1.6;
  box-shadow: 0 12px 28px rgba(220, 96, 96, 0.24);
  margin: 32px 0;
}

.notice strong {
  color: var(--accent2);
}

.agreements {
  display: grid;
  gap: 16px;
  padding-bottom: 8px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}

.checkbox-row input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid rgba(208, 168, 92, 0.35);
  background: linear-gradient(180deg, rgba(19, 26, 33, 0.95), rgba(12, 17, 22, 0.95));
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  position: relative;
  flex-shrink: 0;
  cursor: default;
}

.checkbox-row input[type="checkbox"]::after {
  content: "";
  width: 6px;
  height: 10px;
  border: 2px solid transparent;
  border-left: 0;
  border-top: 0;
  transform: translate(-50%, -55%) rotate(45deg);
  position: absolute;
  top: 50%;
  left: 50%;
  opacity: 0;
}

.checkbox-row input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(208, 168, 92, 0.25);
}

.checkbox-row input[type="checkbox"]:checked {
  border-color: rgba(240, 208, 138, 0.75);
  background: linear-gradient(180deg, rgba(240, 208, 138, 0.9), rgba(208, 168, 92, 0.9));
}

.checkbox-row input[type="checkbox"]:checked::after {
  opacity: 1;
  border-color: rgba(24, 18, 12, 0.9);
}

.checkbox-row a {
  color: var(--accent2);
  text-decoration: none;
}

.checkbox-row a:hover {
  text-decoration: underline;
}

.pay-button {
  width: 100%;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  padding: 14px 16px;
  border-radius: 14px;
  margin-top: 20px;
}

.support-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(90, 176, 255, 0.32);
  background: linear-gradient(180deg, rgba(28, 62, 92, 0.5), rgba(16, 32, 46, 0.48));
  box-shadow: 0 12px 28px rgba(12, 26, 42, 0.28);
}

.support-card strong {
  color: var(--blue);
}

.info-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}

.info-list li {
  display: grid;
  gap: 6px;
}

.info-list p {
  margin: 0;
  color: var(--muted);
}

.info-list h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.benefits-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.benefits-list li::before {
  content: "•";
  color: var(--accent2);
  margin-right: 8px;
}

.input-control[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.input-control[type="number"]::-webkit-outer-spin-button,
.input-control[type="number"]::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

textarea.input-control {
  min-height: 120px;
  resize: none;
  overflow: hidden;
}

.payment-footer {
  padding: 0 24px 48px;
}

.payment-footer__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}

.payment-footer__inner span {
  line-height: 1.5;
}

@media (max-width: 1080px) {
  .payment-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .payment-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
  }

  .plan-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .payment-main {
    margin-top: 24px;
    padding: 0 16px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .purchase-toggle {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px;
  }

  .purchase-toggle__option {
    flex: 1 1 48%;
    text-align: center;
  }

  .payment-card {
    padding: 26px;
  }

  .promo-field {
    flex-direction: column;
    align-items: stretch;
  }

  .promo-field__input {
    flex: 1 1 100%;
    max-width: 100%;
    width: 100%;
  }

  .promo-apply {
    width: 100%;
    justify-content: center;
  }

  .promo-status {
    width: 100%;
    text-align: center;
  }

  .plan-options {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .payment-header h1 {
    font-size: 28px;
  }

  .payment-footer {
    padding: 0 16px 40px;
  }
}
