/* Public pages on top of brut.css: Study, the sample library, sign-in, guide and legal. */

.p-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  padding-block: clamp(36px, 6vw, 72px) clamp(28px, 4vw, 44px);
}

.p-head .b-lead {
  max-width: 52ch;
}

.p-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding-top: 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-3);
}

.p-crumbs a {
  text-decoration: none;
}

.p-crumbs a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.p-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  margin-block: var(--section);
}

.p-cta p {
  margin: 10px 0 0;
  max-width: 48ch;
}

.p-small {
  font-size: 14px;
  color: var(--text-3);
}

/* ---------- /study ---------- */

.s-hero .b-h1 {
  max-width: 16ch;
  text-wrap: balance;
}

/* The hero reuses the landing's paper mocks: both sheets carry body text here. */
.s-hero .l-page--title {
  align-items: stretch;
  text-align: left;
}

.s-hero .l-page p:not(.l-page__head, .l-toc) {
  text-align: justify;
  hyphens: auto;
}

.s-inside {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 16px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.s-inside li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.s-inside strong {
  display: block;
  font-size: 18px;
}

.s-inside span:not(.b-tick) {
  display: block;
  margin-top: 4px;
  color: var(--text-2);
  font-size: 15.5px;
}

.s-inside .b-tick {
  margin-top: 2px;
}

/* ---------- /primery ---------- */

.p-search {
  position: relative;
  width: min(100%, 560px);
}

.p-search svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.p-search .b-input {
  padding-left: 48px;
}

.p-typenav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.p-typenav b {
  margin-left: 8px;
  font-weight: 600;
  color: var(--text-3);
}

.p-group {
  padding-block: 18px 40px;
  scroll-margin-top: 24px;
}

.p-group__title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 24px;
  font-size: clamp(24px, 2.8vw, 34px);
}

/* ---------- /primery/{slug} ---------- */

.p-sample {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
  gap: 48px;
  padding-block: 24px var(--section);
}

.p-sample__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

.p-sample__kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 0;
  font-weight: 700;
}

.p-sample__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(26px, 2.8vw, 38px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.p-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.p-sheets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: start;
  gap: 28px;
  margin-top: 48px;
}

.p-sheet {
  position: relative;
  padding: clamp(24px, 3vw, 40px) clamp(20px, 2.6vw, 34px);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  font-family: "Times New Roman", Times, serif;
  font-size: 15.5px;
  line-height: 1.5;
}

.p-sheet:first-child {
}

.p-sheet:last-child {
}

.p-sheet__title,
.p-sheet__heading {
  margin: 0 0 14px;
  font: 700 16px/1.35 "Times New Roman", Times, serif;
  text-align: center;
  text-transform: uppercase;
}

.p-sheet__heading:not(.is-centered) {
  margin-top: 18px;
  text-align: left;
  text-transform: none;
}

.p-sheet p {
  margin: 0;
  text-align: justify;
  text-indent: 1.25cm;
  hyphens: auto;
}

.p-sheet__toc {
  margin: 0;
  padding: 0;
  list-style: none;
}

.p-sheet__toc li {
  padding-block: 3px;
}

.p-sheet__toc .is-l2 {
  padding-left: 1.4em;
}

.p-sheet__toc .is-l3 {
  padding-left: 2.8em;
}

.p-sheet__fade {
  position: relative;
  max-height: 520px;
  overflow: hidden;
}

.p-sheet__fade::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 120px;
  background: linear-gradient(transparent, var(--paper));
}

.brut .p-sheet__more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  text-indent: 0;
  font: 700 14px/1 var(--font-body);
}

.p-passport {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}

.p-passport > div {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 8px 24px;
}

.p-passport dt {
  margin: 0;
  padding-top: 3px;
}

.p-passport dd {
  margin: 0;
}

.p-refs {
  margin: 20px 0 0;
  padding-left: 1.6em;
}

.p-refs li {
  margin-bottom: 10px;
  padding-left: 6px;
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.p-refs li::marker {
  font-weight: 600;
}

.p-block {
  margin-top: clamp(48px, 6vw, 72px);
}

.p-block > .b-h3 {
  font-size: clamp(22px, 2.4vw, 30px);
}

.p-order {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.p-order .b-h3 {
  margin: 0;
}

.p-order p {
  margin: 0;
}

.p-order .b-ticks {
  margin: 0;
  font-size: 15.5px;
}

.p-order__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
  font-weight: 700;
}

.p-order__price .b-price {
  font-size: 40px;
}

/* Phones: the order card sits below the whole sample, so the price rides along at the bottom. */
.p-sticky-cta {
  display: none;
}

/* ---------- sign-in, reset, verify ---------- */

.p-auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
  grid-template-areas: "intro card";
  align-items: start;
  gap: 32px clamp(32px, 6vw, 88px);
  padding-block: clamp(32px, 6vw, 72px) var(--section);
}

