/* Партнёрская программа ruspronedvizhimost.ru — общие стили кабинета и админки */
:root {
  --bg: #0d1117;
  --panel: #151b23;
  --panel-2: #1b2430;
  --line: #263141;
  --text: #e8eef6;
  --muted: #93a3b8;
  --accent: #2f7cf6;
  --accent-2: #e0443e;
  --ok: #2fa96b;
  --warn: #d6a52b;
  --err: #de4a44;
}

* { box-sizing: border-box; }

body.rp {
  margin: 0;
  padding: 0 0 40px;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.rp-wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.rp-top {
  border-bottom: 1px solid var(--line);
  background: #0f151d;
  padding: 16px 0;
  margin-bottom: 28px;
}
.rp-top .rp-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.rp-brand { font-weight: 700; font-size: 17px; letter-spacing: .2px; }
.rp-brand span { color: var(--accent); }
.rp-top .rp-link { color: var(--muted); text-decoration: none; font-size: 14px; }
.rp-top .rp-link:hover { color: var(--text); }

h1.rp-h1 { font-size: 26px; line-height: 1.25; margin: 0 0 6px; }
p.rp-sub { color: var(--muted); margin: 0 0 24px; }

.rp-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 18px;
}
.rp-card h2 { font-size: 17px; margin: 0 0 14px; }
.rp-card h3 { font-size: 15px; margin: 18px 0 10px; color: var(--muted); font-weight: 600; }

