/* account.css

   This stylesheet holds the rules of the logins: the account bar outside a menu bar, the login page and the parent page.
   It adds to waw.css and uses its tokens. The pages login.html and admin.html link it.
   The account in the menu bar of every page has its rules in top_bar.css.
   The child pages keep the tap size of 56 px and the text of 20 px. The parent page follows chapters 10, 11 and 13
   of the Design Guide R0.6 with controls of 36 px and body text of 14 px.

   Module: WAW, WasserWelt learning worlds
   PLAN: Yamiah/Framework/2026-11-15_PLAN_framework_DE.md, section 8 */

/* ---------- Account bar
   This block lays out the line with the name of the logged-in account and its buttons.
   The script account_bar.js fills every element with the attribute data-account-bar. */
.account-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--sp-3); min-height: var(--g-tap-size); }
.account-bar-name { margin-right: auto; font-size: var(--fs-child-large); font-weight: bold; }
.account-bar-name.is-compact { margin-right: 0; font-size: var(--fs-child); }

/* ---------- Login page
   This block lays out the login page: one card of 520 px with two or three fields and two buttons.
   Each field is 56 px high with a text of 20 px, so a child can tap and read it. */
.login-page { max-width: 520px; margin: 0 auto; padding: var(--sp-8) var(--sp-5); }
.login-card {
  display: flex; flex-direction: column; gap: var(--sp-4); padding: var(--sp-6);
  background: var(--c-page); border: 3px solid var(--c-border); border-radius: 26px; box-shadow: var(--shadow-card);
}
.login-field { display: flex; flex-direction: column; gap: var(--sp-1); }
.login-field label { font-size: var(--fs-child); font-weight: bold; }
.login-field input {
  width: 100%; min-height: var(--g-tap-size); padding: 0 var(--sp-4);
  font-family: var(--font-title); font-size: var(--fs-child-large); color: var(--c-text);
  background: var(--c-page); border: 2px solid var(--c-outline); border-radius: var(--g-radius-toy);
}
.login-field input[aria-invalid="true"] { border: 3px solid var(--c-danger); }
.login-hint { margin: 0; font-size: var(--fs-child); color: var(--c-text-2); }
.login-message {
  margin: 0; padding: var(--sp-3) var(--sp-4); font-size: var(--fs-child); font-weight: bold;
  color: var(--d-danger-ink); background: var(--d-danger-tint); border: 2px solid var(--d-danger); border-radius: var(--radius-card);
}
.login-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-3); }
.login-actions .button { flex: 1 1 auto; }

/* ---------- Parent page: tokens and base
   This block sets the sizes of an administration page of the Design Guide R0.6 for the page with the class is-admin.
   The page is 1360 px wide. Its body text has 14 px and its controls are 36 px high. */
.is-admin {
  --font-body: Arial, "Liberation Sans", "DejaVu Sans", Roboto, sans-serif;
  --font-badge: "Trebuchet MS", "DejaVu Sans", Roboto, sans-serif;
  --control-height: 36px;
  --control-height-sm: 28px;
  --badge-height: 20px;
  font-family: var(--font-body); font-size: 14px; line-height: 1.5; background: var(--c-page);
}
.is-admin h1, .is-admin h2, .is-admin h3 { margin: 0 0 var(--sp-3); font-family: var(--font-title); font-weight: 700; line-height: 1.3; }
.is-admin h1 { font-size: 24px; line-height: 1.25; }
.is-admin h2 { font-size: 18px; }
.admin-page { max-width: 1360px; margin: 0 auto; padding: var(--sp-8) var(--sp-5) 60px; }
.admin-lead { margin: 0 0 var(--sp-6); color: var(--c-text-2); }
.mono, .num { font-family: var(--font-data); font-size: 14px; }
.num { text-align: right; white-space: nowrap; }

/* ---------- Parent page: administration header
   This block draws the header of chapter 13.1: the orange line on top, the tag Verwaltung, the menu and the account. */
.admin-header {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-5); border-top: 3px solid var(--c-accent-2); border-bottom: 1px solid var(--c-border); background: var(--c-card);
}
.admin-brand { font-family: var(--font-title); font-size: 15px; font-weight: 700; }
.admin-menu { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-right: auto; }
.admin-menu .button[aria-current="page"] { border-color: var(--c-accent); border-width: 2px; color: var(--c-accent); }
.admin-account { color: var(--c-text-2); font-size: 12px; }
.admin-footer { max-width: 1360px; margin: 0 auto; padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--c-divider); color: var(--c-text-3); font-size: 12px; }

/* ---------- Parent page: buttons
   This block gives the buttons of the parent page the sizes of chapter 11.4. The colours come from waw.css. */
.is-admin .button {
  min-height: var(--control-height); min-width: 0; padding: 0 var(--sp-4); border-width: 1px; border-radius: var(--radius-control);
  font-size: 13px; white-space: nowrap;
}
.is-admin .button-primary:hover { border-color: var(--c-text); background: var(--c-text); color: var(--c-page); }
.is-admin .button-danger:hover { background: var(--c-danger); color: var(--c-page); }
.is-admin .button-ghost { border-color: transparent; background: transparent; }
.is-admin .button-ghost:hover { background: var(--c-hover); }
.is-admin .button-sm { min-height: var(--control-height-sm); padding: 0 var(--sp-3); font-size: 12px; }
.is-admin .button:disabled { border-color: var(--c-disabled); background: var(--c-disabled); color: var(--c-text-2); }
.button-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2); }
.button-row.is-start { justify-content: flex-start; }

