/* The residents' page in the app's paper palette and type (Figma WIP 1475:28323; A1–A6 at 360, B1 at 1280).
   The colours are the frames' own: the paper (#F2EBDA), the panel on it (#FBF7EE), its hairline (#DCCFB2), the ink
   and its secondary (#1A2B26, #5E6A62), forest for what can be pressed (#1F5945) and its wash (#E3E6D6), gold dark for
   the eyebrow and the houses' outline (#8F5E12), the error's red (#A8324A) and the warning's (#AB4221). The page is
   paper in daylight only, as the frames are: no dark scheme was drawn. */

@font-face { font-family: "Alegreya"; src: url("fonts/Alegreya-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("fonts/Alegreya-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Alegreya SC"; src: url("fonts/AlegreyaSC-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("fonts/AlegreyaSans-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --paper: #F2EBDA;
  --panel: #FBF7EE;
  --line: #DCCFB2;
  --ink: #1A2B26;
  --ink-2: #5E6A62;
  --forest: #1F5945;
  --forest-wash: #E3E6D6;
  --gold-dark: #8F5E12;
  --error: #A8324A;
  --warning: #AB4221;
  --map-ground: #EAE2CF;
  --map-road: #F8F3E6;
  --map-road-edge: #D9CDB0;
  --map-house: #E9C978;
  --map-withdrawn: #B5A684;

  --serif: "Alegreya", Georgia, "Times New Roman", serif;
  --caps: "Alegreya SC", "Alegreya", Georgia, serif;
  --sans: "Alegreya Sans", "Helvetica Neue", Arial, sans-serif;
  --gutter: 16px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/22px var(--serif);
  font-variant-numeric: lining-nums;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
p, h1, h2, ol, ul, figure { margin: 0; }
[hidden] { display: none !important; }
a, .link { color: var(--forest); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--forest) 55%, transparent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }

/* The bar: the wordmark and the languages (master «Страница · шапка»). */
.bar { background: var(--panel); border-bottom: 1px solid var(--line); }
.bar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 62px; padding: 14px var(--gutter); max-width: 1040px; margin: 0 auto; box-sizing: content-box; }
.wordmark { font: 700 22px/30px var(--caps); letter-spacing: 0.08em; }
.languages { display: flex; gap: 0; padding: 3px; border: 1px solid var(--line); border-radius: 16px; }
.languages button {
  font: 700 13px/16px var(--sans); color: var(--ink-2); background: none; border: 0; border-radius: 13px;
  padding: 5px 10px; min-width: 36px; cursor: pointer;
}
.languages button[aria-pressed="true"] { background: var(--forest-wash); color: var(--forest); }

/* The page: one column on a phone (A1), two from 900 px (B1). */
.page { flex: 1; width: 100%; max-width: 600px; margin: 0 auto; padding: 0 var(--gutter) 32px; display: flex; flex-direction: column; gap: 20px; }
.about { padding-top: 28px; display: flex; flex-direction: column; gap: 12px; }
.about .example { margin-top: 8px; }
.work { display: flex; flex-direction: column; gap: 20px; }

.eyebrow { font: 700 12px/14px var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-dark); }
.title { font: 700 30px/34px var(--caps); }
.lead { font-size: 18px; line-height: 25px; }
.lead2 { font-size: 17px; line-height: 24px; color: var(--ink-2); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 16px; }
.card-title { font: 700 20px/27px var(--caps); }
.card-text { font-size: 16px; line-height: 22px; }

.example { padding: 12px 12px 14px; gap: 10px; }
.example-map, .minimap { border-radius: 10px; overflow: hidden; background: var(--map-ground); line-height: 0; }
.example-map svg, .minimap svg { display: block; width: 100%; height: auto; }
.caption { font: italic 400 15px/20px var(--serif); color: var(--ink-2); }

/* Map paint, shared by the example and the small map. */
.mm-ground { fill: var(--map-ground); }
.ex-edge { fill: var(--map-road-edge); }
.ex-road { fill: var(--map-road); }
.mm-road-edge { stroke: var(--map-road-edge); }
.mm-road { stroke: var(--map-road); }
.mm-house { fill: var(--map-house); stroke: var(--gold-dark); stroke-width: 1; stroke-linejoin: round; }
.mm-chosen { stroke-width: 3; }
.mm-withdrawn { fill: var(--map-ground); stroke: var(--map-withdrawn); stroke-width: 1.5; stroke-dasharray: 4 3; }
.mm-badge { fill: var(--panel); stroke: var(--line); stroke-width: 1; }
.mm-castle { fill: var(--forest); }
.mm-pill rect { fill: var(--panel); stroke: var(--line); stroke-width: 1; }
.mm-pill text { font: 700 11px var(--sans); fill: var(--ink); }

/* Fields (master «Поле · страница»): idle, focused, filled, error. */
.form { position: relative; }
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font: 700 12px/14px var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.box {
  width: 100%; margin: 0; font: 400 17px/23px var(--serif); color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; min-height: 49px; resize: none;
  appearance: none; -webkit-appearance: none; overflow: hidden;
}
.box::placeholder { color: var(--ink-2); opacity: 1; }
.box:focus { outline: none; border: 2px solid var(--forest); padding: 11px 13px; }
.box.invalid, .box.invalid:focus { border: 2px solid var(--error); padding: 11px 13px; }
.hint { font-size: 14px; line-height: 19px; color: var(--ink-2); }
.hint.error { color: var(--error); }
.hint:empty { display: none; }

