/* ─── Dashboard page styles — Phase C 2026-05-04 ───
   Minimal, calm, NN/g-aligned. Reuses tokens where they exist
   (mobile-tokens.css for type/spacing) and keeps colour to brand
   amber + neutral surfaces so the page feels like the same app. */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #fafaf7;
  color: #222;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Topbar ───────────────────────────────────────────────── */
.dash-topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: .75rem 1rem;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,.07);
  position: sticky; top: 0; z-index: 10;
}
.dash-brand {
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit; line-height: 1.1;
}
.dash-brand-name {
  font-weight: 700; font-size: 1.05rem;
}
.dash-brand-name span { color: #FBC02D; }
.dash-brand-tag {
  font-size: .75rem; color: #666; margin-top: .125rem;
}
.dash-topbar-actions {
  margin-left: auto;
  display: flex; align-items: center; gap: .75rem;
}
.dash-link-back {
  font-size: .9rem; color: #2C7BE5;
  text-decoration: none; padding: .375rem .5rem;
  border-radius: 6px;
}
.dash-link-back:hover { background: rgba(44,123,229,.08); }
.dash-link-back:focus-visible {
  outline: 2px solid #2C7BE5; outline-offset: 2px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.dash-btn {
  font-size: .9rem; padding: .5rem .875rem;
  border-radius: 8px; cursor: pointer;
  border: 1px solid rgba(0,0,0,.18);
  background: #fff; color: #222;
  min-height: 36px;
  font-weight: 500;
}
.dash-btn:hover { background: #f4f4f4; }
.dash-btn:focus-visible {
  outline: 2px solid #2C7BE5; outline-offset: 2px;
}
.dash-btn-primary {
  background: #FBC02D; color: #222;
  border-color: rgba(0,0,0,.15); font-weight: 600;
}
.dash-btn-primary:hover { background: #f0b71f; }
.dash-btn-primary:disabled {
  opacity: .55; cursor: not-allowed;
}
.dash-btn-ghost {
  background: transparent; border-color: rgba(0,0,0,.12);
}
.dash-btn-ghost:hover { background: rgba(0,0,0,.04); }

/* ── Main layout ──────────────────────────────────────────── */
.dash-main {
  max-width: 880px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

/* ── Loading / empty placeholders ─────────────────────────── */
.dash-loading {
  display: flex; flex-direction: column; align-items: center;
  padding: 4rem 1rem; color: #666;
}
.dash-loading-spinner {
  font-size: 2rem; opacity: .7;
  animation: dash-pulse 1.4s ease-in-out infinite;
}
@keyframes dash-pulse {
  0%, 100% { opacity: .35; }
  50%      { opacity: .8;  }
}
@media (prefers-reduced-motion: reduce) {
  .dash-loading-spinner { animation: none; }
}

/* ── Identity card ────────────────────────────────────────── */
.dash-identity {
  display: flex; gap: 1rem; align-items: center;
  padding: 1rem 1.25rem;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.08);
  margin-bottom: 1.5rem;
}
.dash-identity-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FBC02D 0%, #FF8F00 100%);
  color: #fff; font-weight: 700; font-size: 1.25rem;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  box-shadow: inset 0 -2px 4px rgba(0,0,0,.1);
}
.dash-identity-body { flex: 1 1 auto; min-width: 0; }
.dash-identity-name {
  margin: 0; font-size: 1.25rem; line-height: 1.2;
}
.dash-identity-email {
  color: #555; font-size: .9rem; margin-top: .125rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-identity-meta {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin-top: .375rem;
}
.dash-identity-role,
.dash-identity-school {
  font-size: .72rem;
  padding: .15rem .5rem;
  border-radius: 4px;
  background: rgba(0,0,0,.06);
  color: #444;
  letter-spacing: .03em;
}
.dash-identity-role { background: rgba(251,192,45,.18); color: #8a5a00; font-weight: 600; }

/* ── Section heading ──────────────────────────────────────── */
.dash-section { margin-bottom: 2rem; }
.dash-section-header {
  display: flex; align-items: baseline;
  gap: 1rem; margin-bottom: .75rem;
}
.dash-section-header h2 {
  margin: 0; font-size: 1.05rem; font-weight: 600;
}
.dash-section-cta {
  margin-left: auto; font-size: .85rem;
  color: #2C7BE5; text-decoration: none;
  padding: .25rem .5rem; border-radius: 6px;
}
.dash-section-cta:hover { background: rgba(44,123,229,.08); }

/* ── Boards list ──────────────────────────────────────────── */
.dash-boards-list {
  display: flex; flex-direction: column; gap: .5rem;
}
.dash-board-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem;
  background: #fff;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.08);
  min-height: 64px;
}
.dash-board-info { flex: 1 1 auto; min-width: 0; }
.dash-board-name {
  font-weight: 600; font-size: .95rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-board-meta {
  font-size: .78rem; color: #666; margin-top: .125rem;
}
.dash-board-badge {
  font-size: .7rem; padding: .15rem .5rem;
  border-radius: 4px; flex: 0 0 auto;
  white-space: nowrap;
}
.dash-board-badge-cloud {
  background: rgba(58,168,98,.12); color: #1f6f3a;
}
.dash-board-badge-local {
  background: rgba(0,0,0,.06); color: #555;
}
.dash-board-open {
  flex: 0 0 auto;
  font-size: .85rem; color: #2C7BE5;
  text-decoration: none;
  padding: .375rem .625rem;
  border-radius: 6px;
  border: 1px solid rgba(44,123,229,.25);
}
.dash-board-open:hover {
  background: rgba(44,123,229,.08);
}
.dash-board-open:focus-visible {
  outline: 2px solid #2C7BE5; outline-offset: 2px;
}

/* ── Empty state ──────────────────────────────────────────── */
.dash-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  background: #fff;
  border: 1px dashed rgba(0,0,0,.18);
  border-radius: 10px;
  color: #555;
}
.dash-empty-icon { font-size: 2rem; opacity: .8; margin-bottom: .5rem; }
.dash-empty h3 { margin: 0 0 .375rem; font-size: 1rem; }
.dash-empty p { margin: 0; font-size: .85rem; }
.dash-empty a { color: #2C7BE5; }

/* ── Sign-in card ─────────────────────────────────────────── */
.dash-signin-card {
  max-width: 420px; margin: 2rem auto;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.08);
  padding: 1.5rem;
}
.dash-signin-card h1 {
  margin: 0 0 .375rem; font-size: 1.2rem;
}
.dash-signin-sub {
  font-size: .85rem; color: #555; margin: 0 0 1.25rem;
}
.dash-signin-sub a { color: #2C7BE5; }
.dash-signin-card label {
  display: block; font-size: .8rem; font-weight: 600;
  color: #444; margin: .75rem 0 .25rem;
}
.dash-signin-card input[type="email"],
.dash-signin-card input[type="password"] {
  width: 100%;
  padding: .625rem .75rem;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,.18);
  font-size: 16px; /* iOS no-zoom */
  background: #fff;
}
.dash-signin-card input:focus-visible {
  outline: 2px solid #2C7BE5; outline-offset: 1px;
}
.dash-signin-error {
  color: #c0382b;
  font-size: .8rem;
  min-height: 1.1rem;
  margin-top: .5rem;
}
.dash-signin-card .dash-btn-primary {
  width: 100%; margin-top: 1rem; padding: .75rem;
}
.dash-signin-alt {
  text-align: center; font-size: .8rem;
  color: #555; margin-top: 1rem;
}
.dash-signin-alt a { color: #2C7BE5; }

/* ── Toast ─────────────────────────────────────────────────── */
.dash-toast {
  position: fixed; bottom: 1.5rem; left: 50%;
  transform: translateX(-50%);
  background: #222; color: #fff;
  padding: .625rem 1rem; border-radius: 8px;
  font-size: .85rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  z-index: 1000;
}
.dash-toast[hidden] { display: none; }

/* ── Narrow viewports ─────────────────────────────────────── */
@media (max-width: 600px) {
  .dash-board-row { flex-wrap: wrap; }
  .dash-board-open {
    flex: 1 1 100%;
    text-align: center;
    margin-top: .5rem;
  }
  .dash-section-header { flex-wrap: wrap; }
  .dash-section-cta { width: 100%; text-align: left; padding-left: 0; }
}

/* ─── OAuth buttons (oauth-buttons.js, Phase D 2026-05-04) ─── */
/* Mounted on signup.html + dashboard.html signin section. Renders 3
   SSO buttons + a magic-link form. Pending providers get a 'soon'
   badge so user knows the option exists but isn't enabled yet. */
.oauth-buttons-root {
  display: flex; flex-direction: column; gap: .75rem;
  margin: 1.25rem 0 .5rem;
}
.oauth-sso-row {
  display: flex; flex-direction: column; gap: .5rem;
}
.oauth-btn {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .75rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,.18);
  background: #fff;
  font-size: .9rem; font-weight: 500;
  color: #222; cursor: pointer;
  min-height: 44px;          /* mobile tap target floor */
  position: relative;
}
.oauth-btn:hover { background: #f6f6f6; }
.oauth-btn:focus-visible { outline: 2px solid #2C7BE5; outline-offset: 2px; }
.oauth-btn-google    { color: #1a73e8; border-color: rgba(26,115,232,.30); }
.oauth-btn-apple     { color: #000;    border-color: rgba(0,0,0,.40); background: #f9f9f9; }
.oauth-btn-microsoft { color: #0078d4; border-color: rgba(0,120,212,.30); }
.oauth-pending {
  opacity: .65;
  cursor: not-allowed;       /* visual only — click still toasts */
}
.oauth-soon-badge {
  font-size: .65rem; font-weight: 600; text-transform: uppercase;
  background: rgba(0,0,0,.08); color: #555;
  padding: .15rem .35rem; border-radius: 4px;
  margin-left: .375rem;
}
.oauth-divider {
  text-align: center; color: #999; font-size: .78rem;
  position: relative;
}
.oauth-divider::before, .oauth-divider::after {
  content: ''; display: inline-block; width: 30%;
  height: 1px; background: rgba(0,0,0,.12);
  vertical-align: middle; margin: 0 .5rem;
}
.oauth-magic-form {
  display: flex; flex-wrap: wrap; gap: .5rem;
}
.oauth-magic-email {
  flex: 1 1 60%;
  padding: .625rem .75rem;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,.18);
  font-size: 16px;          /* iOS no-zoom */
  min-height: 44px;
}
.oauth-magic-email:focus-visible { outline: 2px solid #2C7BE5; outline-offset: 1px; }
.oauth-magic-btn {
  flex: 1 1 35%;
  padding: .625rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,.18);
  background: #FBC02D; color: #222;
  font-size: .9rem; font-weight: 600;
  min-height: 44px; cursor: pointer;
}
.oauth-magic-btn:hover { background: #f0b71f; }
.oauth-magic-btn:disabled { opacity: .55; cursor: not-allowed; }
.oauth-magic-form[data-provider="magic_link"].oauth-pending .oauth-magic-btn,
.oauth-magic-form .oauth-magic-btn:disabled { opacity: .55; }
@media (max-width: 480px) {
  .oauth-magic-form { flex-direction: column; }
  .oauth-magic-email, .oauth-magic-btn { flex: 1 1 100%; }
}
