*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  color-scheme: light dark;

  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #111827;
  --muted: #4b5563;
  --border: #d1d5db;

  --primary: #1d4ed8;
  --primary-hover: #1e40af;

  --focus: #ffcc00;

  --radius: 14px;
  --shadow: 0 14px 30px rgba(0,0,0,.10);
  --space: 16px;
  --control-h: 44px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --card: #111827;
    --text: #f9fafb;
    --muted: #cbd5e1;
    --border: #334155;

    --primary: #60a5fa;
    --primary-hover: #93c5fd;

    --shadow: 0 14px 30px rgba(0,0,0,.45);
  }
}

.ptls-auth {
  min-height: 100svh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(12px, 4vh, 40px) clamp(12px, 4vw, 24px);
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.ptls-auth__card {
  width: 100%;
  max-width: 520px;
  max-height: calc(100svh - clamp(24px, 8vh, 80px));
  max-height: calc(100dvh - clamp(24px, 8vh, 80px));
  overflow: visible;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(28px, 5vw, 44px) clamp(18px, 4vw, 28px) clamp(18px, 4vw, 28px);
  position: relative;
  margin-top: clamp(20px, 4vh, 28px);
}

.ptls-auth__badge {
  position: absolute;
  top: clamp(-30px, -6vw, -20px);
  left: 50%;
  transform: translateX(-50%);
  width: clamp(60px, 14vw, 76px);
  height: clamp(60px, 14vw, 76px);
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px rgba(0,0,0,.14);
  display: grid;
  place-items: center;
  text-decoration: none;
  transition: transform 150ms ease-out, box-shadow 150ms ease-out;
}

.ptls-auth__badge:hover {
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 12px 28px rgba(0,0,0,.18);
}

.ptls-auth__badge:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.ptls-auth__badgeLogo {
  width: clamp(40px, 10vw, 52px);
  height: clamp(40px, 10vw, 52px);
  display: block;
}

.ptls-auth__head {
  text-align: center;
  margin-bottom: 18px;
  padding-top: clamp(14px, 3vh, 22px);
}

.ptls-auth__title {
  margin: 0 0 6px 0;
  font-size: clamp(22px, 4.5vw, 28px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.ptls-auth__hint {
  margin: 0;
  color: var(--muted);
  font-weight: 700; /* slightly stronger, since it's now "Fahndung" */
  font-size: clamp(14px, 3.6vw, 16px);
}

.ptls-auth__form {
  margin-top: 20px;
}

.ptls-message {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fbbf24;
}

.typo3-messages {
  margin: 14px 0;
  width: 100%;
  max-width: 100%;
  text-align: center;
  padding-left: 0;
  padding-right: 0;
}


.typo3-messages .alert {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 8px;
  list-style: none;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.typo3-messages ul,
.typo3-messages li,
.typo3-messages .alert ul,
.typo3-messages .alert li {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}

.typo3-messages .alert-danger {
  background: #fee;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.typo3-messages .alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.typo3-messages .alert-success ul,
.typo3-messages .alert-success li {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}

.ptls-message ul,
.ptls-message li {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}

.typo3-messages .alert-info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.typo3-messages .alert-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fbbf24;
}

.ptls-field {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.ptls-label {
  font-weight: 600;
}

.ptls-input {
  width: 100%;
  height: var(--control-h);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: inherit;
  font: inherit;
}

.ptls-input:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.ptls-input:hover {
  border-color: var(--text);
}

.ptls-check {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.ptls-check__box {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.ptls-check__box:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.ptls-check__label {
  cursor: pointer;
  user-select: none;
}

.ptls-button {
  margin-top: 18px;
  width: 100%;
  height: var(--control-h);
  border: 2px solid transparent;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  transition: background-color 150ms ease-out;
}

.ptls-button:hover {
  background: var(--primary-hover);
}

.ptls-button:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.ptls-button:active {
  transform: scale(0.98);
}

.ptls-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ptls-auth__links {
  margin-top: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

@media (min-width: 480px) {
  .ptls-auth__links {
    flex-direction: row;
    justify-content: center;
    gap: 16px;
  }
}

.ptls-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 150ms ease-out;
}

.ptls-link:hover {
  text-decoration: underline;
}

.ptls-link:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Status Box Styles */
.ptls-auth__status {
  margin-top: 20px;
}

.ptls-status-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
}

.ptls-status-box__header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.ptls-status-box__title {
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ptls-status-box__content {
  padding: 16px;
}

.ptls-status-box__username {
  margin: 0 0 16px 0;
  font-size: 16px;
  color: var(--text);
}

.ptls-status-box__form {
  margin: 0;
}

.ptls-button--secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.ptls-button--secondary:hover {
  background: var(--bg);
  border-color: var(--text);
}

@media (prefers-color-scheme: dark) {
  .ptls-status-box__header {
    background: rgba(255, 255, 255, 0.03);
  }

  .ptls-button--secondary:hover {
    background: rgba(255, 255, 255, 0.05);
  }
}

@media (forced-colors: active) {
  .ptls-auth__card {
    border: 2px solid CanvasText;
    box-shadow: none;
  }

  .ptls-auth__badge {
    border: 2px solid CanvasText;
    box-shadow: none;
  }

  .ptls-input {
    border: 2px solid CanvasText;
  }

  .ptls-button {
    border: 2px solid ButtonText;
    background: ButtonFace;
    color: ButtonText;
  }

  .ptls-input:focus,
  .ptls-button:focus,
  .ptls-link:focus,
  .ptls-check__box:focus {
    outline: 3px solid Highlight;
  }
}

@media (max-width: 768px) {
  .ptls-auth {
    place-items: stretch;
    padding: 0;
    min-height: 100dvh;
  }

  .ptls-auth__card {
    max-width: none;
    width: 100%;
    min-height: 100dvh;
    max-height: none;
    padding: 80px 24px 32px;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    border: 0;
  }

  .ptls-auth__badge {
    width: 70px;
    height: 70px;
    top: 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,.12);
  }

  .ptls-auth__badgeLogo {
    width: 48px;
    height: 48px;
  }

  .ptls-auth__head {
    padding-top: 28px;
  }

  .ptls-auth__title {
    font-size: 26px;
  }

  .ptls-auth__hint {
    font-size: 15px;
  }
}

@media (max-height: 700px) {
  .ptls-auth {
    padding: 10px 12px;
  }

  .ptls-auth__card {
    max-height: calc(100dvh - 24px);
  }
}
