/* Rootpad v3: the create page (docs/design-v3/DESIGN.md §5.3, mock panel 3). Loaded after css/site.css by criar.html
   only. Owner: K (CREATE). Every rule is scoped under .create-page and uses the tokens of site.css; no keyframes and no
   motion block here (the base owns motion, §2.5). The shared pieces (stepper, fields, link box, icon rows, buttons,
   callouts, status lines) are styled by the base; this file only places them and adds the page's own parts. */

/* ------------------------------------------------------------ head and stepper (§3.14) */
.create-page .create-head { padding: var(--s7) 0 var(--s5); }
.create-page .stepper-card { margin: 0 0 var(--s4); padding: var(--s4) var(--s5); }
/* the connector runs from a step's label to the next dot (the line after a done step is green); the labels never
   shrink. The dots (a thin ring when todo, only the check when done) are the base's (site.css §3.14). From 600 px
   each step starts a third, the base's flex: 1 1 0 (the mock; Launch's third ends empty, QA T-CREATE-2: it was flush
   right); on phones a step takes its label's room and Launch only its own, so the three labels fit */
.create-page ol.stepper > li { min-width: auto; min-height: 36px; }
@media (max-width: 599px) {
  .create-page ol.stepper > li { flex: 1 1 auto; }
  .create-page ol.stepper > li:last-child { flex: 0 0 auto; }
}
.create-page ol.stepper > li + li::before { display: none; }
.create-page ol.stepper > li:not(:last-child)::after {
  content: '';
  flex: 1 1 24px;
  min-width: 8px;
  height: 1px;
  margin: 0 var(--s2);
  background: var(--line-strong);
}
.create-page ol.stepper > li[data-done]::after { background: var(--accent); }
.create-page .step-label { flex: 0 0 auto; white-space: nowrap; }
@media (min-width: 600px) {
  .create-page .stepper-card { margin-bottom: var(--s6); }
  .create-page ol.stepper > li:not(:last-child)::after { margin: 0 var(--s5); }
}
@media (max-width: 399px) {
  .create-page .stepper-card { padding: var(--s3); }
  .create-page ol.stepper { gap: 4px; }
  .create-page ol.stepper > li { gap: 6px; }
  .create-page ol.stepper > li:not(:last-child)::after { margin: 0 2px; }
  .create-page .step-dot { flex-basis: 28px; width: 28px; height: 28px; }
}
/* the narrowest phones: three labels fit only without the lines between them */
@media (max-width: 359px) {
  .create-page ol.stepper { justify-content: space-between; }
  .create-page ol.stepper > li { flex: 0 0 auto; }
  .create-page ol.stepper > li:not(:last-child)::after { display: none; }
}

/* ------------------------------------------------------------ layout: the steps left, the Launch settings right */
.create-page .create-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s4);
  align-items: start;
}
.create-page .create-main,
.create-page .create-side { min-width: 0; }
.create-page .create-side { display: grid; gap: var(--s4); }
.create-page .create-grid .card { margin: 0; }
@media (min-width: 600px) {
  .create-page .create-grid,
  .create-page .create-side { gap: var(--s6); }
}
@media (min-width: 1080px) {
  .create-page .create-grid { grid-template-columns: minmax(0, 1fr) 360px; }
}
@media (max-width: 599px) {
  .create-page #create-form.card.roomy { padding: var(--s4); }
}

