/* ================= Наши доработки поверх статичного макета Polymarket ================= */

/* Переключатель темы (в строке шапки, рядом с поиском, без обводки) */
.pm-theme-toggle {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.8;
  cursor: pointer;
  margin-left: 6px;
  transition: opacity 0.15s, background-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.pm-theme-toggle:hover { opacity: 1; background: rgba(128, 128, 128, 0.14); }
.pm-theme-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.pm-theme-toggle svg { width: 20px; height: 20px; display: block; }

@media (max-width: 1024px) {
  .pm-theme-toggle { width: 34px; height: 34px; }
  .pm-theme-toggle svg { width: 18px; height: 18px; }
}

/* ===================== Форма регистрации (Registration) ===================== */
.pmf-wrap { flex: 0 0 360px; max-width: 360px; align-self: flex-start; }
@media (max-width: 1023px) { .pmf-wrap { flex: 1 1 auto; max-width: 100%; width: 100%; margin-top: 8px; } }

.pmf-card {
  /* светлая тема (по умолчанию) */
  --pmf-bg: #ffffff; --pmf-border: #e9ebf0; --pmf-text: #0c0e13; --pmf-muted: #5b6472;
  --pmf-field-bg: #ffffff; --pmf-field-border: #d7dbe3; --pmf-field-ph: #9aa2ad;
  --pmf-brand: #2d6cff; --pmf-brand-hover: #2560ea; --pmf-brand-text: #ffffff;
  --pmf-danger: #e5484d; --pmf-list-bg: #ffffff;
  background: var(--pmf-bg); color: var(--pmf-text);
  border: 1px solid var(--pmf-border); border-radius: 16px; padding: 24px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}
[data-theme=dark] .pmf-card {
  --pmf-bg: #12151c; --pmf-border: #232833; --pmf-text: #eef2f8; --pmf-muted: #98a2b3;
  --pmf-field-bg: #0e1219; --pmf-field-border: #2a303c; --pmf-field-ph: #6b7480;
  --pmf-brand: #2d6cff; --pmf-brand-hover: #3b78ff; --pmf-brand-text: #ffffff;
  --pmf-danger: #ff6b6f; --pmf-list-bg: #12151c;
  box-shadow: none;
}

.pmf-title { margin: 0 0 6px; font-size: 24px; font-weight: 800; letter-spacing: -0.01em; color: var(--pmf-text); }
.pmf-sub { margin: 0 0 20px; font-size: 14px; color: var(--pmf-muted); }
.pmf-form { display: flex; flex-direction: column; gap: 16px; }
.pmf-field { display: block; }
.pmf-field > span { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 600; color: var(--pmf-text); }
.pmf-field input {
  width: 100%; box-sizing: border-box; height: 46px; padding: 0 14px;
  background: var(--pmf-field-bg); border: 1px solid var(--pmf-field-border); border-radius: 10px;
  color: var(--pmf-text); font-size: 15px; font-family: inherit; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pmf-field input::placeholder { color: var(--pmf-field-ph); }
.pmf-field input:focus { border-color: var(--pmf-brand); box-shadow: 0 0 0 3px rgba(45, 108, 255, 0.15); }
.pmf-field.has-err input { border-color: var(--pmf-danger); }
.pmf-err { display: block; margin-top: 6px; min-height: 0; color: var(--pmf-danger); font-size: 12px; }
.pmf-err:empty { margin-top: 0; }

/* телефон: код страны + номер */
/* .pmf-phone — тоже span внутри .pmf-field, поэтому специфичность выше правила подписи */
.pmf-field > span.pmf-phone { display: flex; flex-direction: row; gap: 8px; align-items: stretch; margin-bottom: 0; }
.pmf-cc { position: relative; flex: 0 0 auto; }
.pmf-cc-btn {
  height: 46px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px;
  background: var(--pmf-field-bg); border: 1px solid var(--pmf-field-border); border-radius: 10px;
  color: var(--pmf-text); font-size: 15px; font-family: inherit; cursor: pointer;
}
.pmf-cc-btn b { font-weight: 600; }
.pmf-cc-btn i { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: 0.6; }
.pmf-phone input { flex: 1 1 auto; width: auto; min-width: 0; }
.pmf-cc-list {
  position: absolute; z-index: 50; top: calc(100% + 6px); left: 0; width: 260px; max-height: 280px; overflow-y: auto;
  margin: 0; padding: 6px; list-style: none;
  background: var(--pmf-list-bg); border: 1px solid var(--pmf-field-border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.18);
}
.pmf-cc-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--pmf-text); }
.pmf-cc-opt small { color: var(--pmf-muted); }
.pmf-cc-opt:hover { background: rgba(45, 108, 255, 0.1); }
.pmf-cc-opt.is-active { background: rgba(45, 108, 255, 0.14); }

