/* =========================================================
   PAGE LOAD ANIMATION
   ========================================================= */

html {
  /* verhindert hässliches Aufblitzen */
  opacity: 0;
  animation: pageFadeIn .7s ease forwards;
}

.auth-card {
  opacity: 0;
  transform: translateY(12px);
  animation: cardFadeIn .8s ease .2s forwards;
}

/* Keyframes */
@keyframes pageFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Bewegungsreduktion respektieren */
@media (prefers-reduced-motion: reduce) {
  html,
  .auth-card {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* =========================================================
   GLOBAL / DESKTOP
   ========================================================= */

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  height: 100dvh;

  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.96), rgba(241,245,249,0.96)),
    url('../images/Background.jpg') no-repeat center center / cover;
}

/* Blur Overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: -1;
}

/* Container */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 1.5rem;
}

/* Card */
.auth-card {
  position: relative;
  background: rgba(255,255,255,0.98);
  border-radius: 18px;
  padding: 2.2rem 2rem;
  box-shadow:
    0 18px 40px rgba(15,23,42,0.10),
    0 0 0 1px rgba(209,213,219,0.9);
  width: 100%;
  max-width: 400px;
  color: #0f172a;
  overflow: hidden;
  max-height: 100dvh;
}

/* Deko */
.auth-card::before,
.auth-card::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(40px);
  opacity: 0.35;
  pointer-events: none;
}

.auth-card::before {
  width: 150px;
  height: 150px;
  background: radial-gradient(circle at center, rgba(34,197,94,0.85), transparent 65%);
  top: -50px;
  right: -30px;
}

.auth-card::after {
  width: 180px;
  height: 180px;
  background: radial-gradient(circle at center, rgba(59,130,246,0.8), transparent 70%);
  bottom: -70px;
  left: -50px;
}

.auth-card > * {
  position: relative;
  z-index: 1;
}

/* Branding im Login */
.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.2rem;
}

.auth-brand-logo {
  max-width: 140px;
  max-height: 140px;
  margin-bottom: .5rem;
}

.auth-brand-name {
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  word-break: break-word;
}

/* Title */
.auth-title {
  margin-bottom: 0.3rem;
  font-size: 1.7rem;
  font-weight: 600;
  color: #111827;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 1.4rem;
}

/* Form */
.user-form {
  text-align: left;
}

.user-form label {
  display: block;
  margin: 0.7rem 0 0.3rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: #111827;
}

.user-form input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(209,213,219,0.9);
  background: #ffffff;
  color: #0f172a;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.1s ease;
}

.user-form input:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(34,197,94,0.75);
  transform: translateY(-1px);
}

/* Captcha */
.captcha-wrap {
  margin: 1rem 0 0.5rem;
}

.captcha-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.captcha-row img {
  border-radius: 10px;
  border: 1px solid rgba(209,213,219,0.9);
}

/* Reload */
#captcha-reload {
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(209,213,219,0.95);
  background: #ffffff;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
  color: #111827;
}

/* Links */
.auth-links {
  display: flex;
  justify-content: space-between;
  margin: 0.3rem 0 1.1rem;
  font-size: 0.8rem;
  color: #6b7280;
}

/* Submit Button */
button[type="submit"] {
  width: 100%;
  padding: 0.65rem 0.9rem;
  margin-top: 0.6rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #ecfdf5;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease, filter 0.15s ease;
  box-shadow: 0 10px 22px rgba(22,163,74,0.35);
}

button[type="submit"]:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 12px 26px rgba(22,163,74,0.4);
}

button[type="submit"]:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(22,163,74,0.3);
}

/* Messages */
.alert,
.success {
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  margin-bottom: 0.9rem;
  font-size: 0.85rem;
}

/* optional: etwas abgestuft */
.alert {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* Status / Human-Check */
.status-row {
  margin: .5rem 0 1rem;
  font-size: .95rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .35rem .6rem;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.5);
  background: #f9fafb;
}

.status-pill[data-state="pending"] {
  opacity: .75;
}

.status-pill .dot {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
}

.dot.pending { background: #d4d4d8; }
.dot.ok      { background: #22c55e; }
.dot.fail    { background: #ef4444; }

.muted {
  opacity: .7;
}

/* =========================================================
   MOBILE (SMARTPHONE) – OVERRIDES
   ========================================================= */

@media (max-width: 480px) {

  body {
    padding: 0;
    height: 100dvh;
  }

  .auth-page {
    padding: 0.8rem;
  }

  .auth-card {
    padding: 1.2rem 1.1rem;
    max-width: 95%;
    max-height: 95dvh;
    transform: scale(.95);
  }

  .auth-brand-logo {
    max-width: 90px;
    max-height: 90px;
    margin-bottom: .35rem;
  }

  .auth-brand-name {
    font-size: 1rem;
  }

  .auth-title {
    font-size: 1.35rem;
    margin-bottom: 0.25rem;
  }

  .auth-subtitle {
    font-size: 0.8rem;
    margin-bottom: .8rem;
  }

  .user-form label {
    margin-top: .45rem;
    margin-bottom: .25rem;
    font-size: .8rem;
  }

  .user-form input {
    padding: 0.5rem 0.7rem;
    font-size: .85rem;
  }

  .captcha-wrap {
    margin: 0.7rem 0 0.4rem;
  }

  .captcha-row {
    gap: 0.5rem;
    margin-bottom: 0.4rem;
  }

  .auth-links {
    margin: 0.25rem 0 0.8rem;
    font-size: 0.75rem;
  }

  button[type="submit"] {
    padding: .55rem .7rem;
    font-size: .85rem;
    margin-top: 0.5rem;
  }

  .alert,
  .success {
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.7rem;
    font-size: 0.8rem;
  }

  .status-row {
    margin: .4rem 0 .8rem;
    font-size: .85rem;
  }
}