/* ------------------------------------------------------------ step 1: Details */
.create-page #prefill-note:not([hidden]) { margin-bottom: var(--s5); }
.create-page #prefill-note .alert,
.create-page #create-off { margin: 0 0 var(--s3); }
.create-page #create-off { margin-bottom: var(--s5); }
.create-page .count {
  margin: var(--s2) 0 0;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.45;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.create-page .count.over { color: var(--danger); font-weight: 700; }
/* the image box (D32): the mock's drop area; upload a file (picker or drop), or paste a link below the "or" line */
.create-page fieldset.image-field { margin: 0 0 var(--s5); }
.create-page fieldset.image-field > legend { margin-bottom: var(--s2); padding: 0; color: var(--text); font-size: var(--fs-sm); font-weight: 700; }
.create-page .link-drop { justify-items: stretch; min-height: 0; padding: var(--s5) var(--s4); text-align: left; }
.create-page .link-drop.dragging { border-color: var(--accent); border-style: solid; }
.create-page .upload-pick { display: flex; justify-content: center; }
.create-page .upload-card { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: var(--s3); padding: var(--s3); border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.create-page .upload-thumb, .create-page .upload-thumb img { display: block; width: 64px; height: 64px; }
.create-page .upload-thumb img { border-radius: var(--r-sm); background: var(--card-2); object-fit: cover; }
.create-page .upload-info { display: grid; gap: var(--s2); min-width: 0; }
.create-page .upload-meta { margin: 0; color: var(--text); font-size: var(--fs-sm); font-weight: 700; font-variant-numeric: tabular-nums; }
.create-page .upload-actions { display: flex; flex-wrap: wrap; grid-column: 1 / -1; gap: var(--s2); }
.create-page .upload-note { grid-column: 1 / -1; margin: 0; font-size: 13px; }
.create-page #upload-status { flex-wrap: nowrap; align-items: flex-start; margin: 0; }
.create-page .or-line { display: flex; align-items: center; gap: var(--s3); margin: var(--s1) 0 0; color: var(--soft); font-size: 13px; }
.create-page .or-line::before, .create-page .or-line::after { content: ''; flex: 1 1 auto; height: 1px; background: var(--line); }
.create-page .link-drop .link-label { margin: 0; }
@media (max-width: 399px) {
  .create-page .upload-card { grid-template-columns: 48px minmax(0, 1fr); }
  .create-page .upload-thumb, .create-page .upload-thumb img { width: 48px; height: 48px; }
}
.create-page .link-drop::before { display: none; }
.create-page .drop-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s3);
  margin-bottom: var(--s1);
}
.create-page .drop-icon {
  display: grid;
  flex: 0 0 40px;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--card);
}
.create-page .drop-icon::before {
  content: '';
  width: 20px;
  height: 20px;
  background: var(--accent);
  -webkit-mask: url('/img/ui/image.svg') center / 20px 20px no-repeat;
  mask: url('/img/ui/image.svg') center / 20px 20px no-repeat;
}
.create-page .drop-title { margin: 0; color: var(--text); font-size: 15px; font-weight: 700; }
.create-page .drop-head .help { margin-top: 2px; }
.create-page .link-drop > .help,
.create-page .link-drop > .err { margin-top: 0; }
.create-page .link-drop > .help:empty { display: none; }
/* the folded Advanced part sits between hairlines; its error line stays outside it (never folded away) */
.create-page #create-form details.advanced { margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.create-page details.advanced[open] { padding-bottom: var(--s4); }
.create-page details.advanced label { margin-top: var(--s2); }
.create-page #uri-err:not(:empty) { margin-top: var(--s3); }

/* ------------------------------------------------------------ step 2: Review (step 3 keeps it on screen) */
.create-page .review-title { margin-bottom: var(--s4); font-size: var(--fs-h2); }
.create-page .review-title:focus,
.create-page #details-title:focus { outline: none; }
.create-page .review-title:focus-visible { border-radius: var(--r-sm); outline: 2px solid var(--accent-hover); outline-offset: 4px; }
.create-page .review-kv {
  grid-template-columns: minmax(88px, auto) minmax(0, 1fr);
  gap: var(--s2) var(--s5);
  margin: 0 0 var(--s4);
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card-2);
  font-size: 15px;
}
.create-page .review-kv dd { text-align: left; overflow-wrap: anywhere; }
.create-page .review-kv dd.mono { font-size: 14px; }
.create-page details.tech {
  margin: 0 0 var(--s5);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.create-page details.tech[open] { padding-bottom: var(--s4); }
.create-page .uri-preview {
  display: block;
  max-height: 160px;
  margin: var(--s2) 0 var(--s3);
  padding: var(--s3) 14px;
  overflow: auto;
  border-radius: var(--r);
  background: var(--card-2);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.create-page .uri-preview:empty { display: none; }
/* Before you create: a well inside the form card, Dig's head beside its title */
.create-page .before-card {
  margin: 0 0 var(--s5);
  padding: var(--s5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card-2);
}
.create-page .before-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--s3);
}
.create-page .before-head img { flex: 0 0 48px; width: 48px; height: 48px; }
.create-page .before-head h3 { margin: 0; }
.create-page #before-values .checklist { margin-bottom: var(--s3); }
.create-page #before-values .checklist li { font-size: 15px; line-height: 1.5; }
.create-page .before-card .note { margin-bottom: 0; }
/* not configured: Review cannot open, so the card closes the Details step (create.js, Keystone K-L2) */
.create-page #step-details > .before-card { margin: var(--s5) 0 0; }
.create-page #f-dup:empty,
.create-page #uri-err-copy:empty { display: none; }
.create-page #f-dup .alert { margin: 0 0 var(--s4); }
.create-page .step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-top: var(--s5);
}
/* Back, then Create coin (§5.3). The two flex sizes only from 600 px, where the actions are a row: in the phones'
   column a basis is a height (an id rule beat the phone rule, so Create coin was 240 px tall and Back 120 px) */
@media (min-width: 600px) {
  .create-page #create-btn { flex: 2 1 240px; }
  .create-page #create-back { flex: 1 1 120px; }
}
@media (max-width: 599px) {
  /* stacked, Create coin first (§5.3): the markup keeps Back first, so the keyboard meets Back, then Create coin */
  .create-page .step-actions { flex-direction: column-reverse; }
  .create-page .step-actions .btn { flex: none; width: 100%; }
  .create-page .review-kv {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .create-page .review-kv dd + dt { margin-top: var(--s2); }
  .create-page .before-card { padding: var(--s4); }
}
/* an earlier Launch's line belongs to Review: not under the Details fields */
.create-page #create-form[data-step='1'] > #create-status {
  display: none;
}