/* Suggestions (master «Подсказка адреса»: Kind=В игре, Kind=Уже убран). */
.suggestions { list-style: none; padding: 0; margin: 10px 0 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.suggestions li { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; min-height: 47px; }
.suggestions li[aria-selected="true"], .suggestions li:hover { background: color-mix(in srgb, var(--forest-wash) 60%, var(--panel)); }
.suggestions li[aria-disabled="true"] { cursor: default; background: var(--panel); }
.suggestions .icon { width: 18px; height: 18px; flex: none; fill: var(--forest); }
.suggestions li[aria-disabled="true"] .icon { fill: var(--ink-2); }
.suggestions .address { flex: 1; min-width: 0; font-size: 17px; line-height: 23px; overflow-wrap: anywhere; }
.suggestions li[aria-disabled="true"] .address { color: var(--ink-2); }
.suggestions .tag { flex: none; font: 700 12px/14px var(--sans); color: var(--ink-2); text-align: right; }

/* The chosen house on its small map (A3). */
.chosen { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 8px; margin-top: -4px; }
.minimap { border-radius: 9px; aspect-ratio: 276 / 163; }
.chosen-other { font-size: 15px; line-height: 20px; color: var(--forest); }

.describe { display: flex; flex-direction: column; gap: 16px; }
.describe-text { font-size: 16px; line-height: 22px; }

/* Buttons (masters «Primary button», «Secondary button»). */
.button { width: 100%; border: 0; cursor: pointer; font: 700 18px/22px var(--sans); display: flex; align-items: center; justify-content: center; text-align: center; padding: 0 16px; }
.primary { min-height: 50px; border-radius: 14px; background: var(--forest); color: var(--panel); }
.primary:disabled { background: var(--forest-wash); color: var(--ink-2); cursor: default; }
.primary.sending { opacity: 0.75; cursor: progress; }
.secondary { min-height: 46px; border-radius: 12px; background: var(--forest-wash); color: var(--forest); }
.submit-hint { font-size: 14px; line-height: 19px; color: var(--ink-2); text-align: center; margin-top: -2px; }
.fallback { font-size: 15px; line-height: 21px; color: var(--ink-2); }

/* A6: what did not go. */
.banner { display: flex; gap: 10px; align-items: flex-start; background: var(--panel); border: 2px solid var(--error); border-radius: 12px; padding: 12px 14px; }
.banner .icon { width: 20px; height: 20px; flex: none; fill: var(--warning); margin-top: 1px; }
.banner-text { font-size: 16px; line-height: 22px; }

/* What will happen and what we receive. */
.steps { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.steps li { display: flex; gap: 12px; font-size: 16px; line-height: 22px; }
.step-number { flex: none; width: 28px; height: 28px; border-radius: 14px; background: var(--forest-wash); color: var(--forest); font: 700 15px/28px var(--caps); text-align: center; }

/* A4: the request is in. */
.done { padding-top: 40px; display: flex; flex-direction: column; gap: 16px; outline: none; }
.done-mark { width: 56px; height: 56px; border-radius: 28px; background: var(--forest-wash); display: flex; align-items: center; justify-content: center; }
.done-mark .icon { width: 28px; height: 28px; fill: var(--forest); }
.request { gap: 6px; }
.request-code { font: 700 28px/38px var(--caps); letter-spacing: 0.04em; user-select: all; -webkit-user-select: all; }
.request-cancel { margin-top: 4px; font-size: 16px; line-height: 22px; }
.request-cancelled { color: var(--ink-2); }
.done-email { font-size: 16px; line-height: 22px; color: var(--ink-2); }
.mail, .request-text .mail { user-select: text; -webkit-user-select: text; overflow-wrap: anywhere; }

/* The foot (master «Страница · подвал»). */
.foot { border-top: 1px solid var(--line); background: var(--paper); }
.foot-inner { max-width: 1040px; margin: 0 auto; padding: 20px var(--gutter) 28px; display: flex; flex-direction: column; gap: 8px; box-sizing: content-box; }
.contact { font-size: 15px; line-height: 20px; color: var(--ink-2); }
.operator, .policy, .attribution { font-size: 14px; line-height: 19px; color: var(--ink-2); }
.noscript { max-width: 600px; margin: 16px auto; padding: 0 var(--gutter); }

/* A4 on a phone stands alone, as drawn: the introduction and the cards step aside. */
.page[data-view="done"] .about, .page[data-view="done"] .work { display: none; }

/* B1: two columns at a computer's width. */
@media (min-width: 900px) {
  .bar-inner, .foot-inner { padding-left: 40px; padding-right: 40px; }
  .page {
    max-width: 1120px; padding: 56px 40px 72px; display: grid; gap: 24px 64px;
    grid-template-columns: minmax(0, 480px) minmax(0, 1fr); align-items: start;
  }
  .about { padding-top: 0; gap: 16px; grid-column: 1; grid-row: 1 / span 2; }
  .about .example { margin-top: 0; }
  .work, .done { grid-column: 2; grid-row: 1; }
  .work { gap: 24px; }
  .done { padding-top: 0; }
  .page[data-view="done"] .about { display: flex; }
  .eyebrow { font-size: 13px; line-height: 16px; }
  .about .title { font-size: 44px; line-height: 50px; }
  .lead { font-size: 20px; line-height: 28px; }
  .lead2 { font-size: 18px; line-height: 26px; }
  .example-map { border-radius: 15px; }
  .caption { font-size: 16px; line-height: 22px; }
  .minimap { border-radius: 18px; }
}
@media (min-width: 1200px) {
  .bar-inner, .foot-inner { padding-left: 0; padding-right: 0; }
  .page { padding-left: 0; padding-right: 0; max-width: 1040px; }
}