.rp-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.rp-metric { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.rp-metric .k { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.rp-metric .v { font-size: 26px; font-weight: 700; line-height: 1.1; }
.rp-metric .s { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

label.rp-label { display: block; font-size: 13.5px; color: var(--muted); margin: 14px 0 6px; }
input.rp-in, select.rp-in, textarea.rp-in {
  width: 100%;
  padding: 11px 13px;
  background: #0f151d;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}
input.rp-in:focus, select.rp-in:focus, textarea.rp-in:focus { outline: none; border-color: var(--accent); }
textarea.rp-in { min-height: 80px; resize: vertical; }

.rp-btn {
  display: inline-block;
  padding: 11px 20px;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.rp-btn:hover { filter: brightness(1.08); }
.rp-btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.rp-btn.danger { background: var(--err); }
.rp-btn.ok { background: var(--ok); }
.rp-btn.sm { padding: 7px 12px; font-size: 13.5px; }
.rp-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }

.rp-alert { border-radius: 9px; padding: 12px 15px; margin: 0 0 18px; font-size: 14px; border: 1px solid; }
.rp-alert.err { background: rgba(222, 74, 68, .12); border-color: rgba(222, 74, 68, .5); color: #ffb6b2; }
.rp-alert.ok { background: rgba(47, 169, 107, .12); border-color: rgba(47, 169, 107, .5); color: #a8e6c4; }
.rp-alert.info { background: rgba(47, 124, 246, .12); border-color: rgba(47, 124, 246, .45); color: #b9d4ff; }

.rp-refbox {
  display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap;
  background: #0f151d; border: 1px dashed var(--line); border-radius: 10px; padding: 14px;
}
.rp-refbox input { flex: 1 1 320px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }

table.rp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.rp-table th, table.rp-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.rp-table th { color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
table.rp-table tr:hover td { background: rgba(255,255,255,.02); }
table.rp-table td.num, table.rp-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rp-scroll { overflow-x: auto; }

.rp-badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.rp-badge.active { background: rgba(47,169,107,.16); color: #7ee2ac; }
.rp-badge.pending { background: rgba(214,165,43,.16); color: #f0cd76; }
.rp-badge.blocked { background: rgba(222,74,68,.16); color: #ffa8a4; }

.rp-muted { color: var(--muted); }
.rp-empty { color: var(--muted); padding: 18px 0; }
.rp-form-row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) {
  .rp-form-row { grid-template-columns: 1fr; }
  h1.rp-h1 { font-size: 21px; }
}

/* мобильные таблицы: не рвать дату, компактнее ячейки */
table.rp-table td:first-child { white-space: nowrap; }
@media (max-width: 640px) {
  table.rp-table { font-size: 13px; }
  table.rp-table th, table.rp-table td { padding: 8px 6px; }
  .rp-refbox input { font-size: 12.5px; }
}

/* кнопка «Выйти» в шапке админки */
.rp-logout {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}
.rp-logout:hover { color: var(--text); }
body.rp input, body.rp select, body.rp textarea, body.rp button { font-family: inherit; }
.rp-who { color: var(--muted); font-weight: 500; font-size: 13px; margin-left: 4px; }

/* ---------- Страница регистрации партнёра: две колонки (форма + условия) ---------- */
.rp-split {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(280px, 3fr);
  gap: 26px;
  align-items: start;
}
.rp-main { min-width: 0; }
.rp-aside {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.rp-cond-h + .rp-cond-sec .rp-cond-title { margin-top: 12px; }
.rp-cond {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px 17px;
}
.rp-cond-h {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.rp-cond-sec .rp-cond-title { margin: 0 0 8px; }
.rp-cond-sec + .rp-cond-sec .rp-cond-title { margin-top: 14px; }
.rp-cond-title {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
}

ol.rp-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
ol.rp-steps li { display: flex; gap: 10px; align-items: flex-start; }
.rp-step-n {
  flex: 0 0 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(47, 124, 246, .18);
  color: #a6c8ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  margin-top: 1px;
}
ol.rp-steps b { display: block; font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.35; }
.rp-step-d { display: block; font-size: 12.3px; line-height: 1.45; color: var(--muted); margin-top: 2px; }

table.rp-reward { width: 100%; border-collapse: collapse; font-size: 13px; }
table.rp-reward td { padding: 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.rp-reward tr:last-child td { border-bottom: 0; padding-bottom: 0; }
table.rp-reward td:first-child { color: var(--muted); padding-right: 10px; }
table.rp-reward td:last-child { text-align: right; font-weight: 600; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rp-cond-note { margin: 9px 0 0; font-size: 12.4px; line-height: 1.45; color: var(--muted); }

ul.rp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 12.8px; line-height: 1.45; color: var(--muted); }
ul.rp-list li { position: relative; padding-left: 18px; }
ul.rp-list li::before { content: "\2713"; position: absolute; left: 0; top: 0; color: var(--ok); font-weight: 700; }

.rp-cond-fine { margin: 14px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--muted); opacity: .85; }

.rp-modal-x, .rp-modal-close { display: none; }
.rp-cond-link { display: none; }

@media (max-width: 980px) {
  .rp-split { grid-template-columns: 1fr; gap: 20px; }
  .rp-aside { position: static; top: auto; max-height: none; overflow: visible; }
}
@media (min-width: 769px) and (max-width: 980px) {
  .rp-cond {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 26px;
    align-items: start;
  }
  .rp-cond-h, .rp-cond-sec-wide, .rp-cond-fine { grid-column: 1 / -1; }
  .rp-cond-sec + .rp-cond-sec .rp-cond-title { margin-top: 0; }
  .rp-cond-sec-wide { margin-top: 14px; }
}
@media (max-width: 768px) {
  .rp-cond-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 2px 0 16px;
    padding: 10px 16px 10px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-2);
    color: var(--accent);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
  }
  .rp-cond-link:active { filter: brightness(0.94); }
  .rp-cond-link-i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(47, 124, 246, 0.16);
    font-size: 12px;
    font-weight: 700;
  }
  .rp-aside:not(.is-open) { display: none; }
  .rp-aside.is-open {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    max-height: none;
    overflow: visible;
    background: rgba(6, 10, 16, 0.74);
  }
  .rp-aside.is-open .rp-modal-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 560px;
    max-height: calc(100dvh - 32px);
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    overflow: hidden;
  }
  .rp-aside.is-open .rp-cond {
    display: block;
    padding: 46px 18px 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .rp-aside.is-open .rp-modal-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
  }
  .rp-aside.is-open .rp-modal-x:active { background: var(--panel-2); color: var(--text); }
  .rp-aside.is-open .rp-modal-close {
    display: block;
    flex: 0 0 auto;
    margin: 10px 18px 16px;
    padding: 13px 18px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
  }
  .rp-aside.is-open .rp-modal-close:active { filter: brightness(0.92); }
  body.rp-modal-open {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
  }
}
@media (max-width: 640px) {
  .rp-cond { grid-template-columns: 1fr; }
  .rp-cond-sec-wide { margin-top: 0; }
  .rp-cond-sec + .rp-cond-sec { margin-top: 14px; }
}
@media (max-width: 430px) {
  table.rp-reward { font-size: 12.4px; }
  table.rp-reward td:first-child { padding-right: 8px; }
  .rp-cond { padding: 14px 15px; }
}