/* ------------------------------------------------------------ created: the success card replaces the panels */
.create-page #create-form[data-step='4'] {
  display: flex;
  flex-direction: column;
  padding-block: var(--s8);
}
.create-page #create-form[data-step='4'] > #prefill-note { display: none; }
.create-page #create-done:not([hidden]) {
  display: grid;
  justify-items: center;
  gap: var(--s4);
  text-align: center;
}
/* Dig, 160 px; the base fades every edge into the card (site.css img.art-fade, DESIGN §6.3) */
.create-page .done-art {
  display: block;
  width: 160px;
  height: auto;
}
.create-page #create-done .alert {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-size: 18px;
  line-height: 1.5;
}
.create-page #create-done .alert::before { display: none; }
.create-page #create-done .alert:focus { outline: none; }
.create-page #create-form[data-step='4'] > #create-status {
  order: 2;
  justify-content: center;
  margin-top: var(--s4);
}

/* ------------------------------------------------------------ the aside: Launch settings, Continue, live preview */
.create-page .settings-card h2 {
  margin: 0 0 var(--s4);
  padding-bottom: var(--s4);
  border-bottom: 1px solid var(--line);
  font-size: 18px;
}
.create-page .set-list {
  display: grid;
  gap: var(--s4);
  margin: 0;
  padding: 0;
  list-style: none;
}
/* each line icon in a filled round well (the mock): dark green, the Root vault's a gold disc with a dark glyph
   (--on-accent on --gold, 10.02:1). Forced colours keep the earlier look: a ring, the glyph CanvasText (own block) */
.create-page .set-list .icon-row {
  position: relative;
  isolation: isolate;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  min-height: 36px;
  column-gap: var(--s3);
}
.create-page .set-list .icon-row::before {
  position: relative;
  z-index: 1;
  grid-row: auto;
  width: 18px;
  height: 18px;
  margin: 0 9px;
  -webkit-mask-size: 18px 18px;
  mask-size: 18px 18px;
}
.create-page .set-list .icon-row::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 36px;
  height: 36px;
  margin-top: -18px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: var(--accent-soft);
}
.create-page .set-list .i-gold::before { background: var(--on-accent); }
.create-page .set-list .i-gold::after { background: var(--gold) padding-box; box-shadow: inset 0 0 0 4px var(--amber-bg); }
.create-page .set-list .icon-title {
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 400;
  line-height: 1.45;
}
.create-page .btn-arrow {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url('/img/ui/arrow-right.svg') center / 18px 18px no-repeat;
  mask: url('/img/ui/arrow-right.svg') center / 18px 18px no-repeat;
}
/* the busy note while Continue waits for the image upload: the spinner beside its text, as in #upload-status */
.create-page #next-status { flex-wrap: nowrap; align-items: flex-start; margin-top: calc(-1 * var(--s2)); }
@media (min-width: 600px) {
  .create-page #next-status { margin-top: calc(-1 * var(--s4)); }
}

/* the live preview: the coin as a list item of the coins list (avatar, name, symbol, pill · vault · progress) */
.create-page .preview-card .kicker { margin-bottom: var(--s3); }
.create-page .coin-row.preview {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  grid-template-areas: 'img name raiz' 'prog prog prog';
  align-items: center;
  gap: var(--s3);
  margin: 0 0 var(--s3);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card-2);
  color: var(--text);
}
.create-page .coin-row.preview .img {
  grid-area: img;
  line-height: 0;
}
.create-page .coin-row.preview .name {
  grid-area: name;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.create-page .coin-row.preview .name strong {
  overflow: hidden;
  font-size: 15px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.create-page .coin-row.preview .sym {
  overflow: hidden;
  color: var(--muted);
  font: 400 13px / 1.4 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.create-page .coin-row.preview .blank { color: var(--soft); }
.create-page .coin-row.preview .tags {
  display: flex;
  margin-top: var(--s1);
}
.create-page .coin-row.preview .raiz {
  grid-area: raiz;
  align-self: start;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  text-align: right;
  white-space: nowrap;
}
.create-page .coin-row.preview .raiz .num {
  color: var(--text);
  font-size: 15px;
}
.create-page .coin-row.preview .prog {
  grid-area: prog;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.create-page .preview-card .note { margin: 0; }

/* ------------------------------------------------------------ forced colours: the page's own lines and icons */
@media (forced-colors: active) {
  /* fills and masks forced colours would paint in the background colour (the stepper's dots are the base's) */
  .create-page ol.stepper > li:not(:last-child)::after,
  .create-page .or-line::before, .create-page .or-line::after,
  .create-page .drop-icon::before,
  .create-page .set-list .i-gold::before { forced-color-adjust: none; background-color: CanvasText; }
  .create-page .btn-arrow { forced-color-adjust: none; background-color: ButtonText; }
}
