/* The connect calendar button of Slotwise, a made-up booking app: one small card alone on white, a single blue accent. */
:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --bordo: #ebeae7;
  --tinta: #f4f4f2;          /* the sheet and the calendar circle */
  --testo: #15161a;
  --testo-2: #5d6068;
  --testo-3: #9b9ea6;
  --accento: #2f5ff0;        /* the single accent: the pill, the wire, the ticks */
  --accento-chiaro: #e9efff;
  --nostro: #15161a;         /* the Slotwise circle */
  --ombra: 22, 26, 38;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { font-size: clamp(9px, min(4.2vw, 3.05vh), 19px); }
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 */
.card {
  position: relative;
  width: min(19em, 92vw);
  padding: 1.2em 1.15em 1em;
  border-radius: 1.4em;
  background: var(--carta);
  box-shadow:
    0 1px 1px rgba(var(--ombra), .05),
    0 6px 14px -6px rgba(var(--ombra), .10),
    0 26px 50px -26px rgba(var(--ombra), .26);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .95em;
  isolation: isolate;
}
.card__edge {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3;
  padding: 1px;
  background: linear-gradient(180deg, #f1f1ef, var(--bordo) 30%, #e1e2e0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* the two apps and the wire between them */
.link { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; padding: .1em .2em; }
.app { width: 3.1em; height: 3.1em; display: block; position: relative; z-index: 1; }
.app svg { width: 100%; height: 100%; display: block; overflow: visible; }
.app--ours { filter: drop-shadow(0 4px 8px rgba(var(--ombra), .18)); }
.ours__bg { fill: var(--nostro); }
.ours__mark { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; }
.ours__dot { fill: var(--accento); stroke: var(--nostro); stroke-width: 1.6; }
.app--cal { filter: drop-shadow(0 4px 8px rgba(var(--ombra), .10)); }
.cal__bg { fill: #fff; stroke: var(--bordo); }
.cal__page { fill: #fff; stroke: #cfd1d6; stroke-width: 1.1; }
.cal__band { fill: #e0533c; }
.cal__ring { stroke: #8a8d95; stroke-width: 1.5; stroke-linecap: round; }
.cal__day { font: 680 8.2px "Mona Sans Variable", system-ui, sans-serif; fill: var(--testo); }

.wire { position: relative; height: 1.6em; margin: 0 -.15em; display: grid; place-items: center; }
.wire__track { position: absolute; left: 0; right: 0; top: 50%; height: .5em; margin-top: -.25em; }
.wire__track svg { width: 100%; height: 100%; display: block; overflow: visible; }
.wire__dash { fill: none; stroke: #c9cbd1; stroke-width: 1.4; stroke-dasharray: 2.6 3.4; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.wire__line { fill: none; stroke: var(--accento); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.wire__knot {
  position: relative; width: 1.6em; height: 1.6em; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; color: var(--testo-3);
  box-shadow: 0 0 0 1px var(--bordo), 0 2px 5px -2px rgba(var(--ombra), .2);
  transition: color .35s ease, box-shadow .35s ease;
}
.wire__knot svg { width: .95em; height: .95em; display: block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.card.is-on .wire__knot { color: var(--accento); box-shadow: 0 0 0 1px #c9d6ff, 0 2px 5px -2px rgba(47, 95, 240, .35); }

/* title */
.head { display: grid; gap: .14em; text-align: center; }
.brand { font-size: .68em; color: var(--testo-3); font-weight: 600; letter-spacing: .02em; }
.name { font-size: 1.12em; font-weight: 650; letter-spacing: -.015em; line-height: 1.15; }
.meta { position: relative; height: 1.4em; font-size: .74em; color: var(--testo-2); }
.meta__face { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .35em; white-space: nowrap; }
.meta__face[data-m="on"] { opacity: 0; color: var(--accento); font-weight: 560; }
.meta .ico { width: 1.05em; height: 1.05em; }

/* the permission sheet */
.sheet { height: 0; overflow: hidden; margin-top: -.95em; }
.sheet__in { margin-top: .95em; padding: .7em .8em .75em; border-radius: .95em; background: var(--tinta); box-shadow: inset 0 0 0 1px rgba(var(--ombra), .05); }
.ask { font-size: .68em; color: var(--testo-3); font-weight: 600; margin-bottom: .45em; }
.perms { list-style: none; display: grid; gap: .42em; }
.perm { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .55em; font-size: .78em; }
.box {
  width: 1.25em; height: 1.25em; border-radius: .38em; display: grid; place-items: center;
  background: #fff; box-shadow: inset 0 0 0 1.2px #c6c9cf;
}
.box svg { width: .95em; height: .95em; display: block; fill: none; stroke: #fff; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.box path { stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.perm__txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 520; }
.perm__tag { font-size: .82em; color: var(--testo-3); }

/* the pill */
.row { display: grid; justify-items: center; }
.pill {
  position: relative; height: 3em; width: 100%;
  color: #fff; font-size: .9em; font-weight: 620;
  border-radius: 99em;
  touch-action: manipulation;
}
.pill__bg {
  position: absolute; inset: 0; border-radius: inherit; background: var(--accento);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 8px 18px -10px rgba(47, 95, 240, .9);
  transition: transform .5s cubic-bezier(.34, 1.56, .64, 1), background-color .35s ease, box-shadow .35s ease;
}
.pill__bg::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(255, 255, 255, .15), transparent 55%); }
.pill.is-done .pill__bg { background: var(--testo); box-shadow: 0 1px 0 rgba(255, 255, 255, .14) inset, 0 8px 18px -10px rgba(21, 22, 26, .7); }
.pill__face { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .5em; white-space: nowrap; pointer-events: none; }
.pill__face[data-face="allow"], .pill__face[data-face="wait"], .pill__face[data-face="done"] { opacity: 0; }
.pill__txt { display: inline-block; font-stretch: 100%; transition: font-stretch .45s cubic-bezier(.34, 1.56, .64, 1); }
@media (hover: hover) {
  .pill:hover .pill__txt { font-stretch: 112%; }
  .pill:hover .pill__bg { transform: scale(1.025, 1.08); }
}
.pill.is-hover .pill__txt { font-stretch: 112%; }
.pill.is-hover .pill__bg { transform: scale(1.025, 1.08); }
.pill.is-wait .pill__bg { transform: none; }
.pill:focus-visible { outline: 2px solid var(--accento); outline-offset: 3px; }

.ico { width: 1.1em; height: 1.1em; display: block; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ico--tick { stroke-width: 2.1; }
.ico--tick path { stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.ring { width: 1.3em; height: 1.3em; display: block; }
.ring__track { fill: none; stroke: rgba(255, 255, 255, .28); stroke-width: 2.2; }
.ring__arc { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: .28 .72; transform: rotate(-90deg); transform-origin: 10px 10px; }

/* disconnect */
.undo { justify-self: center; height: 1.7em; margin-top: -.45em; padding: 0 .6em; font-size: .74em; color: var(--testo-3); font-weight: 560; border-radius: .5em; opacity: 0; }
@media (hover: hover) { .undo:hover { color: var(--testo); } }
.undo:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .pill__bg, .pill__txt, .wire__knot { transition: none; }
}
