/* ============================================
   TheSheep Haushaltsbuch – Auth UI (Pro)
   - Keep dark/glass style, improve structure
   - Animated background (subtle)
   - No weird hover shadows / no bleed over panels
   ============================================ */

/* ---------- RESET ---------- */
*{margin:0;padding:0;box-sizing:border-box}
*,
*::before,
*::after{-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none}
*:focus{outline:none}
*::-moz-focus-inner{border:0}

/* ---------- TOKENS ---------- */
:root{
  --primary:#7c6cff;
  --primary-dark:#5b4dff;
  --gold:#d6b25e;
  --gold-2:#f5d77a;

  --bg-0:#070814;
  --bg-1:#0b1024;
  --bg-2:#17112a;

  --panel:rgba(255,255,255,.075);
  --panel-2:rgba(255,255,255,.095);
  --panel-border:rgba(255,255,255,.13);

  --text:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.62);
  --muted-2:rgba(255,255,255,.50);
  --danger:#ff9aa0;

  --radius:26px;
  --radius-sm:16px;

  --shadow: 0 18px 60px rgba(0,0,0,.42);
  --shadow-soft: 0 10px 28px rgba(0,0,0,.28);

  --ring: 0 0 0 4px rgba(124,108,255,.18);
  --ring-strong: 0 0 0 4px rgba(124,108,255,.26);

  --grid-gap: 22px;
}

/* ---------- BASE ---------- */
html{
  height:100%;
  width:100%;
  overflow-x:hidden;
  background: var(--bg-0);
}
body{
  min-height:100vh;
  min-height:-webkit-fill-available;
  width:100%;
  overflow-x:hidden;
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  background:
    radial-gradient(1100px 700px at 12% 12%, rgba(124,108,255,.32) 0%, rgba(124,108,255,0) 58%),
    radial-gradient(1000px 650px at 88% 22%, rgba(214,178,94,.18) 0%, rgba(214,178,94,0) 56%),
    radial-gradient(900px 650px at 50% 95%, rgba(16,185,129,.12) 0%, rgba(16,185,129,0) 60%),
    linear-gradient(135deg, var(--bg-0) 0%, var(--bg-1) 35%, var(--bg-2) 100%);
  background-attachment: fixed;
  overscroll-behavior:none;
}

/* ---------- ANIMATED BACKGROUND LAYER ---------- */
.auth-bg{
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:0;
  overflow:hidden;
}
.auth-bg::before{
  content:"";
  position:absolute;
  inset:-35%;
  background:
    radial-gradient(closest-side at 18% 24%, rgba(124,108,255,.26), rgba(124,108,255,0) 58%),
    radial-gradient(closest-side at 78% 30%, rgba(214,178,94,.18), rgba(214,178,94,0) 58%),
    radial-gradient(closest-side at 52% 86%, rgba(16,185,129,.12), rgba(16,185,129,0) 60%);
  filter: blur(34px) saturate(115%);
  opacity:.95;
  transform: translate3d(0,0,0);
  animation: auroraShift 16s ease-in-out infinite alternate;
}
.auth-bg::after{
  content:"";
  position:absolute;
  inset:0;
  opacity:.10;
  background-image:
    linear-gradient(rgba(255,255,255,.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.10) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(80% 70% at 50% 40%, rgba(0,0,0,1), rgba(0,0,0,0));
  animation: gridDrift 22s linear infinite;
}
.auth-bg .noise{
  position:absolute;
  inset:0;
  opacity:.07;
  mix-blend-mode: overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
}

/* ---------- LAYOUT ---------- */
.auth-page{
  position:relative;
  z-index:1;
  min-height:100vh;
  min-height:-webkit-fill-available;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 22px;
}

.auth-shell{
  width:100%;
  max-width: 1120px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.085), rgba(255,255,255,.06));
  border: 1px solid rgba(255,255,255,.13);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  overflow:hidden;              /* IMPORTANT: stop any glow bleeding over */
  isolation:isolate;            /* own stacking context -> clean layers */
}

