:root {
  --ink: #1d1b24;
  --muted: #6c6872;
  --paper: #f6f5f2;
  --surface: #ffffff;
  --line: #dedce2;
  --violet: #583d78;
  --violet-dark: #3f295b;
  --violet-soft: #eee9f4;
  --success: #1d7350;
  --success-soft: #e4f4ec;
  --danger: #9c3b44;
  --shadow: 0 22px 64px rgba(40, 29, 52, 0.13);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 82% 4%, rgba(88, 61, 120, 0.12), transparent 30rem),
    var(--paper);
}

button,
select,
input,
textarea {
  font: inherit;
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

.b2b-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 0 max(24px, calc((100vw - 1320px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(246, 245, 242, 0.95);
  backdrop-filter: blur(16px);
}

.b2b-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--ink);
  text-decoration: none;
}

.b2b-brand img {
  width: 118px;
  height: 42px;
  object-fit: contain;
}

.b2b-brand span {
  padding-left: 16px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.b2b-header nav {
  display: flex;
  gap: 26px;
}

.b2b-header nav a {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

main {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
}

.b2b-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 0.72fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
  min-height: 650px;
  padding: 72px 0;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--violet);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 790px;
  margin-bottom: 24px;
  font-size: clamp(44px, 6vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.lead {
  max-width: 700px;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.55;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-facts span {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  font-size: 13px;
  font-weight: 700;
}

.access-card {
  min-height: 420px;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid rgba(88, 61, 120, 0.18);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.access-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.access-heading h2 {
  margin-bottom: 0;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.status-dot {
  width: 13px;
  height: 13px;
  margin-top: 6px;
  border-radius: 50%;
  background: #c9c5ce;
  box-shadow: 0 0 0 7px #f0eef2;
}

.status-dot.ready {
  background: var(--success);
  box-shadow: 0 0 0 7px var(--success-soft);
}

.status-dot.attention {
  background: var(--violet);
  box-shadow: 0 0 0 7px var(--violet-soft);
}

.access-state {
  padding-top: 28px;
}

.state-title {
  margin-bottom: 8px;
  font-size: 20px;
  font-weight: 850;
}

.muted {
  color: var(--muted);
  line-height: 1.55;
}

.provider-actions,
.account-actions {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.provider-action,
.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  font-weight: 800;
  text-decoration: none;
}

.provider-action,
.primary-action {
  color: #ffffff;
  background: var(--violet);
}

.provider-action:hover,
.primary-action:hover {
  background: var(--violet-dark);
}

.provider-action.bitrix {
  color: var(--ink);
  background: #d8ed75;
}

.secondary-action {
  margin-top: 18px;
  color: var(--violet);
  background: var(--violet-soft);
}

.text-action {
  min-height: 42px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 750;
}

.access-request-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.access-request-form > label,
.access-request-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.access-request-grid {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 12px;
}

.access-request-form input:not([type="checkbox"]),
.access-request-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
}

.access-request-form textarea {
  min-height: 82px;
  resize: vertical;
  line-height: 1.45;
}

.access-request-form input:focus,
.access-request-form textarea:focus {
  border-color: var(--violet);
  outline: 3px solid var(--violet-soft);
}

.access-consent {
  grid-template-columns: 20px 1fr !important;
  align-items: start;
  gap: 10px !important;
  color: var(--ink) !important;
  font-weight: 600 !important;
  line-height: 1.45;
}

.access-consent input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--violet);
}

.access-request-form .primary-action {
  width: 100%;
  cursor: pointer;
}

.access-request-form .primary-action:disabled {
  cursor: wait;
  opacity: 0.64;
}

.access-request-status {
  display: grid;
  gap: 5px;
  margin-top: 22px;
  padding: 16px;
  border-radius: 14px;
  color: var(--success);
  background: var(--success-soft);
}

.access-request-status span {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.unlinked-actions {
  display: grid;
  gap: 4px;
}

.honeypot {
  position: absolute !important;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.account-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-ok {
  color: var(--success);
  font-weight: 850;
}

.role-badge {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--violet);
  background: var(--violet-soft);
  font-size: 12px;
  font-weight: 850;
}

.scope-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}

.scope-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.scope-grid select {
  width: 100%;
  min-height: 44px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
}

.scope-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.scope-summary div {
  display: grid;
  gap: 2px;
  padding: 14px;
  border-radius: 14px;
  background: #f7f5f9;
}

.scope-summary strong {
  font-size: 24px;
}

.scope-summary span {
  color: var(--muted);
  font-size: 12px;
}

.permission-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.permission-list span {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--success);
  background: var(--success-soft);
  font-size: 12px;
  font-weight: 800;
}

.drafts-panel {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.drafts-heading,
.draft-row-header,
.draft-row-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drafts-heading .eyebrow {
  margin-bottom: 5px;
}

.drafts-heading h3 {
  margin-bottom: 0;
  font-size: 18px;
}

.drafts-heading > span {
  min-width: 30px;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--violet);
  background: var(--violet-soft);
  text-align: center;
  font-size: 12px;
  font-weight: 850;
}

.draft-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.draft-row {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #faf9fb;
}

.draft-row-header strong {
  font-size: 14px;
}

.draft-row-header time,
.draft-row small,
.draft-empty {
  color: var(--muted);
  font-size: 12px;
}

.draft-row-summary span:last-child {
  color: var(--violet-dark);
  font-weight: 850;
}

.draft-row small,
.draft-empty {
  line-height: 1.45;
}

.draft-empty {
  margin: 0;
  padding: 14px;
  border-radius: 12px;
  background: #f7f5f9;
}

.draft-empty.error {
  color: var(--danger);
}

.access-error {
  margin: 22px 0 0;
  color: var(--danger);
  font-size: 14px;
  line-height: 1.45;
}

.workflow {
  padding: 84px 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 34px;
}

.section-heading h2,
.trust-note h2 {
  margin-bottom: 0;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.workflow-grid article {
  min-height: 260px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.64);
}

.workflow-grid article > span {
  display: block;
  margin-bottom: 42px;
  color: var(--violet);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.workflow-grid h3 {
  margin-bottom: 12px;
  font-size: 22px;
}

.workflow-grid p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.trust-note {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 64px;
  align-items: end;
  margin-bottom: 90px;
  padding: clamp(28px, 5vw, 54px);
  border-radius: 28px;
  color: #ffffff;
  background: var(--violet-dark);
}

.trust-note .eyebrow {
  color: #d8ed75;
}

.trust-note > p {
  margin-bottom: 0;
  color: #ded5e8;
  line-height: 1.65;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding: 34px max(24px, calc((100vw - 1320px) / 2));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

footer div {
  display: grid;
  gap: 5px;
}

footer strong {
  color: var(--ink);
  font-size: 18px;
}

footer p {
  margin: 0;
}

@media (max-width: 900px) {
  .b2b-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 54px;
  }

  .access-card {
    width: 100%;
  }

  .workflow-grid {
    grid-template-columns: 1fr;
  }

  .workflow-grid article {
    min-height: auto;
  }

  .workflow-grid article > span {
    margin-bottom: 24px;
  }

  .trust-note {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 620px) {
  .b2b-header {
    min-height: 64px;
    padding: 0 14px;
  }

  .b2b-brand {
    gap: 10px;
  }

  .b2b-brand img {
    width: 92px;
    height: 34px;
  }

  .b2b-brand span {
    padding-left: 10px;
    font-size: 11px;
  }

  .b2b-header nav {
    display: none;
  }

  main {
    width: min(100% - 28px, 1320px);
  }

  .b2b-hero {
    gap: 32px;
    padding: 38px 0 58px;
  }

  h1 {
    font-size: 43px;
  }

  .access-card {
    min-height: 390px;
    padding: 22px;
    border-radius: 22px;
  }

  .scope-grid,
  .scope-summary,
  .access-request-grid {
    grid-template-columns: 1fr;
  }

  .workflow {
    padding: 58px 0;
  }

  .trust-note {
    margin-bottom: 58px;
    padding: 26px;
    border-radius: 22px;
  }

  footer {
    display: grid;
    padding: 28px 14px;
  }
}
