/* ============================================================
   login.css — Login-Seite
   WICHTIG: body-flex nur über .login-container-page oder
   direkt am login.php <body>-Tag, NICHT global
   ============================================================ */

/* ── Login-Seiten-Body (nur wenn .login-container existiert) ── */
html:has(.login-container) {
  overscroll-behavior: none;
  overflow: hidden;
  height: 100%;
}

body:has(.login-container) {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background: linear-gradient(145deg, #0a1628 0%, #0f2440 50%, #0a1f3a 100%);
  padding: 1.25rem;
  max-width: 100vw;
  touch-action: none;
}

/* Dekoratives Glow nur auf Login */
body:has(.login-container)::before {
  content: '';
  position: fixed;
  top: -10%; left: 50%; transform: translateX(-50%);
  width: 800px; height: 600px;
  background: radial-gradient(ellipse, rgba(0,160,221,.15) 0%, transparent 65%);
  pointer-events: none; z-index: 0;
}
body:has(.login-container)::after {
  content: '';
  position: fixed;
  bottom: -5%; right: -5%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(245,158,11,.07) 0%, transparent 65%);
  pointer-events: none; z-index: 0;
}

/* ── Container ── */
.login-container {
  width: 100%; max-width: 420px;
  position: relative; z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow), 0 0 80px rgba(0,160,221,.08);
}

/* ── Header ── */
.login-header { text-align: center; margin-bottom: 2rem; }

.login-header::before {
  content: '';
  display: block;
  width: 56px; height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 0 28px rgba(0,160,221,.4);
  margin: 0 auto 1rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M20 7H4C2.9 7 2 7.9 2 9v11c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2zm0 12H4V9h16v10zm-8-8H8v4h4v-4zM1 5h22V3H1v2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 28px;
}

.login-header h1 {
  font-size: clamp(1.4rem, 5vw, 1.8rem);
  color: var(--text-1); line-height: 1.2;
}
.login-header h2 {
  font-family: var(--font-body);
  font-size: clamp(.9rem, 3.5vw, 1rem);
  font-weight: 400; color: var(--text-2); margin-top: .3rem;
}

/* ── Formular ── */
.login-form { display: flex; flex-direction: column; }

.login-form label {
  display: block; font-size: .76rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: .4rem; margin-top: 1rem;
}
.login-form label:first-of-type { margin-top: 0; }

.login-form input[type="text"],
.login-form input[type="password"] {
  display: block; width: 100%; padding: .88rem 1rem;
  background: var(--surface-2); border: 1px solid var(--border-2);
  border-radius: var(--r-sm); color: var(--text-1);
  font-family: var(--font-body); font-size: 16px; min-height: 50px;
  -webkit-appearance: none; appearance: none;
  transition: border-color .2s, box-shadow .2s;
}
.login-form input::placeholder { color: var(--text-3); }
.login-form input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0,160,221,.2);
}

.login-form button[type="submit"] {
  display: block; width: 100%; margin-top: 1.5rem; padding: .95rem 1rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff; font-family: var(--font-body); font-size: 1rem; font-weight: 700;
  border: none; border-radius: var(--r-sm); cursor: pointer; min-height: 50px;
  letter-spacing: .02em;
  box-shadow: 0 4px 20px rgba(0,160,221,.3);
  transition: box-shadow .2s, transform .1s;
}
.login-form button[type="submit"]:hover { box-shadow: 0 6px 28px rgba(0,160,221,.45); }
.login-form button[type="submit"]:active { transform: scale(.98); }

.register-link { text-align: center; color: var(--text-2); font-size: .88rem; margin-top: 1.25rem; }
.register-link a { color: var(--brand); font-weight: 500; }

@media (max-width: 640px) { .login-container { padding: 1.75rem 1.25rem; border-radius: var(--r); } }
@media (max-width: 360px) { .login-container { padding: 1.5rem 1rem; } }

/* ══ LOGIN MOBILE ══ */
@media (max-width: 768px) {

  /* Body: Login zentriert aber mehr Platz */
  html:has(.login-container) {
  overscroll-behavior: none;
  overflow: hidden;
  height: 100%;
}

body:has(.login-container) {
    padding: 1rem !important;
    align-items: center !important;
  }

  /* Container: fast volle Breite */
  .login-container {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: var(--r) !important;
    padding: 2rem 1.5rem 2.5rem !important;
  }

  /* Logo größer */
  .login-header::before {
    width: 64px !important;
    height: 64px !important;
    border-radius: 18px !important;
    background-size: 34px !important;
    margin-bottom: 1rem !important;
  }

  /* Titel größer */
  .login-header h1 {
    font-size: 1.8rem !important;
  }
  .login-header h2 {
    font-size: 1.05rem !important;
  }

  /* Labels */
  .login-form label {
    font-size: .82rem !important;
    margin-top: 1.1rem !important;
  }

  /* Inputs größer */
  .login-form input[type="text"],
  .login-form input[type="password"] {
    padding: 1rem 1.1rem !important;
    min-height: 54px !important;
    font-size: 16px !important;
    border-radius: 12px !important;
  }

  /* Button größer */
  .login-form button[type="submit"] {
    padding: 1.1rem !important;
    min-height: 56px !important;
    font-size: 1.05rem !important;
    border-radius: 12px !important;
    margin-top: 1.75rem !important;
  }
}
