:root {
  --ca-blue-900: #17286a;
  --ca-blue-800: #1b327f;
  --ca-blue-700: #213a95;
  --ca-blue-600: #374e9f;
  --ca-blue-500: #586bae;
  --ca-blue-100: #e9edf8;
  --ca-blue-050: #f4f6fb;
  --ca-black: #191919;
  --ca-muted: #686868;
  --ca-border: #d6deef;
  --ca-white: #ffffff;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(
      circle at 5% 0%,
      rgba(88, 107, 174, 0.18),
      transparent 29%
    ),
    radial-gradient(
      circle at 100% 100%,
      rgba(33, 58, 149, 0.14),
      transparent 27%
    ),
    linear-gradient(
      180deg,
      #f9faff 0%,
      var(--ca-blue-050) 100%
    ) !important;
}

/*
 * Der normale Header aus core/base.html wird ausschließlich
 * auf der Loginseite ausgeblendet.
 *
 * login.css wird nur in registration/login.html eingebunden.
 */
body > header {
  display: none !important;
}

/*
 * Der normale Content-Wrapper aus base.html wird für die
 * Loginseite auf volle Breite gesetzt.
 */
body > main {
  min-height: 100dvh !important;
  height: 100dvh !important;
}

body > main > div {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.ca-login-page,
.ca-login-page * {
  box-sizing: border-box;
}

.ca-login-page {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
  padding: 16px 22px;
  color: var(--ca-black);
}

.ca-login-page::before,
.ca-login-page::after {
  position: absolute;
  z-index: 0;
  border-radius: 999px;
  content: "";
  pointer-events: none;
  filter: blur(18px);
}

.ca-login-page::before {
  top: -150px;
  left: -110px;
  width: 360px;
  height: 360px;
  background: rgba(88, 107, 174, 0.10);
}

.ca-login-page::after {
  right: -90px;
  bottom: -170px;
  width: 390px;
  height: 390px;
  background: rgba(33, 58, 149, 0.10);
}

.ca-login-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns:
    minmax(0, 1.12fr)
    minmax(400px, 430px);
  gap: 26px;
  align-items: stretch;
  width: min(100%, 1420px);
  height: min(820px, calc(100dvh - 32px));
  min-height: 0;
  margin: 0 auto;
}

/* =========================================================
   Linker Branding-Bereich
   ========================================================= */

.ca-login-brand {
  position: relative;
  display: flex;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 32px;
  background:
    radial-gradient(
      circle at 92% 6%,
      rgba(255, 255, 255, 0.15),
      transparent 30%
    ),
    linear-gradient(
      145deg,
      var(--ca-black) 0%,
      #1c274c 48%,
      var(--ca-blue-700) 100%
    );
  box-shadow:
    0 28px 76px rgba(25, 25, 25, 0.20);
  color: var(--ca-white);
}

.ca-login-brand::before {
  position: absolute;
  top: 76px;
  right: -82px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  content: "";
}

.ca-login-brand-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  padding: 34px;
  text-align: center;
}


