/* ──────────────────────────────────────────────────────────
 *  Tunegether — accounts.
 *
 *  Light, like the rest of the public site. The dark ramp owns /dj, /pads and
 *  the app; a sign-in box is not a performance surface and a black modal over
 *  a white page reads as a different product.
 *
 *  The shape is a split card: the reason on the left, the form on the right.
 *  On a phone the left panel collapses to a single line, because the reason
 *  still has to be said and a gradient panel that eats the fold does not say
 *  it.
 * ────────────────────────────────────────────────────────── */

.tg-sr-only {
  position: absolute !important;
  width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important;
  overflow: hidden !important; clip: rect(0,0,0,0) !important;
  white-space: nowrap !important; border: 0 !important;
}

/* ─────────────────────────────── the modal ─────────────────────────────── */

.tg-auth {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 20px;
}

.tg-auth[hidden] { display: none; }

.tg-auth-scrim {
  position: absolute;
  inset: 0;
  background: rgba(11, 11, 18, 0.46);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.tg-auth-card {
  position: relative;
  z-index: 1;
  width: min(880px, 100%);
  max-height: min(680px, calc(100dvh - 40px));
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--tg-bg);
  border-radius: var(--tg-r-lg);
  box-shadow: var(--tg-shadow-3);
  animation: tg-auth-in var(--tg-dur) var(--tg-ease-out);
}

@keyframes tg-auth-in {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tg-auth-card { animation: none; }
}

/* ───────────────────────────── the left panel ───────────────────────────── */

.tg-auth-aside {
  background: var(--tg-grad-diagonal);
  color: #fff;
  padding: 34px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-radius: var(--tg-r-lg) 0 0 var(--tg-r-lg);
}

/* The mark is a full-colour gradient wordmark on a gradient panel, which is
   the one place it cannot be used as-is. White it out — this is the same mark,
   reading as one shape, which is what a lockup on a coloured field wants. */
.tg-auth-mark {
  width: 168px;
  height: auto;
  filter: brightness(0) invert(1);
  opacity: .96;
}

.tg-auth-aside h2 {
  font-family: var(--tg-font-display);
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 8px 0 0;
}

.tg-auth-aside p {
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
  color: rgba(255,255,255,.92);
}

.tg-auth-points {
  list-style: none;
  padding: 0;
  margin: auto 0 0;
  display: grid;
  gap: 9px;
}

.tg-auth-points li {
  position: relative;
  padding-left: 22px;
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(255,255,255,.9);
}

.tg-auth-points li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: .55em;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.85);
}

/* ───────────────────────────── the right panel ───────────────────────────── */

.tg-auth-main {
  position: relative;
  padding: 34px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tg-auth-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 0; border-radius: 10px;
  background: transparent;
  color: var(--tg-ink-mute);
  cursor: pointer;
}
.tg-auth-close:hover { background: var(--tg-surface-2); color: var(--tg-ink); }

.tg-auth-step[hidden] { display: none; }

.tg-auth-step h3 {
  font-family: var(--tg-font-display);
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--tg-ink);
}

.tg-auth-sub {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--tg-ink-mute);
  margin: 0 0 20px;
}

/* Where a sign-up actually dies: a first message from a sender the inbox has
   never seen, filed under promotions, and somebody staring at an empty inbox
   concluding the site is broken. Said here, before they have time to. */
.tg-auth-spam {
  margin: -8px 0 18px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #6b5a2e;
  background: #FFF8E8;
  border: 1px solid #F2E2BC;
  border-radius: 10px;
}

.tg-auth-spam strong { color: #5a4a22; }

.tg-auth-oauth { display: grid; gap: 9px; }
.tg-auth-oauth:empty { display: none; }

.tg-auth-oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  font: 600 14.5px/1 var(--tg-font-body);
  color: var(--tg-ink);
  background: var(--tg-bg);
  border: 1px solid var(--tg-rule-strong);
  border-radius: var(--tg-r);
  cursor: pointer;
  transition: background var(--tg-dur-fast), border-color var(--tg-dur-fast);
}
.tg-auth-oauth-btn:hover { background: var(--tg-surface); border-color: var(--tg-purple); }
.tg-auth-oauth-btn[disabled] { opacity: .55; cursor: progress; }

/* Google's own button, rendered into this slot by Google Identity Services.
   Held at the same height as the rest of the row so nothing moves when it
   replaces the placeholder. */
