:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --border: #dbe3ef;
  --text: #111827;
  --muted: #374151;
  --primary: #0066cc;
  --primary-dark: #064b9b;
  --primary-soft: #e8f2ff;
  --danger: #e53935;
  --danger-bg: #fff1f0;
  --success-bg: #e9f8ef;
  --radius: 14px;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 12%, rgba(0, 102, 204, 0.24), transparent 34%),
    radial-gradient(circle at 82% 88%, rgba(229, 57, 53, 0.12), transparent 32%),
    linear-gradient(145deg, #d8e6f7 0%, #edf3fb 45%, #f8fafc 100%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-shell {
  width: 100%;
  max-width: 480px;
}

.auth-shell.auth-wide {
  max-width: 760px;
}

.auth-card {
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid #cbd8ea;
  border-radius: 22px;
  box-shadow:
    0 28px 70px rgba(15, 23, 42, 0.16),
    0 0 0 1px rgba(255, 255, 255, 0.75) inset;
  padding: 34px;
  color: var(--text);
}

/* Branding / Logo */

.auth-brand {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin-bottom: 28px;
  text-align: center;
}

.auth-logo-frame {
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 38%, #e8eef7 0%, #d8e3f0 48%, #c7d4e4 100%);
  border: 1px solid #b8c7d9;
  box-shadow:
    0 16px 36px rgba(15, 23, 42, 0.12),
    0 0 0 6px rgba(255, 255, 255, 0.72);
}

.auth-logo-image {
  width: 92px;
  height: 92px;
  object-fit: contain;
  display: block;
}

.auth-brand-text {
  display: grid;
  gap: 2px;
}

.auth-brand-text span {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.auth-brand-text strong {
  font-size: 26px;
  line-height: 1.1;
  font-weight: 900;
  color: var(--text);
}

/* Alte Logo-Klassen als Fallback, falls sie noch irgendwo genutzt werden */

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 23px;
  color: var(--text);
  margin-bottom: 26px;
}

.auth-logo-mark {
  width: 38px;
  height: 38px;
  border: 2px solid var(--primary);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--primary);
  font-weight: 900;
}

/* Typografie */

.auth-card h1,
.auth-card .aa-h1 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.25;
  color: var(--text);
}

.auth-card h2,
.auth-card .aa-h2 {
  margin: 20px 0 8px;
  font-size: 18px;
  color: var(--text);
}

.auth-card p,
.auth-card .aa-p {
  color: #1f2937;
  line-height: 1.5;
}

.auth-card a {
  color: var(--primary);
  font-weight: 750;
  text-decoration: none;
}

.auth-card a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Formulare */

.auth-card form {
  display: grid;
  gap: 16px;
}

.auth-card form p {
  margin: 0;
}

.auth-card label {
  display: block;
  font-weight: 700;
  margin-bottom: 7px;
  color: var(--text);
}

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="number"],
.auth-card input[type="url"],
.auth-card input[type="tel"],
.auth-card input[type="search"],
.auth-card select,
.auth-card textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0 12px;
  font: inherit;
  color: var(--text);
  background: #ffffff;
}

.auth-card textarea {
  padding: 12px;
}

.auth-card input::placeholder,
.auth-card textarea::placeholder {
  color: #6b7280;
}

.auth-card input:focus,
.auth-card select:focus,
.auth-card textarea:focus {
  outline: 3px solid var(--primary-soft);
  border-color: var(--primary);
}

.auth-card .helptext,
.auth-card .aa-help {
  display: block;
  margin-top: 6px;
  color: #4b5563;
  font-size: 13px;
}

/* Fehler */

.auth-card ul.errorlist {
  list-style: none;
  margin: 0 0 6px;
  padding: 0;
  color: #991b1b;
  font-size: 13px;
  font-weight: 700;
}

/* Buttons */

.auth-card button,
.auth-card input[type="submit"],
.auth-card .aa-button {
  min-height: 44px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  font: inherit;
  display: inline-grid;
  place-items: center;
  text-align: center;
  text-decoration: none;
  padding: 0 16px;
}

.auth-card button:hover,
.auth-card input[type="submit"]:hover,
.auth-card .aa-button:hover {
  filter: brightness(0.96);
  text-decoration: none;
}

.auth-card button[name="action_remove"],
.auth-card .aa-button-danger {
  background: var(--danger);
}

.auth-card .aa-actions {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

/* Meldungen */

.auth-card .aa-alert {
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  line-height: 1.4;
  border: 1px solid #b7ebc6;
  background: var(--success-bg);
  color: #166534;
}

.auth-card .aa-alert-error {
  border: 1px solid #ffc7c3;
  background: var(--danger-bg);
  color: #991b1b;
}

/* Tabellen */

.auth-card table {
  width: 100%;
  border-collapse: collapse;
}

.auth-card th,
.auth-card td {
  border-bottom: 1px solid var(--border);
  padding: 10px;
  text-align: left;
  color: var(--text);
}

/* Footer */

.auth-footer {
  margin-top: 18px;
  color: #4b5563;
  font-size: 13px;
  text-align: center;
}

/* Mobile */

@media (max-width: 520px) {
  .auth-page {
    padding: 16px;
  }

  .auth-card {
    padding: 24px;
  }

  .auth-logo-frame {
    width: 104px;
    height: 104px;
    border-radius: 26px;
  }

  .auth-logo-image {
    width: 84px;
    height: 84px;
  }

  .auth-brand-text strong {
    font-size: 23px;
  }
}