.auth-pane{
  padding: 28px;
  display:flex;
  flex-direction:column;
  min-height: 560px;
}

.auth-pane--info{
  border-right: 1px solid rgba(255,255,255,.10);
  position:relative;
}
.auth-pane--info::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(900px 320px at 10% 0%, rgba(124,108,255,.16) 0%, rgba(124,108,255,0) 62%),
    radial-gradient(900px 320px at 92% 6%, rgba(214,178,94,.12) 0%, rgba(214,178,94,0) 64%);
  opacity:.95;
}
.auth-pane--info > *{position:relative; z-index:1}

.auth-pane--form{
  position:relative;
}
.auth-pane--form::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(900px 420px at 70% 10%, rgba(124,108,255,.10) 0%, rgba(124,108,255,0) 60%);
  opacity:.9;
}
.auth-pane--form > *{position:relative; z-index:1}

/* ---------- BRAND ---------- */
.auth-brand{
  display:flex;
  align-items:center;
  gap: 12px;
  margin-bottom: 18px;
}
.auth-brand-mark{
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display:grid;
  place-items:center;
  background: radial-gradient(120% 120% at 30% 20%,
    rgba(245,215,122,.22) 0%,
    rgba(214,178,94,.12) 40%,
    rgba(124,108,255,.12) 100%);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 14px 34px rgba(0,0,0,.42);
}
.auth-brand-mark img{
  width: 30px;
  height: 30px;
  display:block;
  filter: drop-shadow(0 10px 16px rgba(0,0,0,.35));
}
.auth-brand-title{
  font-size: 18px;
  font-weight: 950;
  letter-spacing:.2px;
  line-height:1.05;
}
.auth-brand-subtitle{
  font-size: 13px;
  font-weight: 750;
  color: var(--muted);
  line-height:1.05;
}

/* ---------- INFO CONTENT ---------- */
.auth-hero-title{
  font-size: 30px;
  line-height: 1.12;
  font-weight: 950;
  letter-spacing:.2px;
  margin: 8px 0 10px;
}
.auth-hero-subtitle{
  color: var(--muted);
  font-size: 14px;
  max-width: 58ch;
  margin-bottom: 18px;
}

.auth-badges{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
  margin-top: 14px;
}
.auth-badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.78);
  font-weight: 850;
  font-size: 12px;
}
.auth-badge svg{width:14px;height:14px;opacity:.92}

/* feature list */
.auth-features{
  list-style:none;
  display:grid;
  gap: 12px;
  padding:0;
  margin: 12px 0 0;
}
.auth-feature{
  display:flex;
  gap: 12px;
  align-items:flex-start;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  transition: transform .18s ease, border-color .18s ease, background-color .18s ease;
}
.auth-feature:hover{
  transform: translateY(-1px);
  border-color: rgba(124,108,255,.22);
  background: rgba(255,255,255,.075);
}
.auth-feature-icon{
  width: 42px;
  height: 42px;
  border-radius: 15px;
  display:grid;
  place-items:center;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.86);
  flex: 0 0 auto;
}
.auth-feature-icon svg{width:20px;height:20px}
.auth-feature-text strong{
  display:block;
  font-weight: 950;
  font-size: 14px;
  margin-bottom: 2px;
}
.auth-feature-text span{
  display:block;
  color: rgba(255,255,255,.68);
  font-size: 13px;
}

/* footer line in info pane */
.auth-info-footer{
  margin-top:auto;
  padding-top: 16px;
  display:flex;
  justify-content:space-between;
  gap: 12px;
  border-top: 1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.62);
  font-size: 12px;
}
.auth-info-footer a{color: rgba(255,255,255,.80); text-decoration:none}
.auth-info-footer a:hover{text-decoration:underline}

