/* BoomBigNose Learn — dashboard page · Night Workshop palette
   Self-contained: mirrors login.css token/motif patterns but scoped to the
   dashboard surface. Do NOT modify login.css — this file is its own stylesheet. */

:root {
  --bg:        #0b0c10;
  --bg-2:      #101218;
  --bg-3:      #161823;
  --line:      rgba(231, 226, 211, 0.08);
  --line-2:    rgba(231, 226, 211, 0.16);
  --line-3:    rgba(231, 226, 211, 0.28);

  --text:      #ece7d6;
  --text-2:    #b9b4a4;
  --text-3:    #82806f;
  --mute:      #5e5d52;

  --coral:     #ff5a45;
  --coral-2:   #ff8169;
  --coral-glow:rgba(255, 90, 69, 0.22);
  --amber:     #f5c45e;
  --cyan:      #5fd4ff;
  --lime:      #c6ff5a;

  --display:   'Bricolage Grotesque', 'IBM Plex Sans Thai Looped', system-ui, sans-serif;
  --editorial: 'Instrument Serif', 'Noto Serif Thai', Georgia, serif;
  --sans:      'IBM Plex Sans', 'IBM Plex Sans Thai Looped', system-ui, sans-serif;
  --mono:      'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

/* Author display rules below (e.g. body.dash-body { display:grid }) outrank
   the UA stylesheet's `[hidden] { display:none }`, so the `hidden` attribute
   is silently overridden. Re-assert it with !important to restore the
   contract — required so `<body hidden>` and `<.profile-row hidden>`
   actually hide the empty pre-render state. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html:lang(th) body { font-family: 'IBM Plex Sans Thai Looped', var(--sans); }

body.dash-body {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  position: relative;
  overflow-x: hidden;
}

/* ── Decorative motifs (parity with login/main site) ───────── */
.bg-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(rgba(231, 226, 211, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse at center, #000 50%, transparent 100%);
}
.bg-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  filter: blur(80px); opacity: 0.5;
}
.bg-glow span {
  position: absolute; width: 400px; height: 400px; border-radius: 50%;
  animation: drift 18s ease-in-out infinite alternate;
}
.bg-glow span:nth-child(1) { top: -8%;  left: -10%; background: var(--coral-glow); }
.bg-glow span:nth-child(2) { bottom: 8%; right: -12%; background: rgba(95, 212, 255, 0.16); animation-delay: -6s; }
.bg-glow span:nth-child(3) { top: 40%; left: 50%; background: rgba(245, 196, 94, 0.12); animation-delay: -12s; }
@keyframes drift {
  to { transform: translate(40px, -30px) scale(1.1); }
}

/* ── Language toggle (top-right, same as login) ────────────── */
.lang-toggle {
  position: fixed; top: 18px; right: 22px; z-index: 10;
  display: inline-flex; align-items: center;
  font: 500 13px/1 var(--mono);
  background: rgba(11, 12, 16, 0.6);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  backdrop-filter: blur(8px);
}
.lang-toggle__btn {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--text-3);
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
  letter-spacing: 0.05em;
  transition: color 120ms;
}
.lang-toggle__btn[aria-pressed="true"] { color: var(--coral); }
.lang-toggle__btn:hover { color: var(--text); }
.lang-toggle__btn:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }
.lang-toggle__sep { color: var(--mute); }

/* ── Card shell with coral corner brackets ─────────────────── */
.dash-shell {
  position: relative;
  width: min(500px, calc(100vw - 32px));
  margin: auto;
  padding: 56px 40px 40px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border: 1px solid var(--line-2);
  border-radius: 6px;
  z-index: 1;
}

@media (max-width: 480px) {
  .dash-shell { padding: 48px 20px 32px; }
}

.bracket {
  position: absolute; width: 20px; height: 20px;
  border-color: var(--coral);
  border-style: solid;
}
.bracket--tl { top: -1px; left: -1px;     border-width: 2px 0 0 2px; }
.bracket--tr { top: -1px; right: -1px;    border-width: 2px 2px 0 0; }
.bracket--bl { bottom: -1px; left: -1px;  border-width: 0 0 2px 2px; }
.bracket--br { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

/* ── Head: brand mark + section marker ─────────────────────── */
.dash-head { display: grid; gap: 18px; margin-bottom: 22px; }
.dash-mark {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--text);
  width: max-content;
}
.dash-mark img { display: block; image-rendering: -webkit-optimize-contrast; }
.dash-mark__brand {
  font: 700 18px/1 var(--display);
  letter-spacing: -0.01em;
}
.dash-section {
  margin: 0;
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.12em;
  color: var(--text-3);
  text-transform: uppercase;
}
.dash-section .cursor {
  display: inline-block;
  width: 6px; height: 11px;
  margin-left: 4px;
  background: var(--coral);
  vertical-align: -1px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ── Title / greeting ──────────────────────────────────────── */
.dash-title {
  margin: 0 0 22px;
  font: 600 34px/1.08 var(--display);
  letter-spacing: -0.01em;
  color: var(--text);
}
html:lang(th) .dash-title { font-size: 30px; }

.dash-title__name {
  font-family: var(--editorial);
  font-style: italic;
  font-weight: 400;
  color: var(--coral);
}

/* ── Status banner ─────────────────────────────────────────── */
.dash-status {
  margin: -8px 0 16px;
  padding: 10px 12px;
  font: 500 13px/1.4 var(--mono);
  border-radius: 4px;
  border: 1px solid var(--line-2);
  background: var(--bg-3);
  color: var(--text-2);
}
.dash-status[data-tone="error"]   { border-color: var(--coral);  color: var(--coral-2); }
.dash-status[data-tone="info"]    { border-color: var(--cyan);   color: var(--cyan); }
.dash-status[data-tone="success"] { border-color: var(--lime);   color: var(--lime); }

/* ── Profile card ──────────────────────────────────────────── */
.profile-card {
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 24px;
  margin-bottom: 22px;
}

.profile-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}

