/* The forgot password card of Northdesk, a made-up notes app: one card alone on white, a single cobalt accent. */
:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --bordo: #e7e8ee;
  --tinta: #f4f5f8;          /* the field at rest, the badge behind the lock */
  --testo: #111318;
  --testo-2: #5a5e6b;
  --testo-3: #9a9eab;
  --accento: #2b59ff;        /* the single accent: the button, the focus ring, the ticks */
  --accento-chiaro: #e9eeff;
  --errore: #c8442f;         /* only for the message that says what is missing */
  --ombra: 18, 22, 40;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { font-size: clamp(10px, min(3.7vw, 3.15vh), 17px); }
body {
  background: var(--fondo);
  color: var(--testo);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.stage { height: 100vh; display: grid; place-items: center; padding: 2vh 4vw; }

/* the card: a body, a 1px edge that catches light at the top, three soft shadows */
.card {
  position: relative;
  width: min(22em, 92vw);
  padding: 1.3em 1.4em 1.15em;
  border-radius: 1.5em;
  background: var(--carta);
  box-shadow:
    0 1px 1px rgba(var(--ombra), .05),
    0 6px 14px -6px rgba(var(--ombra), .10),
    0 24px 48px -24px rgba(var(--ombra), .22);
  isolation: isolate;
  overflow: clip;
}
.card__edge {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
  padding: 1px;
  background: linear-gradient(180deg, rgba(43, 89, 255, .28), var(--bordo) 22%, var(--bordo) 80%, #dfe1e8);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.card__glow {
  position: absolute; top: 0; left: 0; width: 38%; height: 1px; z-index: 3; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(43, 89, 255, .9), transparent);
  opacity: 0;
}

/* the app */
.brand { display: flex; align-items: center; gap: .45em; margin-bottom: 1.05em; }
.brand__mark { width: 1.55em; height: 1.55em; border-radius: .5em; background: var(--testo); display: grid; place-items: center; }
.brand__mark svg { width: 1em; height: 1em; display: block; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brand__name { font-size: .8em; font-weight: 640; letter-spacing: -.005em; }

/* the two views share one place: the box takes the height of the one on show */
.views { position: relative; }
.view { display: grid; justify-items: start; }
.view--sent { position: absolute; left: 0; right: 0; top: 0; justify-items: center; text-align: center; visibility: hidden; }

.badge { width: 2.6em; height: 2.6em; border-radius: .85em; background: var(--tinta); display: grid; place-items: center; margin-bottom: .9em;
  box-shadow: inset 0 0 0 1px rgba(var(--ombra), .05); }
.badge svg { width: 1.45em; height: 1.45em; display: block; fill: none; stroke: var(--testo); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.badge__hole { stroke: var(--accento); stroke-width: 1.9; }

.title { font-size: 1.32em; font-weight: 640; letter-spacing: -.025em; line-height: 1.15; font-stretch: 96%; }
.sub { font-size: .8em; color: var(--testo-2); line-height: 1.45; margin-top: .4em; max-width: 25em; }
.sub strong { color: var(--testo); font-weight: 620; }

.label { font-size: .72em; font-weight: 600; color: var(--testo-2); margin: 1.25em 0 .45em; }
.field {
  position: relative; width: 100%; height: 2.85em; border-radius: .85em;
  background: var(--tinta);
  box-shadow: inset 0 0 0 1px rgba(var(--ombra), .07);
  display: grid; grid-template-columns: 2.6em minmax(0, 1fr) 2.4em; align-items: center;
  transition: background-color .2s, box-shadow .2s;
}
.field__icon { width: 1.15em; height: 1.15em; justify-self: center; fill: none; stroke: var(--testo-3); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; transition: stroke .2s; }
.field__input {
  min-width: 0; height: 100%; border: 0; outline: none; background: none;
  font: inherit; font-size: .86em; font-weight: 520; color: var(--testo); letter-spacing: -.005em;
  caret-color: var(--accento);
}
.field__input::placeholder { color: var(--testo-3); font-weight: 450; }
.field.is-focus { background: #fff; box-shadow: inset 0 0 0 1px var(--accento), 0 0 0 4px var(--accento-chiaro); }
.field.is-focus .field__icon { stroke: var(--accento); }
.field.is-bad { background: #fff; box-shadow: inset 0 0 0 1px rgba(200, 68, 47, .55), 0 0 0 4px rgba(200, 68, 47, .09); }
.field.is-bad .field__icon { stroke: var(--errore); }
@media (hover: hover) { .field:not(.is-focus):not(.is-bad):hover { box-shadow: inset 0 0 0 1px rgba(var(--ombra), .16); } }
.field__ok { justify-self: center; width: 1.35em; height: 1.35em; border-radius: 50%; background: var(--accento); display: grid; place-items: center; opacity: 0; }
.field__ok svg, .mail__done svg { width: 72%; height: 72%; display: block; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.field__ok path, .mail__done path { stroke-dasharray: 1 1; stroke-dashoffset: 1; }

/* the message keeps its line even when empty: the card never jumps */
.msg { min-height: 1.35em; font-size: .72em; line-height: 1.35; color: var(--errore); font-weight: 540; margin-top: .45em; }

/* the button: two faces stacked in the same place, each centred on its own, so a hidden one never widens it */
.send {
  position: relative; width: 100%; height: 2.9em; margin-top: .55em; border-radius: .9em;
  background: var(--accento); color: #fff; font-size: .88em; font-weight: 620;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 6px 16px -8px rgba(43, 89, 255, .85);
  overflow: hidden;
}
.send::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(180deg, rgba(255, 255, 255, .16), transparent 55%); }
@media (hover: hover) { .send:hover { filter: brightness(1.07); } }
.send__face { position: absolute; inset: 0; display: grid; place-items: center; white-space: nowrap; }
.send__face--busy { opacity: 0; }
.send__group { display: inline-flex; align-items: center; gap: .5em; }
.ring { width: 1.15em; height: 1.15em; display: block; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; }
.ring circle { stroke-dasharray: .3 1; }

.back {
  display: inline-flex; align-items: center; gap: .3em; margin-top: 1em; justify-self: center;
  font-size: .78em; font-weight: 580; color: var(--testo-2); padding: .3em .55em; border-radius: .6em;
  transition: color .2s, background-color .2s;
}
.back svg { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
@media (hover: hover) { .back:hover { color: var(--testo); background: var(--tinta); } .back:hover svg { transform: translateX(-2px); } }
.back:active { transform: scale(.97); }
.send:focus-visible, .back:focus-visible, .again__link:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }

/* the envelope */
.mail { position: relative; width: 6.6em; height: 4.55em; margin: .2em 0 .85em; }
.env { width: 100%; height: 100%; display: block; overflow: visible; }
.env__back, .env__front, .env__flap, .letter { fill: #fff; stroke: var(--testo); stroke-width: 1.6; stroke-linejoin: round; }
.env__back { fill: var(--tinta); }
.letter { stroke: var(--testo-3); }
.letter__line { fill: none; stroke: var(--accento); stroke-width: 1.6; stroke-linecap: round; opacity: .7; }
.trail { fill: none; stroke: var(--accento); stroke-width: 1.6; stroke-linecap: round; opacity: 0; }
.mail__done {
  position: absolute; left: 81.25%; top: 93.9%; width: 1.5em; height: 1.5em; margin: -.75em 0 0 -.75em;
  border-radius: 50%; background: var(--accento); display: grid; place-items: center; opacity: 0;
  box-shadow: 0 0 0 3px #fff, 0 4px 10px -4px rgba(43, 89, 255, .7);
}

/* resend: the slot takes the width of the face on show */
.again { margin-top: 1.05em; font-size: .78em; line-height: 1.3em; color: var(--testo-2); display: inline-flex; align-items: center; gap: .3em; white-space: nowrap; }
.again__slot { position: relative; display: block; height: 1.3em; }
.again__wait, .again__link { position: absolute; left: 0; top: 0; white-space: nowrap; line-height: 1.3em; }
.again__wait { color: var(--testo-3); font-weight: 540; }
.again__link { font-size: 1em; font-weight: 640; color: var(--accento); opacity: 0; visibility: hidden; border-radius: .3em; transition: color .2s; }
@media (hover: hover) { .again__link:hover { color: #1a3fd6; } }
.again__link:active { transform: scale(.96); }
.clock { display: inline-flex; font-variant-numeric: tabular-nums; color: var(--testo-2); font-weight: 600; }
.clock .ch { display: inline-block; height: 1.3em; line-height: 1.3em; overflow: hidden; vertical-align: top;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 15%, #000 85%, transparent); mask-image: linear-gradient(180deg, transparent, #000 15%, #000 85%, transparent); }
.clock .col { display: block; }
.clock .col span { display: block; height: 1.3em; text-align: center; }
.clock .fix { display: inline-block; height: 1.3em; line-height: 1.3em; }

.view--sent .back { margin-top: .75em; }
