:root {
  --primary: #00D8F6;
  --btn-hover: #0C9AAE;
  --bg: #131516;
  --text: #FFFFFF;
  --text-secondary: #767A7E;
  --card: #101113;
  --border: #1D1F20;
  --field: #0C0C0C;
}

@font-face {
  font-family: "PT Root UI";
  src: url('/static/fonts/pt-root-ui_regular.otf') format('opentype'),
       url('/static/fonts/pt-root-ui_regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "PT Root UI";
  src: url('/static/fonts/pt-root-ui_medium.otf') format('opentype'),
       url('/static/fonts/pt-root-ui_medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "PT Root UI";
  src: url('/static/fonts/pt-root-ui_bold.otf') format('opentype'),
       url('/static/fonts/pt-root-ui_bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

body {
  margin: 40px 0;
  font-family: "PT Root UI", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.02em;
  background-color: var(--bg);
  color: var(--text);
  font-size: 16px;
  min-height: 100vh;
  background-repeat: repeat;
}

.container {
  max-width: 620px;
  margin: 0 auto;
  padding: clamp(0.5rem, 2vw, 1rem);
  box-sizing: border-box;
}

.header {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.5vw, 1rem);
  margin-bottom: clamp(0.5rem, 1.5vw, 1rem);
}
.header img.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--text-secondary);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}
.header-text {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.header-text h1 {
  margin: 0;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
}
.lang-flags {
  display: flex;
  align-items: center;
  height: 16px;
  min-height: 16px;
  line-height: normal;
  gap: 1rem;
}
.lang-flags .flag {
  width: 24px !important;
  height: 16px !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 24px !important;
  min-height: 16px !important;
  display: block;
  object-fit: cover;
  border-radius: 2px;
  cursor: pointer;
  vertical-align: top;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: content-box !important;
}
.lang-flags a {
  display: flex;
  align-items: center;
  height: 16px;
  min-height: 16px;
  line-height: normal;
  padding: 0;
  margin: 0;
  text-decoration: none;
}

.donation-box {
  background-color: var(--card);
  border-radius: 12px;
  padding: clamp(1rem, 2vw, 2rem);
  margin-bottom: clamp(1rem, 1vw, 1rem);
}

.intro-box {
  background-color: var(--card);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: clamp(1rem, 1vw, 1rem);
}

.intro-text-small {
  margin: 0;
  font-size: 15px;
  color: var(--text);
  line-height: 1.6;
  text-align: left;
}

.donate-options {
  display: grid;
  grid-template-columns: 1fr 1fr; /* две колонки одинаковой ширины */
  grid-template-rows: 1fr 1fr;    /* две строки одинаковой высоты (можно не указывать) */
  gap: 8px;                      /* расстояние между элементами */                  /* на всю ширину контейнера */
  background-color: var(--card);
  border-radius: 11px;
  padding: clamp(0.8rem, 2vw, 1rem);
  margin-bottom: clamp(1rem, 1vw, 1rem);
}

.option {
  display: flex;
  align-items: center;
  padding: 0.8rem;
  background: var(--bg);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px; /* Уменьшенный шрифт */
}

.option-name {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 0.5rem; /* если нужен небольшой отступ до цены */
}

.price {
  font-weight: medium;
  color: var(--primary);
  font-size: 14px;
  white-space: nowrap;
  margin-right: 0; /* или небольшой отступ, если нужно */
}

.info-icon {
  position: relative;
  flex-shrink: 0;
  margin-left: 0.5rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  /* Отключаем нативный тултип браузера */
  pointer-events: auto;
}

.info-icon svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: currentColor;
}

.info-icon:hover {
  color: var(--primary)!important;
}

.info-icon:hover svg {
  fill: var(--primary);
}

/* Кастомный тултип для info-icon */
.info-icon[data-tooltip] {
  position: relative;
}

.info-icon[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  background: var(--border);
  color: #fff;
  padding: clamp(0.4rem, 0.5vw, 0.6rem) clamp(0.6rem, 0.8vw, 0.8rem);
  border-radius: 3px;
  font-size: clamp(14px, 1vw, 16px); /* Уменьшенный шрифт подсказки */
  z-index: 1;
  white-space: nowrap;
  left: 50%;
  top: -50px;
  transform: translateX(-50%);
}

.intro-text {
  margin-top: clamp(0.5rem, 1vw, 1rem);
  line-height: 1.5;
  color: var(--text-secondary);
}

.form-group {
  margin: 0 0 24px 0;
}
.donation-form label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 500;
}

