/* Hair Harvester — account: sign-in, registration, profile, static pages. Loaded after the core stylesheet; scope every rule to this area's pages. */

/* ==========================================================================
   1. Account cards: sign-in, registration, the second factor, password and e-mail forms, "letter sent".
      The outer element is <section class="narrow acct">; the card itself is the core's .panel.auth.
   ========================================================================== */
.acct {
  /* 17 x 12, an envelope on the stitch grid: ink outline, red flap */
  --i-letter: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 17 12%22 shape-rendering=%22crispEdges%22 width=%2217%22 height=%2212%22%3E%3Cpath fill=%22%2317120f%22 d=%22M0 0h17v1h-17zM0 1h1v1h-1zM16 1h1v1h-1zM0 2h1v1h-1zM16 2h1v1h-1zM0 3h1v1h-1zM16 3h1v1h-1zM0 4h1v1h-1zM16 4h1v1h-1zM0 5h1v1h-1zM16 5h1v1h-1zM0 6h1v1h-1zM16 6h1v1h-1zM0 7h1v1h-1zM16 7h1v1h-1zM0 8h1v1h-1zM16 8h1v1h-1zM0 9h1v1h-1zM16 9h1v1h-1zM0 10h1v1h-1zM16 10h1v1h-1zM0 11h17v1h-17z%22/%3E%3Cpath fill=%22%23a3131c%22 d=%22M1 1h1v1h-1zM15 1h1v1h-1zM2 2h2v1h-2zM13 2h2v1h-2zM4 3h2v1h-2zM11 3h2v1h-2zM6 4h2v1h-2zM9 4h2v1h-2zM8 5h1v1h-1z%22/%3E%3C/svg%3E");
}
.acct .auth { padding: var(--s5) var(--s4); }
.acct .auth > h1 { margin-bottom: var(--s2); }
.acct .auth > h1 + .muted { margin: 0 0 var(--s4); }
.acct .auth > form { margin-top: var(--s4); }
.acct .auth > form > .note:first-of-type { margin-top: 0; }
.acct .auth > form > .errorlist { margin: 0 0 var(--s4); }
.acct .crumbs { margin: -6px 0 var(--s1); }
.acct-addr { overflow-wrap: anywhere; }

/* the two promises at registration stand together between two bare seams */
.acct-vows { margin: 0 0 var(--s5); padding: var(--s2) 0; background: var(--ghost) top / auto 2px repeat-x, var(--ghost) bottom / auto 2px repeat-x; }
.acct-vows .field { margin: 0; }
.acct-vows .errorlist { margin: 0 0 var(--s2) 36px; }
/* the two links inside the consent sentence get a full touch field, so a thumb that aims at the rules does not tick the box */
/* The consent links live in the tick's help line (F70); each gets a full touch area of its own. */
.acct-vows .help a { display: inline-block; padding-block: 12px; }

/* the quiet way out under the form: a running stitch and the links, each a full touch field */
.acct-foot { margin-top: var(--s5); padding-top: var(--s4); background: var(--run) top / auto 2px repeat-x; text-align: center; }
.acct-foot p { margin: 0; padding: 9px 0; }
.acct-foot.acct-hint { text-align: left; }

/* "letter sent": the words centred under an embroidered envelope */
.acct-sent .auth { padding-top: var(--s6); text-align: center; }
.acct-sent .auth::before { content: ""; display: block; width: 68px; height: 48px; margin: 0 auto var(--s4); background: var(--i-letter) center / 68px 48px no-repeat; }
.acct-sent .acct-addr { font-weight: 700; }
.acct-sent .note { margin-top: var(--s5); text-align: left; }
.acct-sent .auth > p:has(.btn) { margin-bottom: 0; }

/* a link that no longer works: the cross says it before the words do */
.acct-dead .auth::before { content: ""; display: block; width: 35px; height: 35px; margin: 0 0 var(--s4); background: var(--i-cross) center / 35px 35px no-repeat; }
.acct-dead .auth > p:has(.btn) { margin: var(--s5) 0 0; }

/* the second factor: three ways to add the record, each between running stitches, then the code */
.otp-way { padding: var(--s4) 0 var(--s1); background: var(--run) top / auto 2px repeat-x; }
.otp-way > p:first-child { margin-top: 0; }
.otp-way .field { margin-bottom: var(--s3); }
/* the code to scan lies on a mount with a stitch in every corner (the 5 x 5 sign drawn at 10 px, so it reads as a stitch); the white field under it stays for the scanner */
.acct .qr {
  width: fit-content; max-width: 100%; margin: var(--s4) auto; padding: 14px;
  background: var(--i-rhomb) left 2px top 2px / 10px 10px no-repeat, var(--i-rhomb) right 2px top 2px / 10px 10px no-repeat,
    var(--i-rhomb) left 2px bottom 2px / 10px 10px no-repeat, var(--i-rhomb) right 2px bottom 2px / 10px 10px no-repeat, var(--cloth);
  box-shadow: inset 0 0 0 1px var(--line);
}
/* the key to type by hand: fixed-width letters and a dashed edge (it is to be read, not filled in).
   It is a read-only textarea, so that on a narrow phone the 32 letters fold into two lines instead of being cut.
   Its height is never fixed: where the browser can, the field is as tall as its text (field-sizing), also when the
   reader has enlarged the type; elsewhere it is the two rows of the markup, and a longer text can be scrolled. */
