:root {
  color-scheme: light;
  --bg1: #f4f8ff;
  --bg2: #eef5ff;
  --card: rgba(255, 255, 255, 0.92);
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --red: #e53935;
  --blue: #1976d2;
  --accent: #111827;
  --radius: 24px;
  --shadow: 0 30px 80px rgba(15, 23, 42, 0.14);
}

* { box-sizing: border-box; }

html, body {
  min-height: 100%;
  margin: 0;
}

body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 10%, rgba(229, 57, 53, 0.14), transparent 28%),
    radial-gradient(circle at 80% 15%, rgba(25, 118, 210, 0.16), transparent 30%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
}

.hp-login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.hp-login-wrap {
  width: min(430px, 100%);
}

.hp-login-brand {
  text-align: center;
  margin-bottom: 18px;
}

.hp-login-brand img,
.hp-login-brand .hp-login-logo {
  width: auto;
  height: 88px;
  max-width: min(220px, 100%);
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
}

.hp-login-brand h1 {
  margin: 14px 0 0;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.hp-login-brand::after {
  content: "Planung · Simulation · Ausschreibung · Vergabe";
  display: block;
  margin-top: 7px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
}

.hp-login-card {
  background: var(--card);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.hp-login-card h2 {
  margin: 0;
  text-align: center;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.hp-login-lead {
  margin: 8px auto 24px;
  max-width: 310px;
  text-align: center;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.94rem;
}

.hp-field {
  margin-bottom: 15px;
}

.hp-field label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #334155;
}

.hp-field input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  font: inherit;
  background: #f8fafc;
  color: var(--text);
  transition: 0.18s ease;
}

.hp-field input:focus {
  outline: none;
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(25, 118, 210, 0.12);
}

.hp-pw-row {
  position: relative;
}

.hp-pw-row input {
  padding-right: 86px;
}

.hp-pw-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.hp-btn {
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 15px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--blue));
  box-shadow: 0 16px 35px rgba(25, 118, 210, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.hp-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 42px rgba(25, 118, 210, 0.32);
}

.hp-btn:active {
  transform: translateY(0);
}

.hp-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.hp-btn--ghost {
  color: var(--accent);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: none;
}

.hp-btn--ghost:hover {
  background: #f8fafc;
  box-shadow: none;
  transform: none;
}

.hp-forgot-link {
  display: inline-block;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.hp-forgot-link:hover {
  text-decoration: underline;
}

.hp-forgot-hint {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.hp-forgot-success p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.hp-forgot-success .hp-btn {
  width: 100%;
}

.hp-forgot-success[hidden] {
  display: none !important;
}

.hp-forgot {
  margin: 14px 0 0;
  text-align: center;
}

.hp-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 800;
}

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

.hp-alert {
  display: none;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
}

.hp-alert.is-visible {
  display: block;
}

.hp-alert--error {
  background: #fef2f2;
  color: #b91c1c;
}

.hp-alert--success {
  background: #ecfdf5;
  color: #047857;
}

.hp-alert code {
  font-size: 0.85em;
}

.hp-info {
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px solid rgba(25, 118, 210, 0.16);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(229, 57, 53, 0.06), rgba(25, 118, 210, 0.08));
  color: #334155;
  font-size: 0.88rem;
  line-height: 1.45;
}

.hp-info strong {
  color: var(--text);
}

.hp-pwa {
  margin-top: 16px;
  padding: 18px 18px 16px;
  border: 1px solid rgba(25, 118, 210, 0.18);
  border-radius: 20px;
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
  box-shadow: 0 18px 42px rgba(255, 138, 76, 0.14);
}

.hp-pwa-lead {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.hp-pwa-install-btn {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid rgba(25, 118, 210, 0.32);
  border-radius: 14px;
  background: #fff;
  color: var(--blue);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(255, 152, 0, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hp-pwa-install-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(255, 152, 0, 0.26);
}

.hp-pwa-status {
  margin: 10px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

body.hp-pwa-modal-open {
  overflow: hidden;
}

.hp-pwa-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px 16px;
}

.hp-pwa-modal[hidden] {
  display: none !important;
}

.hp-pwa-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.hp-pwa-modal__panel {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  max-height: min(88vh, 640px);
  overflow: auto;
  padding: 22px 20px 20px;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
}

.hp-pwa-modal__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.hp-pwa-modal__head img {
  border-radius: 0;
  object-fit: contain;
}

.hp-pwa-modal__head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hp-pwa-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.hp-pwa-modal__panel .hp-btn {
  margin-top: 16px;
}

.hp-pwa-modal-note {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.hp-pwa-steps {
  margin: 0;
  padding-left: 1.15rem;
  color: #334155;
  font-size: 0.88rem;
  line-height: 1.55;
}

.hp-pwa-steps li + li {
  margin-top: 8px;
}

.hp-pwa-hint {
  display: none;
  padding: 14px 14px 12px;
  border-radius: 14px;
  font-size: 0.84rem;
  line-height: 1.5;
  border: 1px solid transparent;
}

.hp-pwa-hint.is-visible,
.hp-pwa-hint:not([hidden]) {
  display: block;
}

.hp-pwa-hint strong {
  display: block;
  margin-bottom: 10px;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hp-pwa-hint p {
  margin: 0;
  color: #334155;
}

.hp-pwa-hint--ios {
  background: linear-gradient(135deg, rgba(25, 118, 210, 0.12), rgba(25, 118, 210, 0.04));
  border-color: rgba(25, 118, 210, 0.22);
}

.hp-pwa-hint--ios strong {
  color: #1565c0;
}

.hp-pwa-hint--android {
  background: linear-gradient(135deg, rgba(46, 125, 50, 0.12), rgba(46, 125, 50, 0.04));
  border-color: rgba(46, 125, 50, 0.22);
}

.hp-pwa-hint--android strong {
  color: #2e7d32;
}

.hp-pwa-hint--desktop {
  background: linear-gradient(135deg, rgba(229, 57, 53, 0.1), rgba(229, 57, 53, 0.04));
  border-color: rgba(229, 57, 53, 0.2);
}

.hp-pwa-hint--desktop strong {
  color: #c62828;
}

.hp-pwa-kbd {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.1);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}

.hp-pwa-kbd--icon {
  min-width: 1.6em;
  text-align: center;
  padding-inline: 6px;
}

/* Registrierung vorerst ausblenden — Klasse is-hidden am Wrapper .hp-register-promo entfernen */
.hp-register-promo.is-hidden {
  display: none;
}

.hp-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0 16px;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hp-divider::before,
.hp-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.hp-signup {
  text-align: center;
}

.hp-signup p {
  margin: 0 0 10px;
  color: var(--text);
  font-weight: 800;
}

.hp-signup .hp-btn {
  margin-top: 8px;
}

.hp-footer {
  margin-top: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.hp-footer a {
  color: var(--muted);
  text-decoration: none;
  margin: 0 5px;
}

.hp-footer a:hover {
  color: var(--text);
}

.hp-panel {
  display: none;
}

.hp-panel.is-active {
  display: block;
}

.hp-setup {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.hp-setup h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 800;
}

.hp-setup p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

@media (max-width: 480px) {
  .hp-login-page {
    padding: 14px;
    align-items: start;
  }

  .hp-login-card {
    padding: 24px 18px;
    border-radius: 22px;
  }

  .hp-login-brand {
    margin-top: 10px;
  }
}
