/*
 * Styles für den CMS-Bereich.
 *
 * Gestaltung wie der CMS-Drawer im Design-Entwurf: schwarze Kopfleiste,
 * rote Abschnittstitel, Formularfelder mit beigem Rahmen.
 */

:root {
  --red: #e63329;
  --red-dark: #b7241c;
  --yellow: #fab400;
  --ink: #1a1a1a;
  --paper: #f4f1ec;
  --white: #ffffff;
  --field-border: #dad6ce;
  --label: #6a6a6a;
  --quiet: #9a9a9a;
  --green: #1a8a3c;
  --sans: 'Fira Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --condensed: 'Fira Sans Condensed', 'Fira Sans', Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--red);
}

a:hover {
  color: var(--red-dark);
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

/* Unsichtbar, aber für Screenreader und die Enter-Taste vorhanden. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- Kopfleiste ----------------------------------------------------------- */

.admin-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px clamp(16px, 4vw, 26px);
  background: var(--ink);
}

.admin-bar h1 {
  margin: 0;
  font-family: var(--condensed);
  font-weight: 800;
  font-size: clamp(20px, 4vw, 24px);
  color: var(--white);
}

.admin-bar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.admin-bar-actions a,
.admin-bar-actions button {
  border: 2px solid var(--white);
  background: transparent;
  color: var(--white);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 14px;
  padding: 7px 12px;
  cursor: pointer;
  text-decoration: none;
}

.admin-bar-actions a:hover,
.admin-bar-actions button:hover {
  background: var(--white);
  color: var(--ink);
}

/* --- Seitenaufbau --------------------------------------------------------- */

.admin-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 26px) 0;
}

.admin-meta {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--label);
}

.group {
  background: var(--white);
  border: 2px solid var(--field-border);
  padding: 20px clamp(16px, 3vw, 22px) 22px;
  margin-bottom: 20px;
}

.group > h2 {
  margin: 0 0 4px;
  font-family: var(--condensed);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.02em;
  color: var(--red);
}

.group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.group-head > h2 {
  margin: 0;
  font-family: var(--condensed);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.02em;
  color: var(--red);
}

.group-hint {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--label);
}

/* --- Formularfelder ------------------------------------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--label);
}

.field input[type='text'],
.field input[type='url'],
.field input[type='password'],
.field select,
.field textarea,
.repeat input:not([type='checkbox']),
.repeat select,
.repeat textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
  padding: 10px 12px;
  border: 2px solid var(--field-border);
  background: var(--white);
  border-radius: 0;
}

.field textarea,
.repeat textarea {
  resize: vertical;
  line-height: 1.5;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.repeat input:focus,
.repeat select:focus,
.repeat textarea:focus {
  border-color: var(--ink);
  outline: none;
}

.field-note {
  font-weight: 400;
  font-size: 13px;
  color: var(--quiet);
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--red);
}

/* --- Wiederholbare Blöcke (Tage, Regel-Kategorien) ------------------------ */

.repeat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  margin-top: 14px;
  background: var(--paper);
  border: 2px solid var(--field-border);
}

.repeat-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--label);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Der Abstand kommt hier vom gap des Blocks. */
.repeat .check {
  margin-top: 2px;
}

.repeat-foot {
  display: flex;
  justify-content: flex-end;
}

.empty-hint {
  margin: 14px 0 0;
  padding: 14px;
  background: var(--paper);
  border: 2px dashed var(--field-border);
  font-size: 14px;
  color: var(--label);
}

/* --- Dateien -------------------------------------------------------------- */

.file-list {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 14px;
}

.file-list th,
.file-list td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--field-border);
  vertical-align: middle;
}

.file-list th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--label);
}

.file-list td:last-child {
  text-align: right;
  white-space: nowrap;
}

.file-thumb {
  display: block;
  width: 46px;
  height: 46px;
  object-fit: cover;
  border: 2px solid var(--field-border);
  background: var(--white);
}

.file-kind {
  display: inline-block;
  min-width: 46px;
  padding: 4px 6px;
  background: var(--ink);
  color: var(--white);
  font-family: var(--condensed);
  font-weight: 800;
  font-size: 13px;
  text-align: center;
}

.upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid var(--field-border);
}

.upload-row input[type='file'] {
  font-family: var(--sans);
  font-size: 14px;
}

/* --- Buttons -------------------------------------------------------------- */

.btn-primary,
.btn-outline,
.btn-small,
.btn-danger,
.btn-quiet {
  font-family: var(--sans);
  cursor: pointer;
  border-radius: 0;
}

.btn-primary {
  border: none;
  background: var(--red);
  color: var(--white);
  font-family: var(--condensed);
  font-weight: 800;
  font-size: 20px;
  padding: 12px 26px;
}

.btn-primary:hover {
  background: var(--red-dark);
}

.btn-outline {
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  padding: 11px 16px;
}

.btn-outline:hover {
  background: var(--ink);
  color: var(--white);
}

.btn-small {
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 12px;
}

.btn-small:hover {
  background: var(--ink);
  color: var(--white);
}

.btn-danger {
  border: none;
  background: transparent;
  color: var(--red);
  font-weight: 700;
  font-size: 13px;
  padding: 4px 2px;
}

.btn-danger:hover {
  text-decoration: underline;
}

.btn-quiet {
  border: none;
  background: transparent;
  color: var(--quiet);
  font-weight: 700;
  font-size: 13px;
  padding: 4px 2px;
}

.btn-quiet:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* --- Aktionsleiste unten -------------------------------------------------- */

.admin-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 16px 0;
  margin-top: 4px;
  background: var(--paper);
  border-top: 2px solid var(--field-border);
}

.admin-actions .spacer {
  flex: 1;
}

/* --- Meldungen ------------------------------------------------------------ */

.message {
  margin: 0 0 18px;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  border-left: 6px solid var(--ink);
  background: var(--white);
}

.message--ok {
  border-left-color: var(--green);
  color: #12652c;
}

.message--error {
  border-left-color: var(--red);
  color: var(--red-dark);
}

.message--confirm {
  border-left-color: var(--yellow);
}

.message--confirm .confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

/* --- Login ---------------------------------------------------------------- */

.login-page {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  padding: clamp(28px, 10vh, 96px) 20px;
}

.login-card {
  width: 100%;
  max-width: 430px;
  background: var(--white);
  border: 3px solid var(--ink);
  padding: 0;
}

.login-card-head {
  background: var(--ink);
  padding: 18px 24px 20px;
}

.login-logo {
  display: block;
  height: 24px;
  width: auto;
  margin-bottom: 14px;
  color: var(--white);
}

.login-card-head h1 {
  margin: 0;
  font-family: var(--condensed);
  font-weight: 800;
  font-size: 26px;
  color: var(--white);
}

.login-card-head p {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--yellow);
}

.login-card-body {
  padding: 22px 24px 26px;
}

.login-card-body p {
  margin: 0 0 4px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--label);
}

.login-error {
  margin: 0 0 14px;
  padding: 11px 14px;
  background: #fdecea;
  border-left: 6px solid var(--red);
  font-size: 14px;
  font-weight: 700;
  color: var(--red-dark);
}

.login-submit {
  margin-top: 18px;
}

.login-back {
  display: inline-block;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 700;
}