/* Avatar row */
.profile-row--avatar {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 0; /* divider provides gap */
}

.avatar-wrap {
  flex: 0 0 auto;
}

.avatar-img {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  object-fit: cover;
}

.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--coral);
  border: 2px solid var(--coral);
  font: 700 28px/1 var(--display);
  color: #fff;
  text-transform: uppercase;
  user-select: none;
}

@media (max-width: 640px) {
  .avatar-img,
  .avatar-fallback { width: 64px; height: 64px; font-size: 24px; }
}

.profile-identity {
  min-width: 0; /* allow text-overflow in flex child */
}

.profile-name {
  margin: 0 0 4px;
  font: 600 17px/1.2 var(--display);
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-email {
  margin: 0;
  font: 400 13px/1.4 var(--mono);
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Generic data rows */
.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
}

.profile-row + .profile-row { border-top: 1px solid var(--line); }

.profile-label {
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.06em;
  color: var(--text-3);
  text-transform: uppercase;
  flex: 0 0 auto;
}

.profile-value {
  font: 400 14px/1.4 var(--sans);
  color: var(--text-2);
  text-align: right;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Provider badge inside .profile-value */
.provider-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 500 13px/1 var(--sans);
  color: var(--text-2);
}
.provider-badge svg { width: 16px; height: 16px; flex: 0 0 auto; }

/* Tier pill */
.tier-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--line-2);
  color: var(--text-2);
  background: var(--bg-3);
}
.tier-pill[data-tier="free"]      { color: var(--text-3); border-color: var(--line); }
.tier-pill[data-tier="pro"]       { color: var(--coral);  border-color: var(--coral); background: rgba(255,90,69,0.08); }
.tier-pill[data-tier="skool_pro"] { color: var(--amber);  border-color: var(--amber); background: rgba(245,196,94,0.08); }
.tier-pill[data-tier="team"]      { color: var(--cyan);   border-color: var(--cyan);  background: rgba(95,212,255,0.08); }
.tier-pill[data-tier="lifetime"]  { color: var(--lime);   border-color: var(--lime);  background: rgba(198,255,90,0.08); }

/* ── Actions ───────────────────────────────────────────────── */
.dash-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 640px) {
  .dash-actions { grid-template-columns: 1fr; }
}

.dash-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 18px;
  font: 500 15px/1 var(--sans);
  letter-spacing: 0.005em;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: transform 120ms, border-color 120ms, background 120ms, opacity 120ms;
}
html:lang(th) .dash-btn { font-family: 'IBM Plex Sans Thai Looped', var(--sans); }

.dash-btn:hover   { transform: translateY(-1px); }
.dash-btn:active  { transform: translateY(0); }
.dash-btn:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }
.dash-btn[disabled] { opacity: 0.5; pointer-events: none; }

.dash-btn--primary {
  background: var(--coral);
  border: 1px solid var(--coral);
  color: #fff;
}
.dash-btn--primary:hover {
  background: var(--coral-2);
  border-color: var(--coral-2);
}

.dash-btn--outline {
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  color: var(--text-2);
}
.dash-btn--outline:hover {
  border-color: var(--line-3);
  background: var(--bg-2);
  color: var(--text);
}

/* ── Fine print ────────────────────────────────────────────── */
.dash-fineprint {
  margin: 0;
  font: 400 12px/1.5 var(--mono);
  color: var(--text-3);
  letter-spacing: 0.02em;
}
.dash-fineprint a {
  color: var(--text-2);
  text-decoration: underline;
  text-decoration-color: var(--line-3);
  text-underline-offset: 2px;
}
.dash-fineprint a:hover { color: var(--coral); text-decoration-color: var(--coral); }

/* ── Footer ────────────────────────────────────────────────── */
.dash-foot {
  position: relative;
  z-index: 1;
  padding: 20px;
  text-align: center;
  font: 400 12px/1 var(--mono);
  color: var(--mute);
  letter-spacing: 0.06em;
}

/* ── Reduced-motion respect ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .bg-glow span { animation: none; }
  .dash-section .cursor { animation: none; opacity: 1; }
  .dash-btn { transition: none; }
}
