/* tejas.decodes · account button, menu and sign-in dialog.
   Uses the site tokens from styles.css (--c-*, --serif, --sans). Classes start with acct-. */

.acct { position: relative; display: flex; align-items: center; gap: 8px; }
/* My study: the way into /study/ from every page, next to the avatar */
.acct-study {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px 0 12px;
  border-radius: 999px; border: 1px solid rgb(var(--c-ink)); background: rgb(var(--c-ink)); color: rgb(var(--c-bg));
  font: 600 .86rem var(--sans); text-decoration: none; white-space: nowrap;
  transition: transform .15s ease, opacity .2s ease;
}
.acct-study svg { width: 16px; height: 16px; flex: none; }
.acct-study:hover { opacity: .9; }
.acct-study:active { transform: scale(.97); }
.acct-study:focus-visible { outline: 2px solid rgb(var(--c-amber)); outline-offset: 2px; }
/* Phones: the button shrinks to an icon, and the bar tightens a little so all five
   buttons fit beside the wordmark. Only when My study is showing; signed out is unchanged. */
@media (max-width: 420px) {
  .acct-study { width: 36px; height: 36px; padding: 0; justify-content: center; }
  .acct-study span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .site-nav__inner:has(.acct-study) { padding-left: 16px; padding-right: 16px; }
  .nav-right:has(.acct-study) { gap: 6px; }
  .nav-right:has(.acct-study) .search-btn, .nav-right:has(.acct-study) .theme-btn, .acct:has(.acct-study) .acct-avatar { width: 36px; height: 36px; }
  .nav-right:has(.acct-study) .nav-toggle { width: 40px; height: 40px; }
}
@media (max-width: 374px) {
  .site-nav__inner:has(.acct-study) .wordmark { font-size: 1.26rem; }
  .nav-right:has(.acct-study) { gap: 4px; }
}
.acct-signin {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 12px;
  border-radius: 999px; border: 1px solid rgb(var(--c-line)); background: rgb(var(--c-surface));
  color: rgb(var(--c-ink)); font: 600 .86rem var(--sans); cursor: pointer;
  transition: border-color .2s ease, transform .15s ease;
}
.acct-signin svg { width: 16px; height: 16px; color: rgb(var(--c-amber)); }
.acct-signin:hover { border-color: rgb(var(--c-amber-line)); }
.acct-signin:active { transform: scale(.97); }
.acct-skel { display: block; width: 38px; height: 38px; border-radius: 50%; background: rgb(var(--c-line-2)); position: relative; overflow: hidden; }
.acct-skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgb(var(--c-surface) / .8), transparent); transform: translateX(-100%); animation: acct-shim 1.2s ease-in-out infinite; }
@keyframes acct-shim { to { transform: translateX(100%); } }
.acct-avatar {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgb(var(--c-line)); cursor: pointer;
  background: rgb(var(--c-amber-soft)); color: rgb(var(--c-amber)); font: 700 .82rem/1 var(--sans); letter-spacing: .02em;
  display: grid; place-items: center; transition: transform .15s ease, box-shadow .2s ease;
}
.acct-avatar.is-on { box-shadow: 0 0 0 2px rgb(var(--c-bg)), 0 0 0 3.5px rgb(var(--c-amber)); }
.acct-avatar:active { transform: scale(.94); }
.acct-avatar__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: acct-pulse 1s ease-in-out infinite alternate; }
@keyframes acct-pulse { from { opacity: .3; } to { opacity: 1; } }