.acct .otp-key {
  display: block; height: auto; min-height: 52px; padding: 12px 8px;
  resize: none; overflow: auto; field-sizing: content; word-break: break-all;
  font: 400 1rem/1.4 ui-monospace, "DejaVu Sans Mono", "Liberation Mono", Menlo, Consolas, monospace; letter-spacing: .12em;
}
@media (min-width: 400px) {
  .acct .otp-key { padding: 14px 8px; letter-spacing: 0; }
}
.otp-then { margin: var(--s2) 0 0; padding-top: var(--s4); background: var(--run) top / auto 2px repeat-x; }
.otp-then + .note { margin-top: var(--s4); }
/* six digits, drawn like the code a seller is given */
.acct .otp-code { min-height: 64px; padding-inline: 8px; text-align: center; font: 700 2rem/1 var(--serif); letter-spacing: .22em; font-variant-numeric: lining-nums tabular-nums; }

@media (min-width: 640px) {
  .acct .auth { padding: var(--s6); }
}
@media (min-width: 960px) {
  .acct { margin-top: var(--s4); }
  .acct .auth { padding: 40px 40px 36px; }
}

/* ==========================================================================
   2. The profile: <section class="myprofile"> holds the head, the form and a side column
      (the sign-in settings, the public view, the way out). One column on a phone, two from 960 px.
   ========================================================================== */
.myprofile { max-width: 520px; margin: 0 auto; }
.myprofile-head { margin: 0 0 var(--s4); }
.myprofile-head h1 { margin-bottom: var(--s1); }
.myprofile-mail { margin: 0; }
/* the state of the address: a sign and the words, never the colour alone */
/* on a phone the state stands on a line of its own, so the dot between the two is not needed there */
.myprofile-mail .sep { display: none; }
.myprofile-mail .conf { display: block; color: var(--ink); }
.myprofile-mail .conf::before { content: ""; display: inline-block; width: 14px; height: 12px; margin-right: 6px; background: var(--i-check-ink) center / 14px 12px no-repeat; }
.myprofile-mail .conf.wait { color: var(--red); font-weight: 700; }
.myprofile-mail .conf.wait::before { width: 18px; height: 18px; vertical-align: -3px; background: var(--i-star) center / 18px 18px no-repeat; }
.myprofile-form > .btn.block { margin-top: var(--s2); }
/* both rows have one shape at every width: the name on the left, its link on the right; the address, however long,
   lies on a line of its own under them (the wrapping span is dissolved, so the address can span the whole row) */
.myprofile-login .row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--s4); align-items: center; min-height: 56px; margin: 0; padding: 6px 0; background: var(--run) top / auto 2px repeat-x; }
.myprofile-login .row > span { display: contents; }
.myprofile-login .row > a { grid-area: 1 / 2; display: inline-flex; align-items: center; min-height: 44px; padding-block: 0; white-space: nowrap; }
.myprofile-login .row .acct-addr { grid-area: 2 / 1 / auto / -1; margin: -4px 0 8px; color: var(--ink-2); }
.myprofile-out { justify-content: space-between; margin: 0 0 var(--s5); }
.myprofile-out > a { display: inline-flex; align-items: center; min-height: 44px; }
/* The «Ви ввійшли як … / Вийти» row sits right under the address, so it keeps close to it (F109). */
.myprofile-head .myprofile-out { margin: var(--s2) 0 0; }

/* from 640 px the address and its state share a line when they fit. The dot between them is drawn by the state and
   hangs in the gap before it; when the state folds to a line of its own, the dot falls outside the paragraph and is clipped,
   so it never dangles at the end of the address. (The dot of the markup stays hidden: it cannot follow the state.) */
@media (min-width: 640px) {
  .myprofile-mail { display: flex; flex-wrap: wrap; gap: 0 22px; overflow: hidden; }
  .myprofile-mail .conf { position: relative; white-space: nowrap; }
  .myprofile-mail .conf::after { content: "\00b7"; position: absolute; left: -14px; top: 0; color: var(--ink-2); font-weight: 400; }
}
@media (min-width: 960px) {
  .myprofile { display: grid; grid-template-columns: minmax(0, 560px) minmax(400px, 1fr); column-gap: 64px; align-items: start; max-width: none; margin: 0; }
  .myprofile-head { grid-column: 1 / -1; margin-bottom: var(--s5); }
  .myprofile-side { position: sticky; top: 24px; }
}

