/* Sign-in on mudita.page: blurred private bubbles, the floating sign-in card, the corner links.
   Works with signin.js; the homepage's own styles are in index.html. */

/* ---- Private bubbles --------------------------------------------------------------------------- */
/* Registered so the size can glide: a bubble swells to full size as it opens. */
@property --size { syntax: '<length>'; inherits: true; initial-value: 100px; }
.bubble { transition: opacity .45s ease-out, --size 1.4s cubic-bezier(.3, .7, .2, 1); }
.bubble.is-locked, .bubble--sm.is-locked { --size: 84px; }
.bubble.is-locked .bubble-label { font-size: 12.5px; }
/* The name is nonsense of about the right length, softly out of focus, never the real one. */
.si-txt { display: inline-block; filter: blur(1.8px); }
/* A small padlock over the blurred name: private, not broken. */
.si-lock { display: block; line-height: 0; margin: 0 auto 3px; opacity: .85; }
.si-lock svg { display: inline-block; }
.bubble.si-wobble .bubble-label { animation: si-wobble .5s ease-in-out; }
@keyframes si-wobble {
  20% { transform: translateX(-3px); } 40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); } 80% { transform: translateX(1px); }
}
@media (min-width: 481px) and (max-width: 1100px) and (orientation: portrait) {
  .bubble.is-locked, .bubble--sm.is-locked { --size: 80px; }
}
@media (max-width: 480px) {
  .bubble.is-locked, .bubble--sm.is-locked { --size: 70px; }
  .bubble.is-locked .bubble-label { font-size: 11.5px; }
}
@media (max-width: 480px) and (max-height: 760px), (max-height: 500px) and (orientation: landscape) {
  .bubble.is-locked, .bubble--sm.is-locked { --size: 64px; }
}

/* ---- The card ---------------------------------------------------------------------------------- */
.si-veil {
  position: fixed; inset: 0; z-index: 6;
  background: rgba(20, 14, 24, .18);
  opacity: 0; transition: opacity .45s ease;
  pointer-events: none;
}
.si-veil.is-on { opacity: 1; pointer-events: auto; }

/* It floats like a bubble: the script places it (transform), and it can be carried and flung. */
.si-card {
  position: fixed; z-index: 7; left: 0; top: 0;
  will-change: transform; touch-action: none; cursor: grab;
  width: min(340px, calc(100vw - 32px)); box-sizing: border-box;
  padding: 30px 26px 22px; border-radius: 26px;
  color: rgba(255, 248, 240, .96);
  background: linear-gradient(160deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .03)), rgba(28, 22, 38, .38);
  border: 1px solid rgba(255, 255, 255, .26);
  text-shadow: 0 1px 12px rgba(20, 12, 28, .25);
  box-shadow: 0 30px 80px rgba(20, 10, 30, .35), inset 0 1px 0 rgba(255, 255, 255, .35);
  backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3);
  text-align: center; font-family: var(--face-text);
  opacity: 0; pointer-events: none;
  user-select: none; -webkit-user-select: none;
}
.si-card.is-on { pointer-events: auto; }
.si-card.is-held { cursor: grabbing; }
.si-card button, .si-card a { cursor: pointer; }
.si-card input, .si-card textarea { cursor: text; user-select: text; -webkit-user-select: text; }
.si-card h2 { margin: 0 0 10px; padding: 0 22px; font-family: var(--face-name); font-size: 22px; font-weight: 500; line-height: 1.2; letter-spacing: .01em; }
.si-notes { display: inline-block; width: .74em; height: .82em; margin-left: .12em; vertical-align: -.06em; }
.si-card p { margin: 0 auto 20px; max-width: 270px; font-size: 14px; line-height: 1.5; color: rgba(255, 248, 240, .86); }
.si-actions { display: flex; flex-direction: column; gap: 10px; }
.si-close {
  position: absolute; right: 12px; top: 10px; width: 32px; height: 32px;
  border: 0; background: none; color: rgba(255, 248, 240, .6); font-size: 20px; border-radius: 50%;
}
.si-close:hover { color: #fff; }

.si-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 46px; border-radius: 23px; border: 0;
  font: 700 15px/1 var(--face-text); letter-spacing: .01em;
  transition: transform .15s ease, background .2s ease;
}
.si-btn:active { transform: scale(.98); }
.si-btn:disabled { opacity: .6; cursor: default; }
.si-btn--google { background: #fff; color: #2b2320; }
.si-btn--google svg { width: 18px; height: 18px; }
.si-btn--soft { background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .3); }
.si-link {
  display: inline-block; margin-top: 14px; padding: 6px;
  background: none; border: 0; color: rgba(255, 248, 240, .7);
  font: 400 13.5px/1 var(--face-text);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 248, 240, .3);
}
.si-link:hover { color: #fff; }
.si-fine { margin-top: 16px; font-size: 12px; line-height: 1.45; color: rgba(255, 248, 240, .66); }
.si-fine + .si-fine { margin-top: 8px; }
.si-error { min-height: 1.4em; margin: -6px 0 10px; font-size: 12.5px; color: #ffd9c9; }

.si-input {
  width: 100%; box-sizing: border-box; padding: 12px 18px; margin-bottom: 12px;
  border-radius: 18px; border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .12); color: #fff;
  font: 400 14px/1.4 var(--face-text); outline: none; resize: none;
}
.si-input::placeholder { color: rgba(255, 248, 240, .5); }
.si-input:focus { border-color: rgba(255, 255, 255, .7); background: rgba(255, 255, 255, .18); }

.si-code { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; }
.si-code input {
  flex: 1 1 0; min-width: 0; max-width: 42px; height: 50px; padding: 0; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .12); color: #fff; text-align: center;
  font: 500 22px/1 var(--face-name); outline: none;
}
.si-code input:focus { border-color: rgba(255, 255, 255, .8); background: rgba(255, 255, 255, .2); }
.si-code.is-wrong { animation: si-wobble .45s ease-in-out; }