.tg-auth-gis { display: flex; justify-content: center; align-items: center; min-height: 46px; }
.tg-auth-gis > .tg-auth-oauth-btn { flex: 1; }

.tg-auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--tg-ink-mute);
  font-size: 12.5px;
}
.tg-auth-divider[hidden] { display: none; }
.tg-auth-divider::before,
.tg-auth-divider::after { content: ''; height: 1px; background: var(--tg-rule); }

.tg-auth-form { display: grid; gap: 10px; }

.tg-auth-form input[type="email"],
.tg-auth-form input[type="password"] {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  font: 400 15.5px/1 var(--tg-font-body);
  color: var(--tg-ink);
  background: var(--tg-surface);
  border: 1px solid var(--tg-rule-strong);
  border-radius: var(--tg-r);
  outline: none;
}
.tg-auth-form input:focus {
  border-color: var(--tg-purple);
  box-shadow: 0 0 0 3px rgba(122,60,255,.16);
}

.tg-auth-primary {
  min-height: 48px;
  padding: 0 20px;
  font: 700 15px/1 var(--tg-font-body);
  color: #fff;
  background: var(--tg-grad);
  border: 0;
  border-radius: var(--tg-r);
  cursor: pointer;
}
.tg-auth-primary:disabled { opacity: .6; cursor: progress; }

.tg-auth-msg {
  margin: 14px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--tg-ink-soft);
}
.tg-auth-msg[data-bad="true"] { color: #B3003C; }

.tg-auth-fine {
  margin: 18px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--tg-ink-mute);
}
.tg-auth-fine a { color: var(--tg-ink-soft); text-decoration: underline; text-underline-offset: 2px; }

.tg-auth-back {
  align-self: flex-start;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  background: none;
  font: 600 13px/1 var(--tg-font-body);
  color: var(--tg-purple);
  cursor: pointer;
}

/* ────────────────────────────── the six boxes ──────────────────────────────
 *
 * Six, not one field, for a reason a phone makes obvious: each box is its own
 * tap target and the caret never has to be placed. The whole row also accepts
 * a paste on any box, because that is how a code actually arrives from an SMS
 * or a mail app.
 */

.tg-otp {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  max-width: 340px;
}

.tg-otp-box {
  width: 100%;
  aspect-ratio: 3 / 4;
  min-height: 52px;
  text-align: center;
  font: 700 24px/1 var(--tg-font-display);
  color: var(--tg-ink);
  background: var(--tg-surface);
  border: 1px solid var(--tg-rule-strong);
  border-radius: var(--tg-r);
  outline: none;
  caret-color: var(--tg-purple);
  transition: border-color var(--tg-dur-fast), box-shadow var(--tg-dur-fast);
}

.tg-otp-box:focus {
  border-color: var(--tg-purple);
  box-shadow: 0 0 0 3px rgba(122,60,255,.16);
}

.tg-otp[data-busy="true"] { opacity: .55; pointer-events: none; }

.tg-auth-resend {
  margin: 16px 0 0;
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  font: 600 13.5px/1 var(--tg-font-body);
  color: var(--tg-purple);
  cursor: pointer;
}
.tg-auth-resend:disabled { color: var(--tg-ink-mute); cursor: default; }

/* ───────────────────────────────── the nav ───────────────────────────────── */

.tg-auth-nav-btn {
  padding: 0;
  border: 0;
  background: none;
  font: 600 14px/1 var(--tg-font-body);
  color: var(--tg-ink-soft);
  cursor: pointer;
}
.tg-auth-nav-btn:hover { color: var(--tg-ink); }

.mobile-menu .tg-auth-nav-mobile {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 0;
  font-size: 17px;
}

/* ──────────────────────────────── mobile ──────────────────────────────── */

@media (max-width: 760px) {
  .tg-auth { padding: 0; place-items: end stretch; }
  .tg-auth-card {
    grid-template-columns: 1fr;
    width: 100%;
    max-height: calc(100dvh - 24px);
    border-radius: var(--tg-r-xl) var(--tg-r-xl) 0 0;
  }
  .tg-auth-aside {
    border-radius: var(--tg-r-xl) var(--tg-r-xl) 0 0;
    padding: 22px 22px 20px;
    gap: 8px;
  }
  .tg-auth-mark { width: 132px; }
  .tg-auth-aside h2 { font-size: 21px; }
  /* The list is the part a small screen can afford to lose; the sentence
     above it is the part that has to survive. */
  .tg-auth-points { display: none; }
  .tg-auth-main { padding: 22px; }
  .tg-otp { max-width: none; gap: 6px; }
  .tg-otp-box { font-size: 21px; min-height: 48px; }
}