/* ---------- Parent page: cards
   This block styles the card of chapter 11.5. One card holds one topic. */
.card { margin: 0 0 var(--sp-4); border: 1px solid var(--c-border); border-radius: var(--radius-card); background: var(--c-card); box-shadow: var(--shadow-card); }
.card-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5); border-bottom: 1px solid var(--c-divider);
}
.card-title { margin: 0; font-family: var(--font-title); font-size: 15px; font-weight: 700; }
.card-body { padding: var(--sp-4) var(--sp-5); }
.card-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.card-note { margin: 0 0 var(--sp-3); color: var(--c-text-2); font-size: 12px; }

/* ---------- Parent page: status words
   This block styles the status words of chapter 11.6. The word carries the meaning and the outline supports it. */
.badge {
  display: inline-flex; align-items: center; min-height: var(--badge-height); padding: 0 var(--sp-2);
  border: 1px solid var(--c-outline); border-radius: var(--radius-badge); background: var(--c-card); color: var(--c-text-2);
  font-family: var(--font-badge); font-size: 12px; font-weight: 700; line-height: 1.4; white-space: nowrap;
}
.badge-success { border-color: var(--c-text); color: var(--c-text); }
.badge-warning { border-color: var(--c-accent-2); border-style: dashed; }
.badge-danger { border-color: var(--c-danger); color: var(--c-danger); }
.badge-info { border-color: var(--c-accent); }
.badge-neutral { border-color: var(--c-border); background: var(--c-page); color: var(--c-text-3); }
.badge-list { display: flex; flex-wrap: wrap; gap: var(--sp-1); }

/* ---------- Parent page: fields
   This block styles the form fields of chapter 11.7: a label above its input, a hint and an error message. */
.field { display: grid; align-content: start; gap: var(--sp-1); margin: 0 0 var(--sp-4); }
.field label, .field-label { color: var(--c-text-2); font-family: var(--font-title); font-size: 12px; font-weight: 700; }
.field input, .field select, .field textarea, .row-input {
  box-sizing: border-box; width: 100%; min-height: var(--control-height); padding: 0 var(--sp-3);
  border: 1px solid var(--c-outline); border-radius: var(--radius-control); background: var(--c-page); color: var(--c-text);
  font-family: var(--font-body); font-size: 14px;
}
.field input[type="radio"], .field input[type="checkbox"] { flex: none; width: 18px; min-height: 18px; height: 18px; padding: 0; }
.field textarea { min-height: calc(var(--control-height) * 2); padding: var(--sp-2) var(--sp-3); resize: vertical; }
.field input:disabled, .field select:disabled { background: var(--c-card); color: var(--c-text-2); }
.field-hint { color: var(--c-text-3); font-size: 12px; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 var(--sp-4); }
.field-inline { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: 14px; }
.form-narrow { max-width: 960px; }
.row-list { display: grid; gap: var(--sp-2); margin: 0 0 var(--sp-2); padding: 0; list-style: none; }
.row-item { display: flex; align-items: center; gap: var(--sp-2); }
.row-item .row-number { flex: none; width: 24px; color: var(--c-text-3); font-family: var(--font-data); text-align: right; }
.row-item .row-input { flex: 1; min-width: 0; }

/* ---------- Parent page: alerts
   This block styles the message at the top of the content, chapter 11.8. Its first word names the state. */
.alert {
  display: flex; align-items: flex-start; gap: var(--sp-3); margin: 0 0 var(--sp-4); padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--c-outline); border-left-width: 4px; border-radius: var(--radius-control); background: var(--c-card); color: var(--c-text);
}
.alert-success { border-color: var(--c-text); }
.alert-error { border-color: var(--c-danger); }
.alert-title { font-family: var(--font-title); font-size: 13px; font-weight: 700; }
.alert-error .alert-title { color: var(--c-danger); }

/* ---------- Parent page: tables
   This block styles the tables of chapter 11.9. A wide table scrolls sideways inside its wrapper. Numbers are right aligned. */
.table-wrap { overflow-x: auto; margin: 0 0 var(--sp-4); border: 1px solid var(--c-border); border-radius: var(--radius-card); background: var(--c-page); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--c-divider); text-align: left; vertical-align: top; }
.table th { background: var(--c-card); color: var(--c-text-2); font-family: var(--font-title); font-size: 12px; font-weight: 700; white-space: nowrap; }
.table tbody tr:hover { background: var(--c-hover); }
.table tbody tr.is-selected { background: var(--g-water); }
.table .num { text-align: right; }
.table .cell-text { min-width: 240px; }
.table .cell-nowrap { white-space: nowrap; }
.table .cell-actions > span { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.table .cell-stack > span { flex-direction: column; align-items: flex-start; }
.table th.cell-wrap { white-space: normal; }
.empty { margin: 0; padding: var(--sp-4) var(--sp-5); color: var(--c-text-2); }
.kv { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-6); margin: 0 0 var(--sp-4); }
.kv dt { color: var(--c-text-3); font-size: 12px; }
.kv dd { margin: 0; font-family: var(--font-data); font-size: 14px; }

/* Honeypot field of the login page: off screen for people, still in the form for bots. */
.login-trap { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