input, textarea, select {
  width: 100%;
  margin-top: 0px;
  padding: clamp(0.6rem, 1.5vw, 0.9rem) clamp(0.9rem, 2vw, 1.1rem);
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: var(--field);
  color: var(--text);
  font-size: 16px;
  box-sizing: border-box;
  text-align: left;
  line-height: 1.2;
  font-family: "PT Root UI", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

input:hover, textarea:hover, select:hover {
  border: 1px solid var(--text-secondary);
}

.amount-control:focus-within {
  border-color: var(--primary);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  outline: none;
}

input::placeholder, textarea::placeholder {
  font-size: 16px;
  font-weight: 400;
  color: #666;
  font-family: "PT Root UI", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
textarea {
  resize: none;
  min-height: 100px;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--text-secondary) transparent;
  max-height: 300px;
  overflow-y: hidden !important; /* Скрывает вертикальный скроллбар */
  resize: none;     
  padding-bottom: 32px;
}
input[type="number"] {
  -moz-appearance: textfield;
  appearance: none;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Оптимизация блока суммы и валюты */
.amount-control {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--field);
  transition: border-color 0.2s;
}

.amount-control input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: 16px;
  padding: 0.7rem 1rem;
  box-sizing: border-box;
  height: 100%;
}

.amount-control:hover {
  border: 1px solid var(--text-secondary);
}

#currencySymbol {
  position: absolute;
  left: clamp(0.8rem, 1.8vw, 1rem);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text);
  font-size: clamp(14px, 2.5vw, 16px);
  font-weight: 500;
  pointer-events: none;
  z-index: 1;
}

.amount-control select {
  flex: 0 0 auto;
  line-height: 1.2;
  width: 64px;
  border-left: 1.5px solid var(--border);
  border-radius: 0;
  background: var(--field);
  color: #fff;
  font-size: 16px;
  padding: 16px 0;
  box-sizing: border-box;
  height: 100%;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.amount-control select:focus {
  outline: none;
  border-left: 1.5px solid #666; /* ваш цвет, чтобы не было белого */
  border-color: var(--primary); /* или нужный цвет */
  box-shadow: none;
}

/* Общее фокусное состояние */
.amount-control:focus-within {
  border-color: var(--primary);
}

#currencySelect option {
  background-color: var(--bg);
  padding: 8px 4px;
}

/* Кастомный select — стилизация под input */
.custom-select-wrapper {
  position: relative;
  width: auto;
  min-width: 48px;
  height: 100%;
  flex: 0 0 96px;
}

.custom-select-display {
  background: var(--field);
  color: #fff;
  border: 1.5px solid transparent;         /* Всегда есть border */
  border-left: 1.5px solid var(--border);  /* Левая граница — обычный цвет */
  border-radius: 0 8px 8px 0;
  font-size: 16px;
  padding: clamp(0.6rem, 1.5vw, 0.9rem) clamp(0.9rem, 2vw, 1.1rem);
  min-width: 48px;
  min-height: 40px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  transition: border-color 0.2s;
  padding-right: 2.2rem; /* место под иконку */
}

.custom-select-wrapper.open .custom-select-display,
.custom-select-display:focus {
  border: 1.5px solid var(--primary);      /* Все стороны — основной цвет */
  border-radius: 0 8px 8px 0;
}

.custom-select-display::after {
  content: '';
  display: block;
  width: 4rem;
  height: 1rem;
  margin-left: 0.5rem;
}

.custom-select-chevron {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.2em;
  height: 1.2em;
  pointer-events: none;
  fill: var(--text-secondary);
  transition: transform 0.2s;
}

.custom-select-wrapper.open .custom-select-chevron {
  transform: translateY(-50%) rotate(180deg);
}

.custom-select-dropdown {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--field);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  z-index: 1000;
  margin-top: 2px;
}

.custom-select-dropdown.open {
  display: block;
}

.custom-select-dropdown .custom-select-option {
  color: #fff;
  background: var(--field);
  cursor: pointer;
  padding: clamp(0.6rem, 1.5vw, 0.9rem) clamp(0.9rem, 2vw, 1.1rem);
  font-size: 16px;
  transition: background 0.15s, color 0.15s;
}

.custom-select-dropdown .custom-select-option.selected,
.custom-select-dropdown .custom-select-option:hover {
  background: var(--border);
  color: var(--primary);
}

select.custom-select {
  opacity: 0;
  position: absolute;
  pointer-events: none;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
}


/* Стили для текстового поля и счётчика */
.textarea-container {
  position: relative;
}
.char-counter {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 12px;
  color: var(--text-secondary)!important;
  margin: 4px 8px;
}

.btn-primary {
  font-family: "PT Root UI", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  display: block;
  width: 100%;
  padding: clamp(0.7rem, 1.5vw, 1rem);
  font-weight: bold;
  background-color:var(--primary);
  border: none;
  border-radius: 8px;
  color: var(--bg);
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  text-align: center;
  margin-top: clamp(1.5rem, 1vw, 2rem);
  font-size: clamp(16px, 2.5vw, 17px);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}
.btn-primary:hover {
  background-color:var(--btn-hover);
}

.btn-check {
  max-width: 400px;
  width: auto;
  margin: 0 auto;
  display: block;
}

.hint {
  font-size: 14px;
  color: #F28C38;
  margin-top: 0.3rem;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  margin-top: clamp(1.5rem, 1vw, 2rem);
  font-size: 14px;
  color: var(--text-secondary);
  padding: 0 16px;
}