.p-auth__intro {
  grid-area: intro;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.p-auth__intro .b-h1 {
  max-width: 14ch;
  text-wrap: balance;
}

.p-auth__intro .b-lead {
  margin: 0;
}

/* The saved paragraph: two lines on squared paper, поля with a red line, the научрук's marks. */
.p-auth__draft {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0;
  padding: 7px 46px 7px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background-color: var(--paper);
  background-image:
    linear-gradient(#e6edf5 1px, transparent 1px),
    linear-gradient(90deg, #e6edf5 1px, transparent 1px);
  background-position: -1px -1px;
  background-size: 14px 14px;
  box-shadow: var(--shadow-s);
}

.p-auth__draft::after {
  content: "";
  position: absolute;
  top: 0;
  right: 28px;
  bottom: 0;
  width: 2px;
  background: #f0a39c;
}

.p-auth__draft-text {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--ink);
  font: 400 17px/28px "Times New Roman", Times, serif;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}


.p-auth__card {
  grid-area: card;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.p-auth__card .b-h3 {
  margin: 0;
}

.p-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--paper-2);
}

.p-tabs button {
  min-height: 44px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink);
  font: 700 15px/1 var(--font-body);
  cursor: pointer;
  transition: background-color var(--dur) var(--ease);
}

.p-tabs button:hover {
  background: var(--paper);
}

.brut .p-tabs button.active {
  background: var(--ink);
  color: var(--paper);
}

.p-yandex {
  gap: 12px;
}

.p-yandex__mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fc3f1d;
  color: var(--paper);
  font: 600 15px/1 var(--font-body);
}

.p-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--text-3);
  font-size: 14px;
  font-weight: 600;
}

.p-divider::before,
.p-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line-strong);
}

.p-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.p-form__forgot {
  align-self: flex-end;
  font-size: 14px;
  font-weight: 600;
}

.p-consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
}

.p-consent input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--ink);
}

.p-consent a {
  text-decoration: underline;
}

.p-captcha-off {
  padding: 10px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--text-3);
  font-size: 13px;
}

.p-status {
  min-height: 1.4em;
  margin: 0;
  font-weight: 600;
  font-size: 15px;
}

.p-status:empty {
  display: none;
}

.p-code {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-align: center;
}

/* ---------- guide ---------- */

.p-guide {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.p-guide > li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: start;
  gap: 20px 32px;
  padding-block: 28px;
  border-top: 1px solid var(--line-strong);
}

.p-guide__n {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--lemon-soft);
  box-shadow: var(--shadow-s);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 650;
}

.p-guide h2 {
  margin: 4px 0 10px;
}

.p-guide p {
  margin: 0;
}

.p-guide .b-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.p-guide .b-card strong {
  font-size: 18px;
  line-height: 1.3;
}

.p-guide > li:nth-child(odd) .b-card { transform: none; }
.p-guide > li:nth-child(even) .b-card { transform: none; }

.p-tips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.p-tips strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 17px;
}

.p-tips p {
  margin: 0;
  font-size: 15.5px;
}

/* ---------- legal ---------- */

.p-legal {
  max-width: 820px;
  padding-bottom: var(--section);
}

.p-legal .b-h1 {
  font-size: clamp(28px, 6.4vw, 64px);
  overflow-wrap: anywhere;
  hyphens: auto;
}

.p-legal__meta {
  margin: 0;
  color: var(--text-2);
  font-size: 15.5px;
}

.p-legal__meta a {
  text-decoration: underline;
}

.p-legal__doc {
  counter-reset: legal;
}

.p-legal__section {
  padding-block: 26px;
  border-top: 1px solid var(--line-strong);
  counter-increment: legal;
}

.p-legal__section h2 {
  display: flex;
  gap: 14px;
  margin: 0 0 14px;
}

.p-legal__section h2::before {
  content: counter(legal, decimal-leading-zero);
  color: var(--cobalt);
}

.p-legal__section ul {
  margin: 0;
  padding-left: 1.2em;
}

.p-legal__section li {
  margin-bottom: 8px;
  color: var(--text-2);
  max-width: 72ch;
  overflow-wrap: anywhere;
}

/* ---------- small screens ---------- */

@media (max-width: 980px) {
  .p-sample {
    grid-template-columns: minmax(0, 1fr);
  }

  /* relative, not static: the grain overlay must stay inside the card. */
  .p-order {
    position: relative;
    top: auto;
  }

  .p-auth {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "intro" "card";
  }

  .p-guide > li {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .p-guide > li > .b-card {
    grid-column: 2;
  }
}


@media (max-width: 560px) {
  .p-guide > li {
    grid-template-columns: minmax(0, 1fr);
  }

  .p-guide > li > .b-card {
    grid-column: 1;
  }

  .p-guide__n {
    width: 52px;
    height: 52px;
    font-size: 22px;
  }

  .p-cta .b-btn {
    flex: 1 1 100%;
  }

  .p-passport > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .p-sample__title {
    font-size: 23px;
  }

  .p-has-sticky {
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }

  .p-sticky-cta {
    position: fixed;
    inset: auto 0 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line-strong);
    background: var(--lemon-soft);
  }

  .p-sticky-cta .b-price {
    font-size: 26px;
  }
}
