/* SPDX-License-Identifier: AGPL-3.0-only
 * SPDX-FileCopyrightText: 2021-2026 DALICC - Verein zur Foerderung der Rechtssicherheit in der Datenbewirtschaftung (ZVR 1249185710)
 */
/* DALICC account area: login, invitations, password forms, the account pages.
 *
 * Loaded after site.css and components.css, so every colour, font and spacing value
 * comes from the tokens on :root. The design language is the one the rest of the site
 * uses: a plain 1px frame in --c-rule-strong, full-width slate heading bars, dotted
 * rules, and no one-sided accent borders.
 */

/* ------------------------------------------------------------- auth pages */

.auth-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  gap: 40px;
  align-items: start;
}

/* A form with no explanation beside it (password change, reset, logout) sits in one
   centred column instead of leaving a wide empty gap on the right. */
.auth-page:has(> .auth-card:only-child) {
  grid-template-columns: minmax(0, 560px);
  justify-content: center;
}

.auth-page > .auth-card:only-child {
  max-width: 560px;
}

.auth-card {
  border: 1px solid var(--c-rule-strong);
  background: var(--c-surface);
  padding: 28px;
}

.auth-card h1 {
  margin-top: 0;
}

.auth-card .field:last-of-type {
  margin-bottom: 4px;
}

.auth-card__aside {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px dotted var(--c-rule-strong);
  font-size: 0.94em;
}

.auth-note {
  border: 1px solid var(--c-rule-strong);
  background: var(--c-peach);
  padding: 20px 24px;
  font-size: 0.94em;
}

.auth-note h2 {
  margin-top: 0;
  font-size: 20px;
}

.auth-note ul {
  padding-left: 20px;
}

.auth-note li {
  margin-bottom: 8px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* --------------------------------------------------------- invite summary */

.invite-summary {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 18px;
  margin: 0 0 24px;
  padding: 16px 18px;
  border: 1px solid var(--c-rule);
  background: var(--c-surface-alt);
}

.invite-summary dt {
  color: var(--c-slate-muted);
  font-weight: 600;
}

.invite-summary dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* -------------------------------------------------------- the account page */

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
  align-items: start;
}

.account-panel {
  border: 1px solid var(--c-rule-strong);
  padding: 20px 22px 24px;
  background: var(--c-surface);
}

.account-panel h2 {
  margin: -20px -22px 18px;
  padding: 10px 22px;
  background: var(--c-slate);
  color: var(--c-white);
  font-size: 18px;
}

/* Stacked, not two columns: these panels are narrow, and a label column wide enough
   for "Public profile address" would break an e-mail address one character per line. */
.account-facts {
  margin: 20px 0 0;
}

.account-facts dt {
  margin-top: 14px;
  color: var(--c-slate-muted);
  font-weight: 600;
}

.account-facts dt:first-child {
  margin-top: 0;
}

.account-facts dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.account-facts code {
  font-size: 0.82em;
}

.account-actions {
  list-style: none;
  margin: 0;
  padding: 0;
}

.account-actions li {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dotted var(--c-rule-strong);
}

.account-actions li:last-child {
  border-bottom: 0;
}

.account-actions .text-muted {
  flex: 1 1 200px;
  font-size: 0.92em;
}

.inline-form {
  display: inline-block;
  margin: 0;
}

/* --------------------------------------------------------- one-off secrets */

.secret-box {
  margin: 0 0 28px;
  padding: 18px 20px;
  border: 1px solid var(--c-red);
  background: var(--c-peach);
}

.secret-box__label {
  margin: 0 0 8px;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--c-slate-dark);
}

/* The value and its Copy button share one line while there is room, and the button
   keeps its own width so a long token wraps inside the value box and not under it. */
.secret-box__row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.secret-box__value {
  margin: 0;
  padding: 10px 12px;
  background: var(--c-white);
  border: 1px solid var(--c-rule-strong);
  overflow-wrap: anywhere;
  flex: 1 1 260px;
  min-width: 0;
}

.secret-box__copy {
  flex: 0 0 auto;
}

.secret-box__copy[data-copied="true"] {
  border-color: var(--c-green);
  background: var(--c-green);
  color: var(--c-white);
}

.secret-box__value code {
  background: none;
  padding: 0;
  font-size: 0.95em;
}

.secret-box__note {
  margin: 10px 0 0;
  font-size: 0.92em;
  color: var(--c-ink-soft);
}

/* ---------------------------------------------------------- form additions */

/* site.css styles text, search, email, url and date inputs but not password ones,
   which only the account area uses. Same declarations, so the two look identical. */
input[type="password"] {
  font-family: inherit;
  font-size: 17px;
  line-height: 1.4;
  color: var(--c-ink);
  background: var(--c-white);
  border: 1px solid var(--c-rule-strong);
  border-radius: var(--radius);
  padding: 10px 12px;
  width: 100%;
  max-width: 100%;
}

input[type="password"]:disabled {
  background: var(--c-pale-blue);
  color: var(--c-slate);
}

/* A role dropdown never needs the full column width. */
.field select {
  max-width: 420px;
}

.checkbox-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.checkbox-row label {
  margin: 0;
  font-weight: 400;
  text-transform: none;
}

/* ------------------------------------------------------------ breakpoints */

@media (max-width: 900px) {
  .auth-page {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
}

@media (max-width: 604px) {
  .auth-card {
    padding: 20px 16px;
  }

  .account-panel {
    padding: 16px 16px 20px;
  }

  .account-panel h2 {
    margin: -16px -16px 16px;
    padding: 10px 16px;
  }

  .invite-summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .invite-summary dd {
    margin-bottom: 10px;
  }
}