/* ---------- FORM PANE ---------- */
.auth-card{
  border-radius: 22px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: var(--shadow-soft);
  overflow:hidden;
}
.auth-card-head{
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.auth-card-head h2{
  font-size: 20px;
  font-weight: 950;
  letter-spacing:.2px;
  margin-bottom: 6px;
}
.auth-card-head p{
  font-size: 13px;
  color: var(--muted);
}
.auth-form{
  padding: 16px 18px 18px;
}
.form-group{margin-bottom: 14px}

label{
  display:block;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: rgba(255,255,255,.70);
  margin-bottom: 8px;
  user-select:none;
}

.form-control{
  width:100%;
  padding: 12px 14px;
  font-size: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(10,10,20,.46);
  color: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  appearance:none;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.form-control:focus{
  border-color: rgba(124,108,255,.60);
  box-shadow: var(--ring);
  background: rgba(10,10,20,.52);
}
.form-control::placeholder{color: rgba(255,255,255,.35)}
.form-text{
  display:block;
  margin-top: 7px;
  font-size: 12px;
  color: rgba(255,255,255,.55);
}
.form-text.error{
  color: var(--danger);
  font-weight: 800;
}

.auth-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin: 8px 0 12px;
}

.checkbox-label{
  display:flex;
  align-items:center;
  gap: 10px;
  cursor:pointer;
  color: rgba(255,255,255,.78);
  font-weight: 800;
  font-size: 13px;
  text-transform:none;
  letter-spacing:0;
}
.checkbox-label input{
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.btn{
  border:0;
  cursor:pointer;
  font-weight: 950;
  letter-spacing:.2px;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  transition: transform .16s ease, filter .16s ease, box-shadow .16s ease, background-position .3s ease;
  user-select:none;
}
.btn:active{transform: translateY(1px)}
.btn-primary{
  color: rgba(255,255,255,.96);
  background: linear-gradient(90deg, rgba(124,108,255,1) 0%, rgba(91,77,255,1) 45%, rgba(124,108,255,1) 100%);
  background-size: 160% 100%;
}
.btn-primary:hover{
  background-position: 100% 0;
  filter: brightness(1.04);
  box-shadow: 0 10px 24px rgba(124,108,255,.20);
}
.btn-block{width:100%}

.form-footer{
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.70);
  font-size: 13px;
  text-align:center;
}
.form-footer a{
  color: rgba(245,215,122,.95);
  text-decoration:none;
  font-weight: 950;
}
.form-footer a:hover{text-decoration:underline}

.auth-mini-note{
  margin-top: 14px;
  color: rgba(255,255,255,.62);
  font-size: 12px;
  text-align:center;
}

/* loading spinner */
.loading-spinner{
  display:inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: rgba(255,255,255,.92);
  animation: spin .8s linear infinite;
  vertical-align: -3px;
  margin-left: 10px;
}

/* ---------- LINKS: NO WEIRD SHADOWS ---------- */
a, a:visited{color:inherit}
a::before, a::after,
.form-footer a::before, .form-footer a::after{
  box-shadow:none !important;
  text-shadow:none !important;
}
a:focus-visible{
  outline: none;
  box-shadow: var(--ring-strong);
  border-radius: 10px;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 980px){
  .auth-shell{grid-template-columns: 1fr}
  .auth-pane{min-height:auto}
  .auth-pane--info{border-right:0;border-bottom: 1px solid rgba(255,255,255,.10)}
  /* mobile: form first */
  .auth-pane--form{order: 0}
  .auth-pane--info{order: 1}
  .auth-page{padding: 18px}
}
@media (max-width: 520px){
  .auth-pane{padding: 18px}
  .auth-hero-title{font-size: 26px}
}

/* ---------- MOTION SAFETY ---------- */
@media (prefers-reduced-motion: reduce){
  *{animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important}
}

/* ---------- KEYFRAMES ---------- */
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes auroraShift{
  0%{transform: translate3d(-2%, -1%, 0) scale(1)}
  100%{transform: translate3d(2%, 1%, 0) scale(1.04)}
}
@keyframes gridDrift{
  0%{transform: translate3d(0,0,0)}
  100%{transform: translate3d(-64px,-64px,0)}
}


/* Legal links on auth pages */
.auth-legal-links{
  margin-top: 14px;
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  color: rgba(255,255,255,0.6);
}
.auth-legal-links a{
  color: rgba(255,215,64,0.92);
  text-decoration: none;
  font-weight: 700;
  font-size: 12px;
}
.auth-legal-links a:hover{ text-decoration: underline; }

/* 2FA Overlay */
.twofa-overlay{
  position:fixed;inset:0;display:flex;align-items:center;justify-content:center;
  background:rgba(0,0,0,0.60);
  backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
  z-index:5000;padding:20px;
}
.twofa-card{
  width:min(520px, 100%);
  border-radius:22px;
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(20,16,34,0.86);
  box-shadow:0 16px 50px rgba(0,0,0,0.55);
  padding:18px;
}
.twofa-head h3{margin:0 0 6px 0;font-size:18px}
.twofa-head p{margin:0 0 14px 0;opacity:.75;font-size:13px;line-height:1.45}
.twofa-form label{display:block;font-size:12px;opacity:.8;margin-bottom:6px}
.twofa-actions{display:flex;gap:10px;margin-top:12px;flex-wrap:wrap}
.twofa-note{margin-top:12px;font-size:12px;opacity:.75;line-height:1.45}


/* ======================================================================
   2FA Overlay – Buttons (fix: they don't have .btn, only .btn-primary/.btn-secondary)
   ====================================================================== */

.twofa-actions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* Base button styling for 2FA actions */
.twofa-actions > button.btn-primary,
.twofa-actions > button.btn-secondary{
  appearance: none;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: .2px;
  cursor: pointer;
  user-select: none;
  border: 1px solid rgba(255,255,255,0.14);
  transition: transform .14s ease, background .14s ease, border-color .14s ease, box-shadow .14s ease, filter .14s ease;
  box-shadow: 0 12px 28px rgba(0,0,0,0.35);
}

.twofa-actions > button.btn-primary{
  color: rgba(255,255,255,0.96);
  background: linear-gradient(135deg, rgba(124,108,255,0.95) 0%, rgba(91,77,255,0.95) 55%, rgba(214,178,94,0.26) 100%);
  border-color: rgba(247,224,138,0.22);
}

.twofa-actions > button.btn-primary:hover{
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 18px 42px rgba(0,0,0,0.48);
  border-color: rgba(247,224,138,0.34);
}

.twofa-actions > button.btn-secondary{
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.90);
  border-color: rgba(255,255,255,0.14);
}

