:root{
  --panel: rgba(17, 25, 41, 0.42);
  --panel-strong: rgba(16, 24, 40, 0.56);
  --panel-border: rgba(255,255,255,0.16);
  --line: rgba(255,255,255,0.14);
  --line-soft: rgba(255,255,255,0.10);
  --text-dim: rgba(255,255,255,0.80);
  --text-soft: rgba(255,255,255,0.62);
  --primary: #3b82f6;
  --secondary: #22d3ee;
  --shadow: 0 30px 80px rgba(0,0,0,0.28);
  --shadow-soft: 0 18px 40px rgba(6, 24, 44, 0.22);
  --radius-xl: 28px;
  --radius-lg: 18px;
}

*,
*::before,
*::after{
  box-sizing: border-box;
}

/* FULLSCREEN */
html,
body{
  height: 100dvh;
  overflow: hidden;
  scrollbar-gutter: stable both-edges;
}

body{
  margin: 0;
  min-height: 100dvh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  color: #fff;
  overflow: hidden;
  position: relative;
  background:
    linear-gradient(115deg, rgba(6, 14, 28, 0.52), rgba(9, 18, 34, 0.20)),
    linear-gradient(180deg, rgba(7, 13, 25, 0.08), rgba(7, 13, 25, 0.28)),
    url("../img/login_bg.png") no-repeat center center fixed;
  background-size: cover;
}

body::before{
  content:"";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 22%, rgba(96,165,250,0.18), transparent 28%),
    radial-gradient(circle at 78% 72%, rgba(34,211,238,0.12), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.00));
}

body::after{
  content:"";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.045;
  background-image: radial-gradient(rgba(255,255,255,.12) 0.7px, transparent 0.7px);
  background-size: 18px 18px;
}

.bg-orb{
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(78px);
  z-index: -1;
  opacity: .24;
}

.bg-orb-one{
  width: 360px;
  height: 360px;
  top: 8%;
  left: 10%;
  background: rgba(59,130,246,.28);
  animation: floatOrbOne 14s ease-in-out infinite;
}

.bg-orb-two{
  width: 380px;
  height: 380px;
  right: 8%;
  bottom: 10%;
  background: rgba(34,211,238,.18);
  animation: floatOrbTwo 16s ease-in-out infinite;
}

