/* ==========================================================================
   ParaPrep, Account / app shell styles (Briefs 3 to 5 logged-in pages)
   Layered on top of styles.css (tokens + base components). Page-specific,
   following the same convention as landing.css / pricing.css.
   ========================================================================== */

/* The [hidden] attribute must always win, otherwise the display rules below
   (e.g. .app-loading{display:flex}) override it and the element stays visible. */
[hidden] { display: none !important; }

/* Loading gate (shown until auth + profile resolve) */
.app-loading {
  min-height: 60vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1rem;
  color: var(--muted); font-size: .95rem;
}
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--teal-soft); border-top-color: var(--teal);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* App header (extends .site-header) */
.app-header-right { display: flex; align-items: center; gap: .75rem; margin-left: auto; flex-wrap: wrap; }
.plan-badge {
  font-size: .72rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px;
  background: var(--teal-soft); color: var(--teal-dark);
}
.btn.ghost {
  background: var(--surface); color: var(--teal-dark);
  border: 1px solid var(--line); padding: .45rem .9rem; font-size: .85rem;
}
.btn.ghost:hover { background: var(--teal-soft); }

/* Main column */
.app-main { max-width: 1000px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.dash-hero h2 { font-size: 1.6rem; }

/* Upgrade banner, the constant nudge */
.upgrade-banner {
  display: flex; align-items: center; gap: 1rem; justify-content: space-between;
  background: var(--amber-bg); border: 1px solid #f0e3c4; border-left: 4px solid var(--amber);
  border-radius: var(--radius); padding: 1.1rem 1.3rem; margin-bottom: 2rem;
  text-decoration: none; color: inherit; box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
}
.upgrade-banner:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(20,50,55,.12); }
.upgrade-copy strong { display: block; color: var(--amber); font-size: 1.02rem; }
.upgrade-copy p { margin: .2rem 0 0; color: var(--muted); font-size: .9rem; }
.btn.upgrade-btn { background: var(--amber); white-space: nowrap; flex-shrink: 0; }
.btn.upgrade-btn:hover { background: var(--amber); filter: brightness(.95); }

/* Section headings */
.section-head { font-size: 1.15rem; margin: 1.8rem 0 .25rem; letter-spacing: -.01em; }
.section-head .lock { font-size: .9rem; }

/* Locked feature cards, preview only, never the paid content */
.feature-card.locked { position: relative; border-style: dashed; background: #fbfcfc; }
.feature-card.locked .icon { opacity: .55; }
.feature-card.locked h3 { color: var(--muted); }
.lock-badge { position: absolute; top: .9rem; right: 1rem; font-size: 1rem; opacity: .7; }
.unlock-cta {
  display: inline-block; margin-top: .9rem; font-size: .8rem; font-weight: 700;
  color: var(--amber); background: var(--amber-bg);
  border: 1px solid #f0e3c4; border-radius: 999px; padding: .3rem .7rem;
}
.feature-card.locked:hover .unlock-cta { background: var(--amber); color: #fff; border-color: var(--amber); }

/* Keyboard focus visibility (accessibility) */
.feature-card:focus-visible,
.upgrade-banner:focus-visible,
.btn:focus-visible,
.level-toggle button:focus-visible,
.site-footer a:focus-visible {
  outline: 2px solid var(--teal-dark); outline-offset: 2px;
}

@media (max-width: 620px) {
  .app-header-right { width: 100%; margin-left: 0; }
  .upgrade-banner { flex-direction: column; align-items: flex-start; }
}