.twofa-actions > button.btn-secondary:hover{
  background: rgba(255,255,255,0.12);
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.22);
}

.twofa-actions > button.btn-primary:active,
.twofa-actions > button.btn-secondary:active{
  transform: translateY(0);
}

/* Focus ring that matches your gold accent */
.twofa-actions > button.btn-primary:focus-visible,
.twofa-actions > button.btn-secondary:focus-visible{
  outline: none;
  box-shadow: 0 0 0 4px rgba(247,224,138,0.18), 0 18px 42px rgba(0,0,0,0.48);
}

/* Optional: make 2FA input match dark theme (prevents bright look in some browsers) */
.twofa-card input.form-control{
  background: rgba(255,255,255,0.06) !important;
  color: rgba(255,255,255,0.94) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
}
.twofa-card input.form-control:focus{
  border-color: rgba(247,224,138,0.34) !important;
  box-shadow: 0 0 0 4px rgba(247,224,138,0.12) !important;
}
.twofa-card input.form-control:-webkit-autofill,
.twofa-card input.form-control:-webkit-autofill:hover,
.twofa-card input.form-control:-webkit-autofill:focus{
  -webkit-text-fill-color: rgba(255,255,255,0.94);
  transition: background-color 9999s ease-out 0s;
  box-shadow: 0 0 0px 1000px rgba(255,255,255,0.06) inset;
  border: 1px solid rgba(255,255,255,0.12) !important;
}