/* NAVBAR */
.navbar{
  position: fixed;
  top: 18px;
  left: 22px;
  right: 22px;
  z-index: 20;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.navbar .container-fluid{
  padding: 0 !important;
}

.brand-wrap{
  display:flex;
  align-items:center;
  gap:12px;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(20, 29, 46, 0.34);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 12px 30px rgba(0,0,0,.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.navbar-brand{
  margin: 0;
  padding: 0;
}

.navbar-brand img{
  height: 46px;
  width: auto;
  display: block;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.22));
}

.brand-sub{
  font-size: .76rem;
  color: rgba(255,255,255,0.78);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
}

/* FOOTER */
footer{
  position: fixed;
  left: 22px;
  right: 22px;
  bottom: 18px;
  z-index: 15;
  padding: 0;
  background: transparent !important;
  border: 0 !important;
  text-align: center;
  color: rgba(255,255,255,0.88);
}

footer .container{
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 10px 18px;
  border-radius: 16px;
  background: rgba(20, 29, 46, 0.26);
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: 0 12px 30px rgba(0,0,0,.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

footer .small{
  color: rgba(255,255,255,0.74);
}

/* LAYOUT */
.login-page main{
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: clamp(80px, 12vh, 104px) clamp(16px, 4vw, 40px) clamp(70px, 10vh, 88px);
  box-sizing: border-box;
  overflow: hidden;
}

.login-page .container.py-4{
  width: 100%;
  max-width: 100%;
  padding: 0 !important;
}

.login-page .row{
  width: 100%;
  margin: 0;
}

.login-page .col-md-10.col-lg-7.col-xl-5{
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.page-pad-top{
  padding-top: 0;
}

.page-pad-bottom{
  padding-bottom: 0;
}

/* CARD */
.login-card{
  position: relative;
  width: min(440px, calc(100vw - 32px));
  max-width: 440px;
  margin-inline: auto;
  max-height: calc(100dvh - clamp(80px,12vh,104px) - clamp(70px,10vh,88px) - 16px);
  background:
    linear-gradient(180deg, rgba(24, 34, 56, 0.40), rgba(12, 20, 36, 0.34));
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(255,255,255,0.04) inset;
  overflow: hidden;
  backdrop-filter: blur(22px) saturate(135%);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
  transform-style: preserve-3d;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

/* Login-Inner scrollbar wenn Inhalt (z. B. Fehlermeldung) die Card-Höhe überschreitet */
.login-inner{
  overflow-y: auto;
  max-height: inherit;
  scrollbar-width: none;
}

.login-inner::-webkit-scrollbar{
  display: none;
}

.login-card::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(135deg, rgba(255,255,255,.16), transparent 34%),
    radial-gradient(circle at top right, rgba(59,130,246,.20), transparent 28%),
    radial-gradient(circle at bottom left, rgba(34,211,238,.10), transparent 24%);
}

.login-card::after{
  content:"";
  position:absolute;
  inset: 1px;
  border-radius: calc(var(--radius-xl) - 1px);
  border: 1px solid rgba(255,255,255,0.05);
  pointer-events:none;
}

.login-inner{
  position: relative;
  z-index: 1;
  padding: 2.45rem;
  background:
    linear-gradient(180deg, rgba(18, 28, 46, 0.38), rgba(12, 20, 34, 0.24));
}

.login-top{
  margin-bottom: 1.1rem;
}

.login-chip{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.86);
  font-size: .82rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
}

.login-chip-dot{
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, #34d399, #10b981);
  box-shadow: 0 0 0 6px rgba(16,185,129,0.12);
  animation: pulseDot 2.2s ease-in-out infinite;
}

.login-title{
  font-size: clamp(1.92rem, 2.4vw, 2.24rem);
  font-weight: 900;
  letter-spacing: -.03em;
  margin-bottom: .25rem;
  line-height: 1.08;
  text-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.login-sub{
  color: var(--text-dim);
  font-size: .98rem;
}

.login-meta{
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.meta-pill{
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.09);
  color: rgba(255,255,255,0.70);
  font-size: .78rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.divider{
  height: 1px;
  width: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.14), transparent);
  margin: 18px 0 20px 0;
}

/* FORM */
.form-label{
  color: rgba(255,255,255,0.84);
  font-weight: 700;
  font-size: .92rem;
  margin-bottom: .5rem;
}

.input-wrap{
  position: relative;
}

.input-icon{
  position:absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.62);
  pointer-events:none;
  transition: color .18s ease;
}

.input-wrap:focus-within .input-icon{
  color: rgba(125, 211, 252, 0.98);
}

.modern-input{
  background: rgba(255,255,255,0.10) !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
  color: #fff !important;
  border-radius: 16px;
  padding: 13px 72px 13px 42px;
  min-height: 56px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease, transform .18s ease;
}

.modern-input::placeholder{
  color: rgba(255,255,255,0.48);
}

.modern-input:hover{
  background: rgba(255,255,255,0.12) !important;
  border-color: rgba(255,255,255,0.18) !important;
}

.modern-input:focus{
  background: rgba(255,255,255,0.14) !important;
  border-color: rgba(59,130,246,0.46) !important;
  box-shadow:
    0 0 0 0.22rem rgba(59,130,246,0.16),
    0 10px 24px rgba(37,99,235,0.08) !important;
  outline: none;
}

.is-invalid{
  border: 1px solid rgba(220,53,69,0.84) !important;
  box-shadow: 0 0 0 0.22rem rgba(220,53,69,0.16) !important;
}

.password-toggle{
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(255,255,255,0.66);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}

.password-toggle:hover{
  color: rgba(255,255,255,0.96);
  background: rgba(255,255,255,0.08);
}

/* WebView2/Edge: natives Passwort-Auge ausblenden – nur unser eigenes anzeigen */
#password::-ms-reveal,
#password::-ms-clear,
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  display: none !important;
}

/* BUTTON */
.btn-modern{
  position: relative;
  overflow: hidden;
  border: none;
  font-weight: 800;
  font-size: 1rem;
  padding: 1rem 1rem;
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(37,99,235,0.96), rgba(34,211,238,0.92));
  color: #fff;
  box-shadow:
    0 18px 34px rgba(37,99,235,0.18),
    0 8px 18px rgba(34,211,238,0.08);
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
  min-height: 56px;
}

.btn-modern::before{
  content:"";
  position:absolute;
  top:0;
  bottom:0;
  left:-35%;
  width:30%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.32), transparent);
  transform: skewX(-18deg);
  transition: left .55s ease;
}

.btn-modern:hover{
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow:
    0 22px 38px rgba(37,99,235,0.22),
    0 10px 24px rgba(34,211,238,0.10);
}

