/* PrepBuddy shared: language tiles + picker sheet (tokens §7 "Language tile", i18n §1).
   Used by onboarding/01-language (inline grid) and auth/00-sign-in (globe → sheet). */

.lang-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 600px) { .lang-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.lang-tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-height: 76px; padding: 16px; border-radius: 20px;   /* 2026-10-27: the card's 16 dp */
  background: var(--surface); border: 2px solid transparent; color: var(--text-primary);
  text-align: start; cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
}
.lang-tile:active { transform: scale(0.98); }
.lang-tile.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--bg)); }
.lang-tile:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 40%, transparent); outline-offset: 2px; }

.lang-native { font-size: calc(20px * var(--font-scale)); font-weight: 700; line-height: 1.35; padding-inline-end: 28px; min-width: 0; overflow-wrap: anywhere; }   /* a long native name breaks instead of leaving the tile at 1.43 text scale */
.lang-en { font-size: calc(12px * var(--font-scale)); font-weight: 500; color: var(--text-secondary); }

.lang-beta {
  position: absolute; bottom: 12px; inset-inline-end: 12px;
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  padding: 2px 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--text-secondary) 14%, transparent); color: var(--text-secondary);
}

.lang-check {
  position: absolute; top: 12px; inset-inline-end: 12px; width: 24px; height: 24px; border-radius: 999px;
  background: var(--primary); color: var(--on-primary); display: none; align-items: center; justify-content: center;
}
.lang-tile.on .lang-check { display: inline-flex; animation: lang-pop 300ms cubic-bezier(.34, 1.56, .64, 1); }
.lang-check svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
@keyframes lang-pop { from { transform: scale(.4); } to { transform: scale(1); } }

/* ---------- sheet (sign-in globe) ---------- */
.lang-backdrop { position: fixed; inset: 0; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity 150ms ease; z-index: 50; }
.lang-backdrop.open { opacity: 1; pointer-events: auto; }
.lang-sheet {
  position: fixed; inset-inline: 0; bottom: 0; margin: 0 auto; width: 100%; max-width: 480px; max-height: 85vh; overflow: auto;
  background: var(--bg); border-radius: 20px 20px 0 0; padding: 12px 16px 16px;
  transform: translateY(100%); transition: transform 300ms cubic-bezier(.16, 1, .3, 1); z-index: 51;
}
.lang-sheet.open { transform: translateY(0); }
.lang-handle { width: 36px; height: 4px; border-radius: 999px; background: var(--border); margin: 0 auto 12px; }
.lang-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.lang-head h2 { margin: 0; font-size: calc(18px * var(--font-scale)); font-weight: 700; line-height: 1.3; }
.lang-head .icon-btn svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }
.lang-foot { margin: 14px 0 0; font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); line-height: 1.5; }
@media (min-width: 600px) {
  .lang-sheet { bottom: auto; top: 50%; border-radius: 20px; transform: translateY(-40%); opacity: 0; pointer-events: none; transition: transform 300ms cubic-bezier(.16, 1, .3, 1), opacity 150ms ease; }
  .lang-sheet.open { transform: translateY(-50%); opacity: 1; pointer-events: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .lang-tile, .lang-sheet, .lang-backdrop { transition: none; }
  .lang-tile.on .lang-check { animation: none; }
}
