/* The language suggestion (assets/lang-hint.js): a small card at the bottom
   corner, on the account menu's surface (assets/account.css), with an ink
   key to switch and quiet controls to turn it down, from the material
   tokens in assets/material.css. It rises in softly and sinks out quicker. */

.vdt-lang-hint {
  position: fixed;
  inset-inline-end: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 55;
  box-sizing: border-box;
  width: min(340px, calc(100vw - 32px));
  padding: 14px 40px 14px 16px;
  padding-inline: 16px 40px;
  border-radius: 16px;
  --lumno-corner-shape: squircle;
  background: var(--vdt-surface);
  box-shadow: var(--vdt-lift);
  color: var(--vdt-ink);
  font-size: 14px;
  line-height: 1.45;
  animation: vdt-lang-hint-in 360ms var(--vdt-ease) both;
}

.vdt-lang-hint[data-leaving] { animation: vdt-lang-hint-out 200ms ease-in both; }

.vdt-lang-hint-text { margin: 0 0 12px; }

.vdt-lang-hint-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.vdt-lang-hint-go,
.vdt-lang-hint-stay {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

/* Switching is the one action here: an ink key. */
.vdt-lang-hint-go {
  border: 1px solid var(--ink-key-rim);
  background: var(--ink-key-sheen) var(--ink-key-bg);
  box-shadow: var(--ink-key-lift);
  color: var(--ink-key-text);
  text-shadow: var(--ink-key-label);
  font-weight: 600;
  transition: var(--key-motion);
}

.vdt-lang-hint-go:hover { background-color: var(--ink-key-bg-hover); box-shadow: var(--ink-key-lift-hover); }

.vdt-lang-hint-go:active {
  background-image: var(--ink-key-sheen-down);
  background-color: var(--ink-key-bg-down);
  box-shadow: var(--ink-key-press);
}

/* Turning it down and closing: quiet controls, no face at rest. */
.vdt-lang-hint-stay,
.vdt-lang-hint-close {
  border: 0;
  background: none;
  color: var(--vdt-soft);
  transition: background-color 160ms ease, color 160ms ease;
}

.vdt-lang-hint-stay:hover,
.vdt-lang-hint-close:hover { background-color: var(--quiet-hover); color: var(--vdt-ink); }

.vdt-lang-hint-stay:active,
.vdt-lang-hint-close:active { background-color: var(--quiet-down-bg); box-shadow: var(--quiet-down); }

.vdt-lang-hint-close {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  --lumno-corner-shape: round;
  cursor: pointer;
}

.vdt-lang-hint :focus-visible { outline: 2px solid var(--vdt-ink); outline-offset: 2px; }

@keyframes vdt-lang-hint-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); filter: blur(3px); }
}

@keyframes vdt-lang-hint-out {
  to { opacity: 0; transform: translateY(8px) scale(0.98); }
}

/* Phones: across the bottom of the screen. */
@media (max-width: 560px) {
  .vdt-lang-hint {
    inset-inline: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vdt-lang-hint { animation-name: vdt-lang-hint-fade-in; }
  .vdt-lang-hint[data-leaving] { animation-name: vdt-lang-hint-fade-out; }
  .vdt-lang-hint-go,
  .vdt-lang-hint-stay,
  .vdt-lang-hint-close { transition: none; }
}

@keyframes vdt-lang-hint-fade-in { from { opacity: 0; } }
@keyframes vdt-lang-hint-fade-out { to { opacity: 0; } }