.payment-info h2 {
  font-size: clamp(18px, 3vw, 20px);
  color: #005BBB;
}
.payment-info p {
  font-size: 16px;
  color: #F28C38;
}

.payment-info .label {
  color: var(--text-secondary); /* Серый цвет для меток */
  font-weight: 400; /* Полужирный шрифт для читаемости */
  margin-right: 0.5rem; /* Отступ справа от метки */
  white-space: nowrap; /* Предотвращение переноса текста */
}

.payment-info .user-data {
  color: #F28C38; /* Рыжий цвет для данных пользователя */
  font-weight: 600; /* Более жирный шрифт для выделения */
  word-break: break-word; /* Разбиение длинных слов для адаптивности */
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 600px) {
  .payment-info .detail-item {
    flex-direction: column; /* Столбец для меток и данных на мобильных */
    align-items: flex-start; /* Выравнивание в начале */
  }
  .payment-info .label {
    margin-bottom: 0.2rem; /* Отступ снизу вместо справа на мобильных */
    margin-right: 0; /* Убираем правый отступ на мобильных */
  }
}

.payment-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: clamp(0.5rem, 1vw, 1rem);
  margin-top: clamp(0.5rem, 1.5vw, 1rem);
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
}
.payment-method {
  background-color: var(--bg);
  border: 2px solid var(--text-secondary);
  border-radius: 8px;
  padding: clamp(0.5rem, 1.5vw, 0.8rem) clamp(0.8rem, 2vw, 1.2rem);
  cursor: pointer;
  transition: border-color 0.3s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  text-align: center;
}
.payment-method.active {
  border-color: #F28C38;
  transform: scale(1.05);
}
.payment-method img {
  height: 24px;
}

.method-container {
  display: none;
  margin-top: clamp(1rem, 2vw, 1.5rem);
  max-width: 100%;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.method-container.active {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.hidden {
  display: none;
}

.info-hint {
  background: var(--card);
  color: #E0E0E0;
  padding: 0.8rem 1rem 1.2rem;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 1.5rem;
  line-height: 1.4;
  max-width: 100%;
  box-sizing: border-box;
  width: 100%;
}

.crypto-note {
  background: #222;
  padding: 1rem;
  border-radius: 10px;
  color: #ccc;
  font-size: 15px;
  margin-top: 1.5rem;
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 600px) {
  .container {
    padding: 0.3rem;
    max-width: none;
  }
  .intro-box {
    padding: clamp(0.6rem, 1.5vw, 0.8rem);
  }
  .donate-options {
      display: grid;
      grid-template-columns: 1fr;
      grid-template-rows: none;
      gap: 8px;
  }
  .intro-text-small {
    font-size: clamp(14px, 1.2vw, 12px);
  }
  .option {
    display: flex;
    align-items: center;
    padding: 0.8rem;
    background: var(--bg);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px; /* Уменьшенный шрифт */
  }
  .price, .info-icon {
    margin-top: clamp(0.2rem, 0.5vw, 0.3rem);
  }
  .info-icon:hover::after {
    margin-left: -25px;
    margin-top: -40px;
  }
  .info-hint .address {
    font-size: clamp(5px, 1vw, 7px);
    max-width: 100%;
  }
  .btn-copy {
    width: 100%;
    margin-top: 0.5rem;
  }
  .info-hint {
    padding: 0.6rem 0.8rem;
    font-size: 12px;
    width: 100%;
    background: linear-gradient(90deg, #444, #005BBB) !important;
  }
  .payment-info {
    width: 100%;
  }
}

/* Стили для блока адреса и кнопки копирования */
.crypto-address-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.info-hint .address {
  word-break: break-all;
  hyphens: auto;
  max-width: 100%;
  font-weight: bold;
  color: #003366;
  padding: 0.5rem;
  background-color: #E6F0FA;
  border-radius: 4px;
  margin: 0.5rem 0;
  font-size: clamp(6px, 1.2vw, 8px);
  line-height: 1.3;
  white-space: nowrap;
  width: 97%;
}

.btn-copy {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 14px;
  background-color: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: fit-content;
  align-self: flex-start;
}

.btn-copy:hover {
  background-color: var(--btn-hover);
}

.code-block {
  width: 100%;
  background: #222;
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Fira Mono', monospace;
  font-size: 1rem;
  box-sizing: border-box;
  margin-bottom: 1em;
}

.code-text {
  /* Текст слева, можно добавить стили */
}

.code-icon {
  cursor: pointer;
  display: flex;
  align-items: center;
  /* Можно добавить отступ слева, если нужно */
}

/* Стилизация скроллбара для textarea */
textarea::-webkit-scrollbar {
  width: 2px;
}
textarea::-webkit-scrollbar-thumb {
  background:var(--text-secondary);
  border-radius: 2px;
}
textarea::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 2px;
}