.acct-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; width: min(300px, calc(100vw - 32px));
  background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-line)); border-radius: 16px;
  box-shadow: 0 1px 2px rgba(16,20,30,.05), 0 18px 40px -18px rgba(16,20,30,.28);
  padding: 8px; transform-origin: top right; animation: acct-pop .18s cubic-bezier(.22,.61,.36,1);
}
@keyframes acct-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.acct-menu__who { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; border-bottom: 1px solid rgb(var(--c-line-2)); }
.acct-menu__who b { font: 600 .98rem/1.3 var(--serif); color: rgb(var(--c-ink)); overflow-wrap: anywhere; }
.acct-menu__who span { font-size: .8rem; color: rgb(var(--c-ink-2)); overflow-wrap: anywhere; }
.acct-pill { align-self: flex-start; margin-top: 6px; font: 600 .7rem var(--sans); font-style: normal; letter-spacing: .02em; padding: 3px 9px; border-radius: 999px; color: rgb(var(--c-ink-2)); background: rgb(var(--c-line-2)); }
.acct-pill.ok { color: rgb(var(--c-green-ink)); background: rgb(var(--c-green-soft)); }
.acct-pill.wait { color: rgb(var(--c-amber)); background: rgb(var(--c-amber-soft)); }
.acct-menu__note { display: grid; grid-template-columns: 20px 1fr; gap: 4px 10px; padding: 12px; margin: 6px 0; border-radius: 12px; background: rgb(var(--c-amber-soft)); font-size: .82rem; color: rgb(var(--c-ink)); }
.acct-menu__note svg { width: 18px; height: 18px; color: rgb(var(--c-amber)); margin-top: 1px; }
.acct-menu__note p { margin: 0; line-height: 1.45; }
.acct-menu__row { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.acct-mini { height: 32px; padding: 0 12px; border-radius: 9px; border: 0; background: rgb(var(--c-ink)); color: rgb(var(--c-bg)); font: 600 .78rem var(--sans); cursor: pointer; }
/* The WhatsApp note for students: on Create account, and in the welcome after sign-up */
.acct-wa { display: grid; grid-template-columns: 20px 1fr; gap: 6px 10px; align-items: start; padding: 12px 14px; border-radius: 12px; background: rgb(var(--c-amber-soft)); color: rgb(var(--c-ink)); font-size: .84rem; line-height: 1.5; }
.acct-wa svg { width: 18px; height: 18px; color: rgb(var(--c-amber)); margin-top: 2px; }
.acct-wa p { margin: 0; }
.acct-wa b { font-weight: 600; }
.acct-mini.acct-mini--wa { grid-column: 2; justify-self: start; display: inline-flex; align-items: center; height: 34px; margin-top: 4px; text-decoration: none; }
.acct-mini--ghost { background: transparent; color: rgb(var(--c-ink)); border: 1px solid rgb(var(--c-amber-line)); }
.acct-menu__links { display: flex; flex-direction: column; padding-top: 4px; }
.acct-menu__links a, .acct-menu__links button {
  display: flex; align-items: center; min-height: 42px; padding: 0 12px; border-radius: 10px; border: 0; background: none;
  font: 500 .9rem var(--sans); color: rgb(var(--c-ink)); text-decoration: none; text-align: left; cursor: pointer;
}
.acct-menu__links a:hover, .acct-menu__links button:hover, .acct-menu__links a:focus-visible, .acct-menu__links button:focus-visible { background: rgb(var(--c-line-2)); }
.acct-menu__links button[data-acct="signout"] { color: rgb(var(--c-ink-2)); }

/* dialog */
html.acct-lock { overflow: hidden; }
.acct-dlg { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; width: 100%; height: 100%; margin: 0; }
.acct-dlg::backdrop { background: rgb(16 18 24 / .52); backdrop-filter: blur(2px); }
.acct-dlg[open] { display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.acct-dlg__box {
  position: relative; width: min(470px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  background: rgb(var(--c-surface)); color: rgb(var(--c-ink)); border: 1px solid rgb(var(--c-line)); border-radius: 22px;
  padding: 30px 30px 24px; box-shadow: 0 30px 70px -30px rgba(10,12,18,.55);
  animation: acct-in .24s cubic-bezier(.22,.61,.36,1);
}
@keyframes acct-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.acct-x { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; color: rgb(var(--c-ink-2)); cursor: pointer; display: grid; place-items: center; }
.acct-x svg { width: 18px; height: 18px; }
.acct-x:hover { background: rgb(var(--c-line-2)); color: rgb(var(--c-ink)); }
.acct-dlg__h { padding-right: 32px; margin-bottom: 18px; }
.acct-eb { margin: 0; font: 700 .7rem/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: rgb(var(--c-amber)); }
.acct-dlg__h h2 { margin: 8px 0 0; font: 600 1.85rem/1.1 var(--serif); letter-spacing: -.015em; text-wrap: balance; }
.acct-sub { margin: 8px 0 0; font-size: .9rem; line-height: 1.55; color: rgb(var(--c-ink-2)); }
.acct-google {
  width: 100%; height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 12px; border: 1px solid rgb(var(--c-line)); background: rgb(var(--c-surface)); color: rgb(var(--c-ink));
  font: 600 .92rem var(--sans); cursor: pointer; transition: border-color .2s ease, transform .15s ease;
}
.acct-google svg { width: 18px; height: 18px; }
.acct-google:hover { border-color: rgb(var(--c-ink-3)); }
.acct-google:active { transform: scale(.985); }
.acct-or { display: flex; align-items: center; gap: 12px; margin: 16px 0 6px; font-size: .76rem; color: rgb(var(--c-ink-3)); }
.acct-or::before, .acct-or::after { content: ""; flex: 1; border-top: 1px solid rgb(var(--c-line)); }
.acct-form { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.acct-f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.acct-f > span { font: 600 .82rem var(--sans); color: rgb(var(--c-ink)); }
.acct-f > span em { font-style: normal; font-weight: 500; color: rgb(var(--c-ink-3)); }
.acct-f input, .acct-f select {
  width: 100%; height: 46px; padding: 0 13px; border-radius: 11px; border: 1px solid rgb(var(--c-line)); background: rgb(var(--c-bg) / .5);
  color: rgb(var(--c-ink)); font: 400 .95rem var(--sans); transition: border-color .15s ease, box-shadow .15s ease;
}
.acct-f input:focus, .acct-f select:focus { outline: none; border-color: rgb(var(--c-accent)); box-shadow: 0 0 0 3px rgb(var(--c-accent) / .14); background: rgb(var(--c-surface)); }
.acct-f input[aria-invalid="true"] { border-color: rgb(var(--c-red-ink)); }
.acct-help { font-size: .76rem; color: rgb(var(--c-ink-2)); }
.acct-err { font-size: .78rem; color: rgb(var(--c-red-ink)); line-height: 1.4; }
.acct-err:empty { display: none; }
.acct-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.acct-who { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.acct-who legend { font: 600 .82rem var(--sans); padding: 0; margin-bottom: 6px; }
.acct-who__opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.acct-card {
  position: relative; display: flex; flex-direction: column; gap: 4px; padding: 13px 14px 14px; border-radius: 14px;
  border: 1px solid rgb(var(--c-line)); background: rgb(var(--c-surface)); cursor: pointer; transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}
.acct-card input { position: absolute; opacity: 0; pointer-events: none; }
.acct-card b { font: 600 .95rem var(--sans); }
.acct-card span { font-size: .76rem; line-height: 1.4; color: rgb(var(--c-ink-2)); }
.acct-card:active { transform: scale(.985); }
.acct-card:has(input:checked) { border-color: rgb(var(--c-amber)); background: rgb(var(--c-amber-soft)); box-shadow: inset 0 0 0 1px rgb(var(--c-amber)); }
.acct-card:has(input:focus-visible) { outline: 2px solid rgb(var(--c-accent)); outline-offset: 2px; }
.acct-check { display: flex; gap: 10px; align-items: flex-start; font-size: .8rem; line-height: 1.5; color: rgb(var(--c-ink-2)); cursor: pointer; }
.acct-check input { width: 18px; height: 18px; margin-top: 1px; flex: none; accent-color: rgb(var(--c-amber)); }
.acct-check a { color: rgb(var(--c-accent)); }
.acct-line { display: flex; justify-content: flex-end; margin-top: -6px; }
.acct-link { border: 0; background: none; padding: 0; font: 600 .82rem var(--sans); color: rgb(var(--c-accent)); cursor: pointer; text-decoration: underline; text-decoration-color: rgb(var(--c-amber-line)); text-underline-offset: 3px; }
.acct-go {
  height: 50px; border-radius: 13px; border: 0; background: rgb(var(--c-ink)); color: rgb(var(--c-bg)); font: 600 .95rem var(--sans);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; text-decoration: none; transition: transform .15s ease, box-shadow .2s ease;
}
.acct-go svg { width: 17px; height: 17px; transition: transform .2s ease; }
.acct-go:hover { color: rgb(var(--c-bg)); box-shadow: 0 12px 26px -14px rgb(16 20 30 / .55); }
.acct-go:hover svg { transform: translateX(3px); }
.acct-go:active { transform: scale(.985); }
.acct-go[disabled] { opacity: .7; cursor: progress; }
.acct-ghost { height: 46px; border-radius: 12px; border: 1px solid rgb(var(--c-line)); background: none; color: rgb(var(--c-ink)); font: 600 .9rem var(--sans); cursor: pointer; }
.acct-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgb(var(--c-bg) / .35); border-top-color: rgb(var(--c-bg)); animation: acct-rot .7s linear infinite; }
@keyframes acct-rot { to { transform: rotate(360deg); } }
.acct-formerr { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgb(var(--c-red-soft)); color: rgb(var(--c-red-ink)); font-size: .84rem; line-height: 1.45; }
.acct-ok { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgb(var(--c-green-soft)); color: rgb(var(--c-green-ink)); font-size: .84rem; line-height: 1.45; }
.acct-swap { margin: 16px 0 0; text-align: center; font-size: .86rem; color: rgb(var(--c-ink-2)); }
.acct-swap.small { font-size: .78rem; }
.acct-swap a { color: rgb(var(--c-accent)); }

.acct-toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 70; max-width: min(520px, calc(100% - 32px));
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
  background: rgb(var(--c-ink)); color: rgb(var(--c-bg)); padding: 11px 16px; border-radius: 12px; font: 500 .86rem/1.45 var(--sans);
}
.acct-toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 560px) {
  .acct-dlg[open] { place-items: end center; padding: 0; }
  .acct-dlg__box { width: 100%; border-radius: 22px 22px 0 0; max-height: 92dvh; padding: 26px 20px calc(20px + env(safe-area-inset-bottom, 0px)); animation-name: acct-up; }
  .acct-row, .acct-who__opts { grid-template-columns: minmax(0, 1fr); }
  .acct-signin span { display: none; }
  .acct-signin { width: 38px; padding: 0; justify-content: center; }
}
@keyframes acct-up { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .acct-menu, .acct-dlg__box, .acct-skel::after, .acct-avatar__dot, .acct-spin { animation: none !important; }
  .acct-toast, .acct-go, .acct-card, .acct-google { transition: none !important; }
}
