/* shell.css — basis website-shell (B49). Kleuren komen uit /api/shell/skin.css
   (CSS-variabelen --color-*, per tenant_domain). Geen Max-layouts (M2). */

:root {
  /* Fallbacks; skin.css overschrijft deze per tenant_domain. */
  --color-primary: #1f6feb;
  --color-accent: #0969da;
  --color-background: #ffffff;
  --color-surface: #f6f8fa;
  --color-text: #1f2328;
  --color-muted: #656d76;
  --font-scale: 1;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: calc(16px * var(--font-scale));
  color: var(--color-text);
  background: var(--color-background);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body[data-theme="dark"] {
  --color-background: #0d1117;
  --color-surface: #161b22;
  --color-text: #e6edf3;
  --color-muted: #8b949e;
}

/* --- header + nav --- */
.app-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--color-surface);
  border-bottom: 2px solid var(--color-primary);
}
.app-header .brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; }
.app-header .brand img { height: 32px; width: auto; }
.app-nav { background: var(--color-surface); border-bottom: 1px solid var(--color-muted); }
.app-nav ul { list-style: none; display: flex; gap: 0.5rem; margin: 0; padding: 0.4rem 1.25rem; }
.app-nav a {
  text-decoration: none; color: var(--color-text);
  padding: 0.4rem 0.75rem; border-radius: 6px;
}
.app-nav a:hover { background: var(--color-primary); color: #fff; }

/* --- content --- */
.app-content { flex: 1; width: min(960px, 92vw); margin: 1.5rem auto; }
.app-content h1 { color: var(--color-primary); }
.reader-paragraph { line-height: 1.65; margin: 0 0 1rem; }
.account-tabs { display: flex; gap: 0.5rem; border-bottom: 1px solid var(--color-muted); }
.account-tabs button { border: 0; background: none; padding: 0.6rem 1rem; cursor: pointer; color: var(--color-text); }
.account-tabs button[aria-selected="true"] { border-bottom: 3px solid var(--color-primary); font-weight: 600; }

/* --- footer --- */
.app-footer {
  background: var(--color-surface);
  color: var(--color-muted);
  padding: 1.5rem 1.25rem;
  border-top: 1px solid var(--color-muted);
  font-size: 0.85em;
}
.app-footer a { color: var(--color-muted); }

/* --- drijvende chrome --- */
.float-btn {
  position: fixed; bottom: 1.25rem; width: 48px; height: 48px;
  border-radius: 50%; border: 0; cursor: pointer;
  background: var(--color-primary); color: #fff; font-size: 1.3rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
#app-profile-menu .float-btn { left: 1.25rem; }
#app-help-widget .float-btn { left: 5rem; }
.popover {
  position: fixed; bottom: 5rem; left: 1.25rem; z-index: 20;
  background: var(--color-background); color: var(--color-text);
  border: 1px solid var(--color-muted); border-radius: 10px;
  padding: 1rem; width: min(320px, 90vw);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.popover[hidden] { display: none; }
.popover h3 { margin-top: 0; }
.popover .row { display: flex; justify-content: space-between; align-items: center; margin: 0.5rem 0; }

/* --- shop + checkout (M1-12/M1-14) --- */
.cart-row { display: flex; justify-content: space-between; gap: 1rem; margin: 0.35rem 0; }
.cart-total { display: flex; justify-content: space-between; margin: 0.25rem 0; }
.checkout-summary { margin: 1rem 0; }
.pay-btn {
  display: inline-block; margin-top: 1rem; padding: 0.7rem 1.4rem;
  border: 0; border-radius: 8px; cursor: pointer;
  background: var(--color-primary); color: #fff; font-size: 1rem; text-decoration: none;
}
.pay-btn[disabled] { opacity: 0.6; cursor: default; }
#guest-section label, #payment-section { display: block; margin: 0.75rem 0; }
#guest-section input { display: block; width: min(360px, 100%); padding: 0.5rem; margin-top: 0.25rem; }
#payment-element { margin: 1rem 0; }
.pay-msg { margin-top: 0.75rem; color: var(--color-muted); }
.field-hint { margin: 0.15rem 0 0; font-size: 0.85em; color: var(--color-muted); }
.return-state { font-size: 1.1rem; font-weight: 600; }
.return-provisioned { color: var(--color-primary); }
.return-failed, .return-cancelled { color: #b00020; }
.return-readers a { color: var(--color-primary); }

@media (max-width: 640px) {
  .app-nav ul { flex-wrap: wrap; }
  .app-content { margin: 1rem auto; }
}

/* Account — abonnementen-tab (M1-15c) */
.sub-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--c-border, #ddd);
  border-radius: 8px;
  margin-bottom: 0.75rem;
}
.sub-card .sub-info { display: flex; flex-direction: column; }
.sub-card .sub-until { color: #666; font-size: 0.875rem; }
.sub-cancel {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--c-border, #ccc);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.sub-cancel:disabled { opacity: 0.6; cursor: default; }