.btn-modern:hover::before{
  left: 120%;
}

.btn-modern:active{
  transform: translateY(0);
}

.btn-modern:disabled{
  opacity: 1;
  filter: saturate(.94);
  cursor: wait;
}

.btn-modern-text,
.btn-modern-icon{
  position: relative;
  z-index: 1;
}

.btn-modern-icon{
  margin-left: .5rem;
}

.btn-modern.is-loading .btn-modern-icon{
  animation: pulseArrow 1s ease-in-out infinite;
}

/* ALERT */
.alert-danger{
  background: rgba(220,53,69,0.12);
  border: 1px solid rgba(220,53,69,0.26);
  color:#fff;
  border-radius: 14px;
  padding: .95rem 1rem;
  margin-bottom: 1rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.login-bottom small{
  color: rgba(255,255,255,0.66);
  font-size: .86rem;
}

::selection{
  background: rgba(37,99,235,0.32);
  color:#fff;
}

/* ENTRANCE */
body:not(.is-ready) .login-card{
  opacity: 0;
  transform: translateY(24px) scale(.985);
}

body:not(.is-ready) .brand-wrap,
body:not(.is-ready) footer .container{
  opacity: 0;
  transform: translateY(10px);
}

body.is-ready .login-card,
body.is-ready .brand-wrap,
body.is-ready footer .container{
  transition: opacity .55s ease, transform .55s ease;
  opacity: 1;
  transform: none;
}

/* RESPONSIVE */
@media (max-width: 576px){
  .navbar{
    top: 12px;
    left: 12px;
    right: 12px;
  }

  footer{
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .navbar-brand img{
    height: 38px;
  }

  .brand-copy{
    display: none !important;
  }

  .login-page main{
    padding-top: clamp(64px, 10vh, 84px);
    padding-bottom: clamp(60px, 9vh, 84px);
    padding-left: 12px;
    padding-right: 12px;
  }

  .login-card{
    width: min(100%, calc(100vw - 24px));
    max-width: 100%;
    max-height: calc(100dvh - clamp(64px,10vh,84px) - clamp(60px,9vh,84px) - 8px);
    overflow-y: auto;
  }

  .login-inner{
    padding: 1.6rem;
  }

  .bg-orb{
    display:none;
  }

  .login-meta{
    gap: 8px;
  }

  .meta-pill{
    font-size: .74rem;
  }
}

@media (prefers-reduced-motion: reduce){
  *,
  *::before,
  *::after{
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ANIMATIONS */
@keyframes floatOrbOne{
  0%,100%{
    transform: translate3d(0,0,0);
  }
  50%{
    transform: translate3d(18px, -14px, 0);
  }
}

@keyframes floatOrbTwo{
  0%,100%{
    transform: translate3d(0,0,0);
  }
  50%{
    transform: translate3d(-22px, 14px, 0);
  }
}

@keyframes pulseDot{
  0%,100%{
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16,185,129,0.28);
  }
  50%{
    transform: scale(1.08);
    box-shadow: 0 0 0 8px rgba(16,185,129,0.08);
  }
}

@keyframes pulseArrow{
  0%,100%{
    transform: translateX(0);
  }
  50%{
    transform: translateX(2px);
  }
}

/* ── Erstzugang-Chip ─────────────────────────────────────────────────────── */
.erstzugang-chip{
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(125,211,252,.30);
  color: rgba(186,230,253,.90);
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: .01em;
  transition: background .18s, border-color .18s, color .18s, box-shadow .18s;
  cursor: pointer;
  white-space: nowrap;
  min-height: 44px; /* tap target mobile */
}

.erstzugang-chip:hover,
.erstzugang-chip:focus-visible{
  background: rgba(125,211,252,.15);
  border-color: rgba(125,211,252,.55);
  color: #bae6fd;
  box-shadow: 0 0 0 3px rgba(125,211,252,.12);
  text-decoration: none;
}

.erstzugang-chip-icon{
  font-size: .78rem;
  opacity: .85;
}

/* EBT Desktop App: background-attachment:fixed doesn't work in WebView2 */
body.ebt-desktop{
  background:
    linear-gradient(115deg, rgba(6, 14, 28, 0.52), rgba(9, 18, 34, 0.20)),
    linear-gradient(180deg, rgba(7, 13, 25, 0.08), rgba(7, 13, 25, 0.28)),
    url("../img/login_bg.png") no-repeat center center scroll;
  background-size: cover;
  height: 100vh;
  min-height: 100vh;
}