/* Gängeviertel Selfservice — account screens.
   Page-specific rules for profile, notifications, invite, help, apps, error,
   logout and login. The system (tokens, type, buttons, cards, rows, focus)
   lives in design-system.css; only what is unique to these pages is here. */

/* ================================================================== */
/* Profile — an account page, not a form dump                         */
/* ================================================================== */

/* Identity header: avatar, name and contact on one surface card. */
.page-profile .identity {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  padding: var(--s-5);
}
.page-profile .identity .avatar-lg {
  width: 3.75rem;
  height: 3.75rem;
  font-size: 1.5rem;
}
.page-profile .identity .profile-body {
  min-width: 0;
}
.page-profile .identity h2 {
  margin: 0;
}
.account-handle,
.account-contact {
  margin: var(--s-1) 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.account-contact {
  color: var(--text);
}
.account-contact a {
  color: var(--link);
}

/* Membership rows: expiry moves under the group name so status and date read
   together, while the actions stay on the right. */
.membership-expiry {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}
.membership-expiry svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.membership-expiry.is-soon {
  color: var(--warning-text);
}
/* The leave action is destructive but restrained: an outline danger trigger,
   never a filled red block. */
.membership-row .action-disclosure > summary.btn-danger {
  background: transparent;
}
.membership-row .action-disclosure > summary.btn-danger:hover {
  background: var(--danger-soft);
}
.membership-row .disclosure-form {
  background: var(--bg-soft);
}

/* Email preferences: keep the form at a comfortable measure. */
.page-profile .settings-form {
  max-width: 40rem;
}

/* ================================================================== */
/* Notifications — events with title, body, time and read state       */
/* ================================================================== */

.page-notifications .notif-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.page-notifications .notif {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem 1rem;
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
/* Unread: a red left bar plus the dot already drawn by the system. Read rows
   stay quiet but identical in shape, so nothing jumps while scanning. */
.page-notifications .notif.is-unread {
  border-left: 3px solid var(--accent);
}
.page-notifications .notif-main h2 {
  font-size: 1.05rem;
  line-height: 1.35;
}
.page-notifications .notif-main h2 a {
  color: var(--text);
  text-decoration: none;
}
.page-notifications .notif-main h2 a:hover {
  text-decoration: underline;
}
.notif-time {
  display: block;
  margin: var(--s-1) 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}
.page-notifications .notif-text {
  margin: var(--s-2) 0 0;
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.6;
}
.page-notifications .notif-side {
  flex: none;
}

/* ================================================================== */
/* Invite — creating and mailing enrollment links                     */
/* ================================================================== */

.invite-panel {
  padding: clamp(1rem, 2.5vw, 1.4rem);
}
.invite-panel .section-head {
  margin-bottom: var(--s-3);
}
/* Each link is a row: usage + expiry on top, the copyable link, then actions. */
.invite-list {
  border-top: 1px solid var(--border);
}
.invite-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
  margin-bottom: var(--s-2);
}
.invite-expiry {
  color: var(--muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}
.invite-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  min-width: 0;
}
.invite-copy .btn {
  flex: none;
}
.invite-url {
  flex: 1 1 16rem;
  min-width: 0;
}
.invite-last {
  display: block;
  margin-top: var(--s-1);
}
.invite-create {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--s-2);
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--border);
}
.invite-create .form-note {
  margin: 0;
  max-width: 40ch;
}
.invite-create .invite-slots {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.invite-create-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--s-3);
}
.invite-create-form .field {
  margin-bottom: 0;
}
.invite-create-form .invite-qty input {
  width: 5.5rem;
}

/* ================================================================== */
/* Help — guide navigation and long Markdown prose                    */
/* ================================================================== */

/* A comfortable reading measure for documentation, slightly tighter than the
   default prose so long guides never run wall-to-wall. */
.page-help .prose p,
.page-help .prose li {
  max-width: 68ch;
}
.page-help .prose p {
  line-height: 1.7;
}
/* Heading hierarchy: more air above h2, a hairline that stays scannable. */
.page-help .prose h2 {
  margin-top: 1.6em;
  padding-bottom: 0.35rem;
}
.page-help .prose h3 {
  margin-top: 1.5em;
  font-size: 1.08rem;
}
/* Steps (ordered lists) read as steps: numbered markers in the accent, room
   between steps. */
.page-help .prose ol {
  padding-left: 1.5em;
}
.page-help .prose ol > li {
  margin: 0.4em 0;
  padding-left: 0.25em;
}
.page-help .prose code {
  white-space: normal;
  overflow-wrap: anywhere;
}
/* Inline code in running text never breaks the measure. */
.page-help .prose pre code {
  white-space: pre;
}

/* ================================================================== */
/* Apps — catalog tiles and the secondary manage section              */
/* ================================================================== */

.page-apps .app-grid {
  gap: var(--s-3);
}
.page-apps .app-card {
  gap: var(--s-2);
  padding: var(--s-4);
  border-radius: var(--radius-lg);
}
.page-apps .app-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  font-size: 1.15rem;
}
.page-apps .app-name {
  font-size: 1rem;
  font-weight: 600;
}
.page-apps .app-desc {
  font-size: 0.875rem;
  line-height: 1.5;
}
/* The external link is signalled by the trailing icon; on hover it lifts into
   the accent so "opens elsewhere" is unmistakable. */
.page-apps .app-open {
  color: var(--muted);
}
.page-apps .app-card:hover .app-open {
  color: var(--accent-text);
}
.page-apps .app-card:focus-visible .app-open {
  color: var(--accent-text);
}
/* The admin manage section is deliberately quieter than the catalog. */
.page-apps .admin-section {
  padding-top: var(--s-3);
  border-top: 1px solid var(--border);
}

/* ================================================================== */
/* Error and logout — small, calm, one clear action                   */
/* ================================================================== */

.page-error .error-code {
  font-weight: 700;
  letter-spacing: -0.02em;
}
.page-error .error-card {
  max-width: 30rem;
}
/* Logout: the recommended path stays clearly primary, the flag is a quiet
   sentence-case pill above the heading. */
.page-logout .logout-flag {
  font-size: 0.8125rem;
  font-weight: 500;
}
.page-logout .logout-choice h2 {
  font-size: 1.1rem;
}
.page-logout .logout-grid {
  align-items: stretch;
}

/* ================================================================== */
/* Login — widen the card so the German button label stays one line   */
/* ================================================================== */

/* "Mit Gängeviertel Login anmelden" wrapped to two lines inside the narrow
   25rem card. A slightly wider card keeps the primary action on one line at
   1440; on very small screens the label still wraps gracefully to two lines
   (the button grows in height, never overflows). */
.page-auth .auth-card {
  max-width: 28rem;
}