/* ────────────────────────────── the account page ────────────────────────────── */

.tg-account {
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) 20px 80px;
}

.tg-account h1 {
  font-family: var(--tg-font-display);
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--tg-ink);
}

.tg-account .lede {
  font-size: 16px;
  line-height: 1.6;
  color: var(--tg-ink-mute);
  margin: 0 0 28px;
  max-width: 58ch;
}

.tg-card {
  background: var(--tg-bg);
  border: 1px solid var(--tg-rule);
  border-radius: var(--tg-r-lg);
  padding: 22px 24px;
  margin: 0 0 18px;
  box-shadow: var(--tg-shadow-1);
}

.tg-card h2 {
  font-family: var(--tg-font-display);
  font-size: 19px;
  margin: 0 0 4px;
  color: var(--tg-ink);
}

.tg-card > p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--tg-ink-mute);
  margin: 0 0 16px;
}

.tg-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 12px;
  margin: 4px 0 0;
}

.tg-stat {
  background: var(--tg-surface-2);
  border-radius: var(--tg-r);
  padding: 14px 16px;
}

.tg-stat b {
  display: block;
  font-family: var(--tg-font-display);
  font-size: 24px;
  line-height: 1.1;
  color: var(--tg-ink);
}

.tg-stat span {
  font-size: 12.5px;
  color: var(--tg-ink-mute);
}

.tg-devices { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }

.tg-device {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--tg-surface);
  border: 1px solid var(--tg-rule);
  border-radius: var(--tg-r);
  font-size: 14px;
  color: var(--tg-ink-soft);
}

.tg-device b { color: var(--tg-ink); font-weight: 600; }
.tg-device .when { margin-left: auto; font-size: 12.5px; color: var(--tg-ink-mute); }

.tg-device[data-current="true"] {
  border-color: var(--tg-purple);
  background: var(--tg-surface-2);
}

.tg-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--tg-purple);
  background: #fff;
  border: 1px solid var(--tg-rule-strong);
  border-radius: 999px;
  padding: 3px 8px;
}

.tg-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* inline-flex, because half of these are anchors. A <button> centres its own
   label against min-height; an <a> does not, and "Back to the radio" sat on
   the top edge of its own box. */
.tg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  font: 600 14px/1 var(--tg-font-body);
  border-radius: var(--tg-r);
  border: 1px solid var(--tg-rule-strong);
  background: var(--tg-bg);
  color: var(--tg-ink);
  text-decoration: none;
  cursor: pointer;
}
.tg-btn:hover { border-color: var(--tg-purple); }
.tg-btn.primary { background: var(--tg-grad); color: #fff; border: 0; }
.tg-btn.danger { color: #B3003C; border-color: #F0C7D4; }
.tg-btn:disabled { opacity: .55; cursor: default; }

.tg-field { display: grid; gap: 6px; margin-bottom: 12px; max-width: 380px; }
.tg-field label { font-size: 13px; font-weight: 600; color: var(--tg-ink-soft); }
.tg-field input {
  min-height: 46px;
  padding: 0 14px;
  font: 400 15px/1 var(--tg-font-body);
  background: var(--tg-surface);
  border: 1px solid var(--tg-rule-strong);
  border-radius: var(--tg-r);
  color: var(--tg-ink);
  outline: none;
}
.tg-field input:focus { border-color: var(--tg-purple); box-shadow: 0 0 0 3px rgba(122,60,255,.16); }
.tg-field[data-state="bad"] input  { border-color: #E0567F; }
.tg-field[data-state="good"] input { border-color: #1F9D55; }

.tg-hint { font-size: 12.5px; line-height: 1.5; color: var(--tg-ink-mute); }
.tg-hint[data-bad="true"]  { color: #B3003C; }
.tg-hint[data-good="true"] { color: #157347; }

.tg-note { font-size: 13px; line-height: 1.6; color: var(--tg-ink-mute); margin: 14px 0 0; }

.tg-taste { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.tg-taste span {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--tg-surface-2);
  color: var(--tg-ink-soft);
}