/* The page someone came for, as their link's preview showed it. */
.si-card.has-shot { padding-top: 46px; }
.si-shot {
  display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover;
  margin: 0 0 18px; border-radius: 14px; box-shadow: 0 8px 22px rgba(10, 6, 14, .28);
}
.si-card form { margin: 0; }
.si-card form .si-btn { margin-top: 2px; }
/* The link to take out of a chat app's browser. */
.si-copy { display: flex; gap: 8px; margin-top: 16px; }
.si-copy input {
  flex: 1; min-width: 0; box-sizing: border-box; height: 40px; padding: 0 12px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .1); color: rgba(255, 248, 240, .85);
  font: 400 12.5px/1 var(--face-text); outline: none; user-select: text; -webkit-user-select: text;
}
.si-copy button {
  flex: none; height: 40px; padding: 0 14px; border-radius: 12px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .16); color: #fff; font: 700 13px/1 var(--face-text);
}
.si-copy + .si-fine { margin-top: 8px; }
.si-tel { display: block; margin-top: 16px; font-size: 11px; color: rgba(255, 248, 240, .55); letter-spacing: .05em; text-decoration: none; }
.si-tel:hover { color: #fff; }

/* ---- Corner: sign in or out, privacy ----------------------------------------------------------- */
/* The corner: a small, half-clear cookie in the very bottom-left corner; tapped, a little menu
   opens above it (who you are, sign in or out, privacy). */
.si-corner {
  position: fixed; z-index: 3;
  left: max(6px, env(safe-area-inset-left)); bottom: max(6px, env(safe-area-inset-bottom));
  font-family: var(--face-text); font-size: 13px;
}
.si-cookie {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  background: none; border: 0; border-radius: 50%; cursor: pointer;
  opacity: .42; transition: opacity .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.si-cookie svg { filter: drop-shadow(0 1px 3px rgba(20, 12, 8, .55)); }
.si-cookie path, .si-cookie circle { fill: none; stroke: rgba(255, 246, 236, .95); stroke-width: 1.4; stroke-linejoin: round; }
.si-cookie circle { fill: rgba(255, 246, 236, .95); stroke: none; }
.si-cookie:hover, .si-cookie:focus-visible, .si-corner.is-open .si-cookie { opacity: .95; }
.si-cookie:focus-visible { outline: 1px solid rgba(255, 244, 232, .75); outline-offset: 1px; }
.si-menu, .si-panel {
  position: absolute; left: 6px; bottom: 44px;
  border-radius: 14px; color: rgba(255, 248, 240, .9);
  background: rgba(30, 22, 32, .62); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 32px rgba(10, 6, 14, .28);
  opacity: 0; transform: translateY(6px); pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.si-menu { display: flex; flex-direction: column; align-items: stretch; min-width: 184px; padding: 8px; }
.si-corner.is-open:not(.is-panel) .si-menu, .si-corner.is-panel .si-panel { opacity: 1; transform: none; pointer-events: auto; }
.si-menu button {
  background: none; border: 0; border-radius: 9px; padding: 9px 10px;
  font: inherit; text-align: left; color: rgba(255, 248, 240, .9); cursor: pointer;
}
.si-menu button:hover, .si-menu button:focus-visible { background: rgba(255, 255, 255, .1); color: #fff; outline: none; }
.si-menu .si-who {
  padding: 6px 10px 10px; margin-bottom: 4px; font-size: 12px; color: rgba(255, 248, 240, .55);
  border-bottom: 1px solid rgba(255, 248, 240, .14); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px;
}
/* A panel opens in the menu's place: how this works, or privacy. On a phone it spans the width,
   12px in from each edge, and scrolls if the screen is short. */
.si-panel {
  width: min(340px, calc(100vw - 24px)); box-sizing: border-box;
  max-height: min(66vh, 560px); overflow-y: auto; overscroll-behavior: contain;
  padding: 18px 20px 16px; font-size: 13px; line-height: 1.5;
}
.si-panel h3 { margin: 0 32px 10px 0; font-family: var(--face-name); font-size: 16px; font-weight: 500; color: #fff; }
.si-panel p { margin: 0 0 10px; }
.si-panel p:first-of-type { color: #fff; }
.si-panel ul { list-style: none; margin: 0 0 12px; padding: 0; }
.si-panel li { margin: 0 0 10px; }
.si-panel li strong { display: block; margin-bottom: 1px; font-family: var(--face-name); font-weight: 500; color: #fff; }
.si-panel .si-note { margin: 0; color: rgba(255, 248, 240, .66); }
.si-panel a { color: inherit; text-underline-offset: 3px; text-decoration-color: rgba(255, 248, 240, .4); }
.si-panel-x {
  position: absolute; right: 8px; top: 8px; width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: none; color: rgba(255, 248, 240, .6); font-size: 20px; line-height: 1; cursor: pointer;
}
.si-panel-x:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.si-corner.is-open { z-index: 5; } /* open, above the page's own corner text */
.leaving .si-corner { opacity: 0; transition: opacity .25s ease-out; }