.ca-logo-panel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  min-height: 0;
  padding: 10px 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 20px;
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.92) 0%,
      rgba(233, 237, 248, 0.80) 100%
    );
  box-shadow:
    0 12px 30px rgba(7, 14, 39, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.ca-logo-panel img {
  display: block;
  width: 320px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
  transform: none;
}

.ca-brand-copy {
  width: 100%;
  max-width: 620px;
  margin: 32px auto 0;
  text-align: center;
}

.ca-eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.ca-login-brand .ca-eyebrow {
  color: rgba(255, 255, 255, 0.62);
}

.ca-brand-title {
  max-width: 600px;
  margin: 12px auto 0;
  font-size: clamp(34px, 3.2vw, 48px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-align: center;
}

.ca-brand-description {
  max-width: 560px;
  margin: 18px auto 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 15px;
  line-height: 1.65;
  text-align: center;
}

.ca-feature-list {
  display: grid;
  width: 100%;
  max-width: 760px;
  gap: 10px;
  margin: 28px auto 0;
}

.ca-feature {
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.075);
  text-align: center;
  backdrop-filter: blur(12px);
}

.ca-feature-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.ca-feature-text {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}

.ca-brand-footer {
  width: 100%;
  margin-top: auto;
  padding-top: 22px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 13px;
  text-align: center;
}

/* =========================================================
   Rechte Login-Karte
   ========================================================= */

.ca-login-form-column {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.ca-login-card {
  width: 100%;
  padding: 28px;
  border: 1px solid rgba(148, 163, 184, 0.23);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 26px 78px rgba(15, 23, 42, 0.10),
    0 2px 8px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(18px);
}

/*
 * Mobile Logo:
 * Auf kleineren Bildschirmen wird der linke Branding-Bereich
 * ausgeblendet. Das Logo erscheint dann über dem Formular.
 */
.ca-mobile-logo {
  display: none;
  justify-content: center;
  margin-bottom: 26px;
}

.ca-mobile-logo .ca-logo-panel {
  min-height: 0;
  padding: 8px 14px;
  border-color: rgba(214, 222, 239, 0.90);
  box-shadow:
    0 8px 24px rgba(33, 58, 149, 0.08);
}

.ca-mobile-logo .ca-logo-panel img {
  width: 240px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
  transform: none;
}

.ca-card-eyebrow {
  color: var(--ca-blue-500);
}

.ca-card-title {
  margin: 10px 0 0;
  font-size: 31px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.ca-card-description {
  margin: 10px 0 0;
  color: var(--ca-muted);
  font-size: 14px;
  line-height: 1.65;
}

/* =========================================================
   Fehlermeldungen
   ========================================================= */

.ca-login-error {
  margin-top: 22px;
  padding: 13px 15px;
  border: 1px solid #fecaca;
  border-radius: 15px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
  line-height: 1.55;
}

.ca-login-error p {
  margin: 0;
}

.ca-field-error {
  margin: 7px 0 0;
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.45;
}

/* =========================================================
   Formular und Felder
   ========================================================= */

.ca-login-form {
  display: grid;
  gap: 20px;
  margin-top: 30px;
}

.ca-field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

.ca-field-label {
  display: block;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
}

.ca-field-label-row .ca-field-label {
  margin: 0;
}

.ca-password-reset-link {
  color: var(--ca-blue-700);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.ca-password-reset-link:hover {
  color: var(--ca-blue-800);
  text-decoration: underline;
}

.ca-input-wrap {
  position: relative;
}

.ca-input-icon {
  position: absolute;
  top: 50%;
  left: 15px;
  z-index: 2;
  display: inline-flex;
  width: 20px;
  height: 20px;
  color: #94a3b8;
  pointer-events: none;
  transform: translateY(-50%);
}

.ca-input-icon svg {
  width: 20px;
  height: 20px;
}

/*
 * Die bestehenden Widget-Klassen aus apps/core/forms.py
 * werden hier ausschließlich auf der Loginseite überschrieben.
 *
 * Deshalb muss forms.py nicht angepasst werden.
 */
.ca-input-wrap input {
  display: block !important;
  width: 100% !important;
  height: 54px !important;
  margin: 0 !important;
  padding: 0 48px 0 45px !important;
  border: 1px solid var(--ca-border) !important;
  border-radius: 16px !important;
  outline: none !important;
  background: var(--ca-white) !important;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04) !important;
  color: var(--ca-black) !important;
  font: inherit !important;
  font-size: 15px !important;
}

.ca-input-wrap input::placeholder {
  color: #9aa7ba !important;
}

.ca-input-wrap input:focus {
  border-color: var(--ca-blue-700) !important;
  box-shadow:
    0 0 0 4px rgba(33, 58, 149, 0.12) !important;
}

.ca-password-toggle {
  position: absolute;
  top: 50%;
  right: 14px;
  z-index: 2;
  padding: 4px;
  border: 0;
  background: transparent;
  color: #7b879a;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transform: translateY(-50%);
}

.ca-password-toggle:hover {
  color: var(--ca-blue-700);
}

.ca-security-note {
  padding: 12px 14px;
  border: 1px solid #e4e9f5;
  border-radius: 15px;
  background: #f8faff;
  color: #68758a;
  font-size: 12px;
  line-height: 1.55;
}

.ca-login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 54px;
  padding: 0 24px;
  border: 1px solid var(--ca-blue-700);
  border-radius: 16px;
  background: var(--ca-blue-700);
  box-shadow:
    0 12px 28px rgba(33, 58, 149, 0.28);
  color: var(--ca-white);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.ca-login-button:hover {
  border-color: var(--ca-blue-800);
  background: var(--ca-blue-800);
  box-shadow:
    0 14px 32px rgba(33, 58, 149, 0.32);
  transform: translateY(-1px);
}

.ca-login-button:focus-visible {
  outline: 4px solid rgba(33, 58, 149, 0.16);
  outline-offset: 2px;
}

.ca-card-footer {
  margin: 24px 0 0;
  color: #98a2b2;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

/* =========================================================
   Tablet / Mobile
   ========================================================= */

@media (max-width: 1080px) {
  html,
  body {
    overflow: auto;
  }

  body > main {
    height: auto !important;
    min-height: 100dvh !important;
  }

  .ca-login-page {
    display: flex;
    align-items: center;
    min-height: 100dvh;
    height: auto;
    padding: 20px;
  }

  .ca-login-shell {
    display: block;
    height: auto;
    min-height: auto;
  }

  .ca-login-brand {
    display: none;
  }

  .ca-login-form-column {
    justify-content: center;
  }

  .ca-login-card {
    max-width: 480px;
  }

  .ca-mobile-logo {
    display: flex;
  }
}

@media (max-width: 600px) {
  .ca-login-page {
    padding: 16px;
  }

  .ca-login-card {
    padding: 26px 22px;
    border-radius: 24px;
  }

  .ca-mobile-logo .ca-logo-panel img {
    width: 180px;
  }

  .ca-card-title {
    font-size: 27px;
  }
}