/*
 * OfficePress invitation and guest review pages (stylesheet slot 14, after account.css, before admin.css). Only --op-*
 * and the remapped --wf-* tokens appear here. These two page families are reached by a link, not by signing in, so they
 * carry the product identity with none of the workspace: no sidebar, header, account menu or mode control. The record
 * itself comes from record.css (`record-surface`, `.record-page`) and the card from account.css (`.verify-page`); this
 * sheet adds only what is specific to them.
 *
 *   [data-invitation-page]   the invitation card: its state (ready, mismatch, invalid, incomplete, failed) tints the icon
 *                            tile and nothing else; the state is always named in the heading
 *   [data-guest-state]       the guest holding card (opening, refused, offline), same tile treatment
 *   .guest-page              the limited record: a lockup bar with a "Guest review" tag, the access notice, then the record
 *   .guest-comment           the one form a guest has, with its validation, confirmation and limit message
 *
 * Nothing here relies on colour alone: the limited state is a tag and a notice in words, an error keeps its glyph and
 * weight, a confirmation has its tick, and the guest-link marker is the outlined words from record.css. Rules start from
 * `.guest-page` or `.verify-page` so they beat r005/workspace.css, which the guest page loads after the theme list.
 */

/* ---------- Invitation and guest holding cards ---------- */

/* A page that cannot be used reads neutral, as the global error card does; a state that asks for action keeps the tint. */
[data-invitation-page][data-state="invalid"] .verify-mark,
[data-invitation-page][data-state="used"] .verify-mark,
[data-guest-state="refused"] .verify-mark { border-color: var(--op-border-strong); background: var(--op-sunken); color: var(--op-text-2); }

[data-invitation-page][data-state="mismatch"] .verify-mark,
[data-invitation-page][data-state="incomplete"] .verify-mark,
[data-invitation-page][data-state="failed"] .verify-mark,
[data-guest-state="offline"] .verify-mark { border-color: var(--op-warning); background: var(--op-warning-tint); color: var(--op-text); }

/* Several actions share one card (Continue, Switch, Sign in, Try again): only the visible one takes space, and a second
   action under a first is the quiet one. */
.verify-page .verify-card > form,
.verify-page .verify-card > .button { margin-top: var(--op-space-4); }
.verify-page .verify-card > form[hidden],
.verify-page .verify-card > .button[hidden] { display: none; }
.verify-page .verify-card > form .button { width: 100%; min-height: var(--op-input-h); }
/* The Show / Hide button beside a password field (setup, reset, e-mail change) sits in such a form too; it keeps its own width. */
.verify-page .verify-card > form .verify-password-control .button { width: auto; }
.verify-page .verify-card > .button + .help,
.verify-page .verify-card > form + .help { margin-top: var(--op-space-4); }
.verify-page .verify-card > .button:disabled,
.verify-page .verify-card > form .button:disabled { cursor: progress; }

/* ---------- Guest record ---------- */

/* The bar says where the reader is before any content does: the lockup, and the tag that this is a limited view. */
.guest-page .guest-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--op-space-2) var(--op-space-4);
  margin-bottom: var(--op-space-5);
}
.guest-page .guest-bar .verify-brand { margin: 0; }

.guest-page .guest-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--op-space-2);
  min-height: 28px;
  padding: 0 var(--op-space-3);
  border: 1px solid var(--op-control-border);
  border-radius: var(--op-radius-full);
  background: var(--op-surface);
  color: var(--op-text);
  font: var(--op-text-caption);
  font-weight: 700;
  white-space: nowrap;
}
.guest-page .guest-badge .icon { width: 14px; height: 14px; color: var(--op-accent-ink); }

/* What a guest may do, said before the request: a tinted band with an accent edge, never mistaken for a status banner. */
.guest-page > .guest-notice {
  margin: 0 0 var(--op-space-4);
  padding: var(--op-space-4) var(--op-space-5);
  border: 1px solid var(--op-tint-2);
  border-left: 4px solid var(--op-accent-strong);
  border-radius: var(--op-radius-8);
  background: var(--op-tint);
}
.guest-page .guest-notice p { margin: 0; color: var(--op-text); font: var(--op-text-body); line-height: 1.6; overflow-wrap: anywhere; }
.guest-page .guest-notice strong { font-weight: 700; }
/* The link sits on the accent tint, where the link colour measures under 4.5:1: it takes the body ink and keeps its underline. */
.guest-page .guest-notice a { display: inline-block; padding: var(--op-space-1) 0; color: var(--op-text); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

/* The title takes focus from script when the record opens, so a screen reader starts on it; it is not a control. */
.guest-page .record-header h1:focus { outline: 0; }

/* A guest sees the same flat record; its sections need only the room that the narrower card leaves. */
.guest-page .guest-more { margin-top: var(--op-space-3); }
.guest-page .guest-file + .guest-file { margin-top: 0; }
.guest-page .guest-file > .error { margin: var(--op-space-2) 0 var(--op-space-3); padding: var(--op-space-2) var(--op-space-3); border: 1px solid var(--op-danger); border-radius: var(--op-radius-8); background: var(--op-danger-tint); }
.guest-page .guest-file .file-row .button { flex: 0 0 auto; }

/* ---------- Guest comment form ---------- */

.guest-page .guest-comment { margin-top: var(--op-space-5); }
.guest-page .guest-comment .help { max-width: 68ch; color: var(--op-text-2); }
.guest-page .guest-comment .error { margin: 0; padding: var(--op-space-3); border: 1px solid var(--op-danger); border-radius: var(--op-radius-8); background: var(--op-danger-tint); }
.guest-page .guest-comment .saved-note { margin: 0; padding: var(--op-space-2) var(--op-space-3); border: 1px solid var(--op-tint-2); border-radius: var(--op-radius-8); background: var(--op-tint); font: 600 var(--wf-text-sm)/1.5 var(--op-font); }

@media (max-width: 700px) {
  .verify-page .verify-card > form .button { min-height: 44px; }
  .guest-page .guest-bar { margin-bottom: var(--op-space-4); }
  .guest-page > .guest-notice { padding: var(--op-space-3) var(--op-space-4); }
  .guest-page .guest-comment .textarea { font-size: 16px; }
  .guest-page .guest-comment .button,
  .guest-page .guest-file .file-row .button { min-height: 44px; }
  .guest-page .guest-comment .button { width: 100%; }
}
