/*
 * The guides under /ghid/ (RO and RU): a reading column on base.css's tokens, with
 * the FAQ, contact and footer blocks of blocks.css under it. Every rule here is
 * scoped to a .g-* class or to the guides' own blocks, so nothing reaches the
 * other pages. The portal walkthrough in .walk brings its own styles inside a
 * shadow root (sfs-walkthrough.css), and the site's cannot reach in.
 */

/* The guide being read, in the top menu. */
nav.top .links a[aria-current="page"] { background: var(--accent); color: var(--fg); }

/* --------------------------------------------------------------- columns */
/* The text reads at about 70 characters; the walkthrough and the states table
   take more room, on the page's own grid. */
.wrap.g-col { max-width: calc(760px + 64px); }
.wrap.g-wide { max-width: calc(1040px + 64px); }

/* ------------------------------------------------------------------ head */
.g-hero { position: relative; padding: 28px 0 8px; }
.g-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.2px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 55% 80% at 85% 20%, #000 20%, transparent 70%);
  mask-image: radial-gradient(ellipse 55% 80% at 85% 20%, #000 20%, transparent 70%);
}
.g-hero .wrap { position: relative; }
@media (min-width: 960px) { .g-hero { padding-top: 48px; } }
.g-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 22px; padding: 0; font-size: 13px; color: var(--muted); }
.g-crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--faint); }
.g-crumbs a { color: var(--muted); text-decoration: none; }
.g-crumbs a:hover { color: var(--fg); text-decoration: underline; }
.g-hero h1 { font-size: clamp(30px, 4.6vw, 50px); line-height: 1.06; letter-spacing: -0.04em; font-weight: 700; margin: 14px 0 20px; text-wrap: balance; }
.g-def { font-size: clamp(17px, 1.9vw, 20px); line-height: 1.55; margin: 0 0 18px; text-wrap: pretty; }
.g-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; font: 500 12.5px/1.5 var(--mono); color: var(--muted); }
.g-meta time { color: var(--fg); }

.g-toc { margin: 28px 0 0; padding: 16px 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); }
.g-toc p { margin: 0; font: 500 12.5px/1.4 var(--mono); color: var(--muted); }
.g-toc ol { margin: 10px 0 0; padding-left: 22px; columns: 2 300px; column-gap: 32px; font-size: 15px; }
.g-toc li { break-inside: avoid; margin: 0 0 6px; color: var(--faint); }
.g-toc a { color: var(--fg); text-decoration: none; }
.g-toc a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ body */
.g-body { padding: 8px 0 80px; }
.g-sec { padding-top: 48px; }
.g-body h2 { font-size: clamp(24px, 3vw, 32px); line-height: 1.15; letter-spacing: -0.03em; font-weight: 700; margin: 0 0 16px; text-wrap: balance; }
.g-body h3 { font-size: 19px; line-height: 1.3; letter-spacing: -0.015em; margin: 28px 0 8px; }
.g-body p, .g-body li { font-size: 17px; line-height: 1.65; }
.g-body p { margin: 0 0 14px; }
.g-body ul { margin: 0 0 16px; padding-left: 22px; }
.g-body ul li { margin: 0 0 8px; }
.g-body li::marker { color: var(--faint); }
.g-body a { color: var(--fg); text-decoration-color: color-mix(in srgb, var(--fg) 35%, transparent); text-underline-offset: 3px; }
.g-body a:hover { text-decoration-color: currentColor; }
.g-body b { font-weight: 600; }
.g-body code { font: 500 0.9em/1 var(--mono); background: var(--accent); border-radius: 5px; padding: 2px 5px; }

/* A sentence the app or SFS shows, word for word. */
.g-say { margin: 0 0 16px; padding: 12px 16px; border-left: 3px solid var(--input); border-radius: 0 12px 12px 0; background: var(--sunken); font-size: 15.5px; line-height: 1.55; }
.g-say q { quotes: none; }