/* ==========================================================================
   3. Reading pages («Як це працює», «Правила», «Приватність»): <article class="doc docpage">
      with a .doc-head and one .doc-sec per heading. A measure of 60–70 characters;
      from 960 px the headings hang in a column of their own and stay in sight while their section is read.
   ========================================================================== */
.docpage { max-width: 31em; }
.docpage p, .docpage li, .docpage dd { line-height: 1.55; }
.doc-head { margin: 0 0 var(--s5); }
.doc-head h1 { margin-bottom: var(--s3); }
.doc-head .lead { max-width: none; margin: 0 0 var(--s4); color: var(--ink); font-size: 1.25rem; line-height: 1.45; }
.doc-head > p:not(.note):not(.lead) { margin: 0; font-size: 1rem; line-height: 1.45; }
.doc-head > :last-child { margin-bottom: 0; }
.doc-sec { padding: var(--s5) 0; background: var(--run) top / auto 2px repeat-x; }
.docpage .doc-sec h2 { margin: 0 0 var(--s3); scroll-margin-top: 24px; }
.doc-sec h2 .num { color: var(--red); }
.doc-body > :first-child { margin-top: 0; }
.doc-body > :last-child { margin-bottom: 0; }

/* lists: a red rhombus for "this is so", a cross for "this is not allowed" (the words say it too) */
.docpage ul { list-style: none; margin: var(--s3) 0 var(--s4); padding: 0; }
.docpage ul > li { position: relative; margin: 0 0 10px; padding-left: 27px; }
.docpage ul > li::before { content: ""; position: absolute; left: 0; top: .4em; width: 15px; height: 15px; background: var(--i-rhomb) center / 15px 15px no-repeat; }
.docpage ul.no > li::before { width: 14px; height: 14px; background-image: var(--i-cross); background-size: 14px 14px; }

/* the road of a seller or a buyer: numbered rhombi on one red seam; the last step is sewn full */
.docpage .road { list-style: none; margin: var(--s4) 0; padding: 0; counter-reset: road; }
.docpage .road > li { counter-increment: road; position: relative; min-height: 39px; margin: 0; padding: 5px 0 var(--s5) 54px; }
.docpage .road > li::before {
  content: counter(road); position: absolute; z-index: 1; left: 0; top: 0; width: 39px; height: 39px; display: grid; place-items: center;
  font: 700 1.0625rem/1 var(--serif); font-variant-numeric: lining-nums; background: var(--i-num) center / 39px 39px no-repeat;
}
.docpage .road > li::after { content: ""; position: absolute; left: 18px; top: 39px; bottom: 0; width: 3px; background: var(--run-v-red); }
.docpage .road > li:last-child { padding-bottom: 0; }
.docpage .road > li:last-child::after { display: none; }
.docpage .road > li:last-child::before { background-image: var(--i-num-done); color: var(--cloth); }
.docpage .road > li > b:first-child { display: block; margin-bottom: 2px; font: 600 1.25rem/1.3 var(--serif); letter-spacing: -.01em; }

/* the words of the site: the term in the serif, its meaning beside it from 640 px */
.docpage .words { margin: 0; }
.docpage .words dt { margin: 0; padding-top: var(--s3); background: var(--ghost) top / auto 2px repeat-x; font: 600 1.25rem/1.3 var(--serif); letter-spacing: -.01em; }
.docpage .words dd { margin: 2px 0 var(--s3); color: var(--ink); }
.docpage .words dt:first-child { padding-top: 0; background: none; }
.docpage .words dd:last-child { margin-bottom: 0; }

@media (min-width: 640px) {
  .docpage .words { display: grid; grid-template-columns: 8.5em minmax(0, 1fr); }
  .docpage .words dt, .docpage .words dd { margin: 0; padding: var(--s3) 0; background: var(--ghost) top / auto 2px repeat-x; }
  .docpage .words dt { padding-right: var(--s4); }
  .docpage .words dt:first-child, .docpage .words dt:first-child + dd { padding-top: 0; background: none; }
  .docpage .words dd:last-child { padding-bottom: 0; }
}

@media (min-width: 960px) {
  .docpage { --hang: 296px; --gap: 64px; max-width: calc(var(--hang) + var(--gap) + 30em); margin: 0 auto; }
  .doc-head { margin: 0 0 var(--s6) calc(var(--hang) + var(--gap)); }
  .doc-head .lead { font-size: 1.375rem; }
  .doc-head > p:not(.note):not(.lead) { font-size: 1.0625rem; }
  .doc-sec { display: grid; grid-template-columns: var(--hang) minmax(0, 1fr); column-gap: var(--gap); align-items: start; padding: var(--s6) 0; }
  /* a heading that hangs in the side column is titled on the panel rung */
  .docpage .doc-sec h2 { position: sticky; top: 24px; margin: 0; font-size: var(--t-panel); line-height: 1.15; }
  .doc-sec h2 .num { display: block; margin-bottom: 6px; font-size: 1.3125rem; }
  .docpage .road > li > b:first-child { font-size: 1.3125rem; }
  .docpage .words dt { font-size: 1.3125rem; }
}
