/* A new password field, alone on white. Elements moved by GSAP (the bars' fill, the word, the ticks, the eye, the
   button face) never get a transform from the CSS: colours and edges live on classes. */
:root {
  --page: #ffffff;          /* the page */
  --ink: #16161b;           /* the text and the label */
  --muted: #8e8d97;         /* the note, the rules not yet met */
  --line: #e2e1e7;          /* the box edge at rest */
  --line-hover: #c8c7d0;    /* the box edge under the pointer */
  --track: #eeedf2;         /* the empty bars */
  --weak: #e2483d;          /* one bar */
  --fair: #e8930c;          /* two bars */
  --good: #8fb81c;          /* three bars */
  --strong: #18a35b;        /* four bars, the ticks */
  --button: #16161b;        /* Continue */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.pw {
  width: min(360px, calc(100vw - 32px));
  display: grid;
}

.pw__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 2px 9px;
}
.pw__label { font-size: 13.5px; font-weight: 600; letter-spacing: -0.005em; }
.pw__note { font-size: 12.5px; color: var(--muted); }

/* ---- the box ---- */
.box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 6px 0 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 1px 2px rgba(22, 22, 27, 0.04), 0 8px 22px -14px rgba(22, 22, 27, 0.22);
  transition: border-color 0.25s ease, box-shadow 0.3s ease;
}
@media (hover: hover) {
  .box:hover { border-color: var(--line-hover); }
}
.box.is-focus {
  border-color: #b9b8c2;
  box-shadow: 0 0 0 4px rgba(22, 22, 27, 0.06), 0 8px 22px -14px rgba(22, 22, 27, 0.25);
}
.box.is-strong.is-focus { border-color: color-mix(in srgb, var(--strong) 55%, white); box-shadow: 0 0 0 4px color-mix(in srgb, var(--strong) 14%, transparent), 0 8px 22px -14px rgba(22, 22, 27, 0.25); }

.box__lock { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; transition: stroke 0.3s ease; }
.box.is-strong .box__lock { stroke: var(--strong); }

.box__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 16px;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.box__input[type="password"] { letter-spacing: 0.16em; }
.box__input::placeholder { color: #b3b2bb; letter-spacing: 0; }

.eye {
  appearance: none;
  border: 0;
  background: transparent;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.2s ease, color 0.2s ease;
}
@media (hover: hover) {
  .eye:hover { background: #f4f3f7; color: var(--ink); }
}
.eye:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.eye__pupil { fill: currentColor; stroke: none; }

/* ---- the meter ---- */
.meter {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 2px 0;
}
.meter__bars { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.bar {
  position: relative;
  height: 5px;
  border-radius: 99px;
  background: var(--track);
  overflow: hidden;
}
.bar i {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--weak);
  transform-origin: 0 50%;
}
.meter__word {
  position: relative;
  width: 52px;
  height: 16px;
  overflow: hidden;
  text-align: right;
}
.word {
  position: absolute;
  right: 0;
  top: 0;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
}

/* ---- the rules ---- */
.rules {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 12px;
  padding: 16px 2px 0;
}
.rule {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--muted);
  transition: color 0.3s ease;
}
.rule.is-met { color: var(--ink); }
.rule svg { width: 16px; height: 16px; flex: none; overflow: visible; }
.rule circle { fill: transparent; stroke: #d6d5dd; stroke-width: 1.2; transition: fill 0.3s ease, stroke 0.3s ease; }
.rule.is-met circle { fill: var(--strong); stroke: var(--strong); }
.rule path { fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 9; stroke-dashoffset: 9; }

/* ---- Continue ---- */
.go {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  margin-top: 22px;
  height: 46px;
  cursor: pointer;
  border-radius: 13px;
}
.go:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.go:disabled { cursor: default; }
.go__face {
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
  border-radius: 13px;
  background: var(--button);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset, 0 10px 20px -12px rgba(22, 22, 27, 0.6);
  transition: background 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
}
.go:disabled .go__face { background: #f0eff4; color: #aeadb7; box-shadow: none; }
.go.is-done .go__face { background: var(--strong); box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--strong) 80%, black); }
.go__label, .go__done { grid-area: 1 / 1; display: flex; align-items: center; gap: 7px; }
.go__done { opacity: 0; }
.go__done svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.go__done path { stroke-dasharray: 14; stroke-dashoffset: 14; }
.go__sweep {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  opacity: 0;
}

/* the drawn pointer of the autopilot */
.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #16161b;
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  opacity: 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
  z-index: 5;
}

@media (max-height: 420px) {
  .rules { padding-top: 12px; gap: 7px 10px; }
  .go { margin-top: 16px; }
}
