/* Members area. Builds on ../styles.css (colours, fonts, .btn). */

[hidden] { display: none !important; }

.status { max-width: 46rem; margin: 30vh auto 0; padding: 0 20px; text-align: center; }

/* Logged out / no access */
.login-view {
  min-height: 100vh; max-width: 26rem; margin: 0 auto; padding: 48px 20px;
  display: flex; flex-direction: column; justify-content: center; text-align: center;
}
.login-view .wordmark-small { margin-bottom: 40px; }
.login-view h1 { font-size: clamp(2.5rem, 9vw, 3.5rem); margin-bottom: 12px; }
.login-view p { margin: 0 0 20px; }
#login-form { display: grid; gap: 12px; margin-bottom: 16px; }
#login-form input {
  min-height: 48px; padding: 10px 14px; width: 100%;
  font: inherit; color: var(--navy); background: var(--white); border: var(--line); border-radius: 0;
}
#login-form input::placeholder { color: var(--muted); }
#login-form .btn { width: 100%; cursor: pointer; }
.btn:disabled { opacity: 0.7; cursor: wait; }
.login-msg { min-height: 1.6em; }

.link-btn {
  background: none; border: 0; padding: 0; min-height: 44px; cursor: pointer;
  font: inherit; color: var(--navy); text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--navy-light); }

/* App shell */
.app-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  min-height: 64px; padding: 0 20px; background: var(--white); border-bottom: var(--line);
}
.menu-btn {
  min-height: 44px; padding: 0 18px; cursor: pointer;
  background: var(--white); color: var(--navy); border: var(--line);
  font: inherit; font-size: 0.8125rem; letter-spacing: 0.16em; text-transform: uppercase;
}
.menu-btn[aria-expanded="true"] { background: var(--navy); color: var(--white); }

.app-body { display: block; }

.sidebar { background: var(--off-white); }
.mod-list { list-style: none; margin: 0; padding: 0; }
.mod-list li { border-bottom: 1px solid rgba(11, 31, 58, 0.18); }
.mod-list .row {
  display: flex; align-items: center; gap: 12px;
  min-height: 48px; padding: 10px 20px; text-decoration: none; font-size: 0.9375rem; line-height: 1.35;
}
.mod-list a.row:hover { background: var(--white); color: var(--navy-light); }
.mod-list a.row[aria-current="page"] { background: var(--navy); color: var(--white); }
.mod-list a.row:focus-visible { outline-offset: -3px; }
.mod-list a.row[aria-current="page"]:focus-visible { outline-color: var(--white); }
.mod-list .locked { display: flex; align-items: center; justify-content: space-between; padding-right: 16px; }
.mod-list .locked .row { color: var(--muted); padding-right: 8px; }
.upgrade { flex: none; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; min-height: 44px; display: inline-flex; align-items: center; }
.dl-row { border-top: var(--line); margin-top: 12px; }
.ico { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }

.account { padding: 24px 20px 32px; }
.account p { margin: 0 0 4px; }
.account-tier { font-family: var(--serif); font-size: 1.375rem; }
.account-email { font-size: 0.875rem; color: var(--muted); overflow-wrap: anywhere; }

/* Phone: the sidebar is a panel opened by the Modules button */
@media (max-width: 899px) {
  .sidebar {
    display: none; position: fixed; z-index: 15; top: 64px; left: 0; right: 0; bottom: 0;
    overflow-y: auto; border-bottom: var(--line);
  }
  .sidebar.open { display: block; }
}
@media (min-width: 900px) {
  .menu-btn { display: none; }
  .app-body { display: grid; grid-template-columns: 300px minmax(0, 1fr); }
  .sidebar {
    position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto;
    border-right: var(--line);
  }
}

/* Content column */
.content { min-width: 0; padding: 40px 20px 80px; }
.content:focus { outline: none; }
#view, .pager { max-width: 46rem; margin: 0 auto; }
.view-title { font-size: clamp(2.25rem, 7vw, 3rem); margin-bottom: 16px; }
.loading { padding: 40px 0; }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 56px; padding-top: 24px; border-top: var(--line); }
.pager .btn { cursor: pointer; }
.pager #next { margin-left: auto; }
.btn-outline { background: var(--white); color: var(--navy); }
.btn-outline:hover { background: var(--off-white); color: var(--navy); }

/* Downloads */
.dl-list { list-style: none; padding: 0; margin: 24px 0 0; border-top: var(--line); }
.dl-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; padding: 20px 0; border-bottom: var(--line); }
.dl-list p { margin: 0; }
.dl-title { font-family: var(--serif); font-size: 1.375rem; }
.dl-list .small { overflow-wrap: anywhere; }
.dl-list .btn { cursor: pointer; }

/* Watermark: tiled inline SVG set by members.js */
.watermark { position: fixed; inset: 0; z-index: 30; pointer-events: none; background-repeat: repeat; }

/* Copy deterrent (see members.js): no selecting except inside prompt boxes and form fields */
body.protected { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.protected .prompt-box, body.protected .prompt-box * { -webkit-user-select: text; user-select: text; }
body.protected .prompt-box .copy-btn, body.protected .ws .strong > b:first-child { -webkit-user-select: none; user-select: none; }
body.protected input, body.protected textarea { -webkit-user-select: text; user-select: text; }
body.protected img { -webkit-user-drag: none; }

.copy-btn {
  position: absolute; top: 8px; right: 8px; z-index: 1;
  min-height: 36px; padding: 4px 12px; cursor: pointer;
  background: var(--white); color: var(--navy); border: var(--line);
  font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase;
}
.copy-btn:hover { background: var(--navy); color: var(--white); }

@media print { body { display: none; } }