.pmf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.pmf-submit {
  margin-top: 4px; height: 50px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--pmf-brand); color: var(--pmf-brand-text); font-size: 16px; font-weight: 700; font-family: inherit;
  transition: background-color 0.15s, opacity 0.15s;
}
.pmf-submit:hover:not(:disabled) { background: var(--pmf-brand-hover); }
.pmf-submit:disabled { opacity: 0.55; cursor: not-allowed; }
.pmf-err-submit { text-align: center; }

.pmf-signin { margin: 14px 0 0; text-align: center; font-size: 14px; color: var(--pmf-muted); }
.pmf-signin a { color: var(--pmf-brand); font-weight: 700; text-decoration: none; }
.pmf-terms { margin: 12px 0 0; text-align: center; font-size: 12px; line-height: 1.5; color: var(--pmf-muted); }
.pmf-terms a { color: var(--pmf-muted); text-decoration: underline; }

.pmf-ok { text-align: center; padding: 12px 4px 6px; }
.pmf-ok-check { width: 56px; height: 56px; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(34, 197, 137, 0.15); color: #22c589; font-size: 28px; font-weight: 800; }
.pmf-ok h3 { margin: 0 0 8px; font-size: 20px; font-weight: 800; color: var(--pmf-text); }
.pmf-ok p { margin: 0; font-size: 14px; color: var(--pmf-muted); }

/* ===================== График в featured-карточке ===================== */
.pm-chart { position: absolute; right: 16px; top: 66px; bottom: 52px; width: 56%; z-index: 2; pointer-events: none; }
.pm-chart svg { width: 100%; height: 100%; overflow: visible; }
.pmc-grid { stroke: var(--pmc-grid, #e6e9ef); stroke-width: 1; stroke-dasharray: 2 4; }
.pmc-lbl, .pmc-xlbl { fill: var(--pmc-lbl, #8a93a3); font-size: 11px; font-family: inherit; }
.pmc-xlbl { text-anchor: middle; }
[data-theme=dark] .pm-chart { --pmc-grid: #232833; --pmc-lbl: #8a93a3; }
@media (max-width: 1023px) { .pm-chart { display: none; } }

/* ===================== Контролы карусели (наши) ===================== */
.pm-car-nav { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.pm-car-dots { display: flex; align-items: center; gap: 7px; }
.pm-car-dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: currentColor; opacity: 0.28; cursor: pointer; transition: opacity 0.15s, width 0.15s; }
.pm-car-dot.is-active { opacity: 0.9; width: 22px; border-radius: 6px; }
.pm-car-pills { display: flex; align-items: center; gap: 10px; }
.pm-car-pill { display: inline-flex; align-items: center; gap: 6px; max-width: 230px; padding: 8px 14px; border-radius: 999px; border: 1px solid currentColor; background: transparent; color: inherit; opacity: 0.72; font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer; transition: opacity 0.15s, background-color 0.15s; }
.pm-car-pill:hover { opacity: 1; background: rgba(128, 128, 128, 0.14); }
.pm-car-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.pm-car-ar { font-size: 17px; line-height: 1; }
@media (max-width: 600px) {
  .pm-car-nav { justify-content: center; }
  .pm-car-pills { gap: 8px; }
  .pm-car-pill { max-width: 42vw; padding: 7px 12px; font-size: 12px; }
  .pm-car-nm { max-width: 30vw; }
}