/* What you need, or what to watch: a dashed note, as on /facturi/. */
.g-note { display: grid; grid-template-columns: 22px 1fr; gap: 12px; margin: 20px 0; padding: 14px 16px; border: 1px dashed var(--input); border-radius: 14px; color: var(--muted); }
.g-note svg { width: 20px; height: 20px; margin-top: 3px; color: var(--fg); }
.g-note p, .g-note li { font-size: 15.5px; line-height: 1.6; }
.g-note p { margin: 0; }
.g-note ul { margin: 6px 0 0; }
.g-note ul li { margin: 0 0 4px; }

/* ------------------------------------------------------------- the steps */
.howto { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; counter-reset: step; }
.howto > li { counter-increment: step; position: relative; margin: 0; padding: 16px 18px 16px 60px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); scroll-margin-top: 80px; }
.howto > li::before {
  content: counter(step); position: absolute; left: 16px; top: 15px;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary); color: var(--on-primary); font: 600 13px/1 var(--mono);
}
.howto h3 { margin: 3px 0 4px; font-size: 17px; }
.howto p { margin: 0; font-size: 16px; color: var(--muted); }
.howto p b { color: var(--fg); }

/* -------------------------------------------------- the portal walkthrough */
.walk { margin: 26px 0 6px; }
.walk[hidden] { display: none; }
.walk figcaption { margin: 12px 0 0; font-size: 13px; color: var(--faint); }

/* ------------------------------------------------------- the states table */
.g-states { width: 100%; margin: 20px 0 8px; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.g-states th { text-align: left; vertical-align: bottom; padding: 0 14px 10px 0; border-bottom: 1px solid var(--border); font: 500 12px/1.3 var(--mono); color: var(--muted); }
.g-states td { vertical-align: top; padding: 16px 14px 16px 0; border-bottom: 1px solid var(--border); }
.g-states td:first-child { width: 190px; }
.g-states td small { display: block; margin-top: 6px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.g-states td i { font-style: normal; color: var(--muted); }
.g-states .pill { font-size: 13px; }
/* A phone: each state is a card, its cells labelled. */
@media (max-width: 760px) {
  .g-states thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .g-states, .g-states tbody, .g-states tr, .g-states td { display: block; width: auto; }
  .g-states tr { margin: 0 0 10px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
  .g-states td { padding: 4px 0; border: 0; }
  .g-states td:first-child { width: auto; padding-bottom: 8px; }
  .g-states td[data-label]::before { content: attr(data-label); display: block; font: 500 11.5px/1.5 var(--mono); color: var(--faint); }
}

/* -------------------------------------------------- next: guides, sources */
.g-cards { display: grid; gap: 12px; margin: 18px 0 0; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.g-card { display: grid; align-content: start; gap: 6px; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); text-decoration: none; transition: border-color .2s, transform .25s var(--ease); }
.g-body a.g-card { text-decoration: none; }
.g-card:hover { border-color: var(--input); transform: translateY(-2px); }
.g-card small { font: 500 12px/1.3 var(--mono); color: var(--muted); }
.g-card b { font-size: 17px; line-height: 1.3; letter-spacing: -0.01em; }
.g-card span { font-size: 15px; line-height: 1.5; color: var(--muted); }

/* The product, once, at the end of the text. No price: the guides never state one. */
.g-cta { display: grid; gap: 18px; margin: 48px 0 0; padding: 24px 22px; border: 1px solid var(--border); border-radius: 20px; background: var(--card); }
@media (min-width: 720px) { .g-cta { grid-template-columns: 64px 1fr; padding: 28px; gap: 22px; align-items: start; } }
.g-cta .bot { width: 64px; height: 64px; }
.g-cta h2 { margin: 0 0 8px; font-size: clamp(22px, 2.6vw, 26px); }
.g-cta p { margin: 0 0 16px; color: var(--muted); font-size: 16px; }
.g-cta .row { display: flex; flex-wrap: wrap; gap: 10px; }
.g-body .g-cta a.btn { text-decoration: none; }
.g-body .g-cta a.btn-primary { color: var(--on-primary); }

/* The official source, under the steps. */
.g-body .g-src { margin: 16px 0 0; font-size: 15px; color: var(--muted); }
