/* 🤖 Phrase sign-in (phrasecard.js): the "Make your phrase" card, the save
   step and the single phrase field — drawn to the signed-off mockups
   (docs/onboarding-flows/phrase). Tokens come from home.css; contrast holds
   in light and dark, every state has words and an icon beside its colour,
   and every control is at least 24px (WCAG 2.2 AA, docs/accessibility.md). */

.pc { text-align: left; }
.pc-title { margin: 0 0 8px; font-family: var(--font-display); font-size: 21px; line-height: 1.25; }
h3.pc-title { font-size: 17px; }
.pc-title:focus { outline: none; }
.pc-title:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.pc-why, .pc-intro { margin: 0 0 10px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.pc-intro { margin-bottom: 14px; }

/* The boxes read like a sentence: words joined by dashes, wrapping freely. */
.pc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 0; margin: 0 0 12px; }
.pc-item { display: inline-flex; align-items: center; }
.pc-dash { color: var(--muted); padding: 0 4px; font-weight: 600; }
.pc-box {
  position: relative; display: inline-flex; align-items: center;
  border: 1.5px solid var(--border); border-radius: 10px; background: var(--panel);
  padding: 0 2px 0 0;
}
.pc-box:focus-within { border-color: var(--accent); }
/* Typed-over words are "yours": a dashed border AND a label — never colour alone. */
.pc-box.yours { border-style: dashed; border-color: var(--muted); }
.pc-word {
  border: none; background: transparent; color: var(--ink); font: inherit; font-size: 16px;
  padding: 8px 4px 8px 9px; min-height: 40px; min-width: 4ch; outline: none;
}
.pc-tag { display: none; position: absolute; top: -9px; left: 7px; padding: 0 4px;
  background: var(--panel); color: var(--muted); font-size: 11px; line-height: 16px; font-weight: 600; }
.pc-box.yours .pc-tag { display: block; }
.pc-new {
  display: inline-grid; place-items: center; width: 30px; height: 30px; min-width: 30px; padding: 0;
  border-radius: 8px; background: transparent; color: var(--muted); border: none; cursor: pointer;
}
.pc-new:hover { background: var(--quiet); color: var(--ink); }
.pc-new:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pc-add { display: inline-flex; align-items: center; gap: 6px; width: auto; padding: 8px 14px; font-size: 14px; }

.pc-meter { display: block; height: 6px; margin: 14px 0 6px; border-radius: 3px; background: var(--quiet); overflow: hidden; }
.pc-fill { display: block; height: 100%; width: 0; background: var(--danger); border-radius: 3px; transition: width .2s ease, background .2s ease; }
.pc-meter.ok .pc-fill { background: var(--ok); }
@media (prefers-reduced-motion: reduce) { .pc-fill { transition: none; } }
.pc .status { display: flex; gap: 6px; align-items: flex-start; margin-top: 4px; }
.pc .status.weak { color: var(--danger); }
.pc-ico { display: inline-flex; flex: none; margin-top: 2px; }
.pc-hint { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.pc-hint[hidden] { display: none; }
.pc-actions { margin-top: 16px; }

/* Save it */
.pc-warn { margin: 0 0 12px; font-size: 14px; line-height: 1.45; }
.pc-readout {
  margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--quiet);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 16px;
  line-height: 1.5; overflow-wrap: anywhere; user-select: all;
}
.pc-label { display: block; margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.pc-field-row { display: flex; gap: 8px; }
.pc-field-row input { flex: 1; min-width: 0; }
.pc-copy { flex: none; width: auto; padding: 0 16px; }
.pc-note { margin: 8px 0 12px; color: var(--muted); font-size: 13px; }
.pc-confirm { display: flex; gap: 10px; align-items: center; margin: 4px 0 0; font-weight: 600; cursor: pointer; min-height: 32px; }
.pc-confirm input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--accent); }

/* Done */
.pc-done { text-align: center; padding: 8px 0 0; }
.pc-tick { width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #fff; }
.pc-done-title { margin: 0 0 6px; font-weight: 700; font-size: 17px; }

/* The one phrase field (sign in / unlock / confirm). */
.pe { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.pe-row { display: flex; gap: 8px; }
.pe-field { flex: 1; min-width: 0; }
.pe-field[aria-invalid="true"] { border-color: var(--danger); outline: 1px solid var(--danger); }
.pe-reveal { flex: none; width: auto; padding: 0 14px; background: var(--quiet); color: var(--ink); }
.pe .status { display: flex; gap: 6px; align-items: flex-start; margin-top: 0; }
.pe button[type="submit"] { margin-top: 4px; }

/* A quiet inset that explains (E's notice, G's replace note). */
.note-card { margin: 12px 0; padding: 12px 14px; border-radius: 14px; background: var(--quiet); text-align: left; font-size: 14px; line-height: 1.45; }
.note-card p { margin: 0 0 10px; }
.note-card .actions { gap: 8px; }

/* Ways to unlock: three labelled groups. */
.wu-group { text-align: left; margin-top: 10px; }
.wu-group h3 { margin: 6px 0 2px; font-size: 13px; font-weight: 600; color: var(--muted); }
.wu-badge { display: inline-flex; gap: 4px; align-items: center; font-weight: 600; }
.wu-badge.opens { color: var(--ok); }
.wu-badge.signs { color: var(--muted); }
.wu-group > .actions { margin-top: 6px; }

/* Wherever the one entry form lands. The sealed card stretches its buttons
   full-width (#vault-sealed button) — the reveal toggle stays compact. */
.phrase-slot { margin-top: 10px; text-align: left; }
#phrase-door-main.phrase-slot { margin-top: 0; }
#vault-sealed .pe-reveal, .phrase-slot .pe-reveal { width: auto; flex: none; }
