/* =================================================================
   ifg – Inline-Login-Dialog (standalone, KEIN Bootstrap-Dependency)
   Vanilla-Komponente: natives <dialog> + Fallback-Overlay.
   Tokens stammen aus scss/_variables.scss bzw. css/ifg-theme.css.
   Benjamin verdrahtet die Logik später mit Joomla – Markup/Verhalten
   stecken in js/ifg-login-modal.js, das Styling hier.
   ================================================================= */

/* Trigger sind bestehende Elemente mit [data-ifg-login-open]:
   - Header: .btn.btn-brand-outline (Icon + "Login")
   - In-Content: .os-buy + .ifg-login-inline ("Schon gekauft? Einloggen →")
   Header nutzt Theme-Styles; der Inline-Link wird hier kräftiger gesetzt. */
.ifg-login-inline {
  font-size: 18px;                 /* etwas größer als os-buy (14px) */
  font-weight: 700;                /* fetter */
  color: #006DB1;                 /* Deep Blue */
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ifg-login-inline:hover { color: #006DB1; }

/* ---- Overlay (nur Fallback ohne <dialog>) ------------------- */
.ifg-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(14, 14, 20, 0.5);
}
.ifg-login-overlay[hidden] { display: none; }

/* ---- Dialog-Container ---------------------------------------- */
.ifg-login-dialog,
.ifg-login-dialog * { box-sizing: border-box; }   /* unabhängig von Bootstrap */
.ifg-login-dialog {
  position: fixed;                  /* explizit – nicht aufs UA-Stylesheet verlassen */
  inset: 0;
  margin: auto;                     /* zentriert vertikal + horizontal */
  width: min(440px, calc(100vw - 32px));  /* 16px Margin je Seite auf Mobil */
  height: fit-content;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 32px;
  border: 0;
  border-radius: 16px;
  background: #fff;
  color: #0E0E14;
  box-shadow: 0 16px 48px rgba(14, 14, 20, 0.18);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
/* Overlay des nativen Dialogs */
.ifg-login-dialog::backdrop { background: rgba(14, 14, 20, 0.5); }

/* Fallback-Modus: Dialog wird wie ein normales Element zentriert */
.ifg-login-dialog.is-fallback {
  position: fixed;
  z-index: 2001;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  display: none;
}
.ifg-login-dialog.is-fallback.is-open { display: block; }

/* ---- Schließen-Icon ----------------------------------------- */
.ifg-login-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #F1F0EA;             /* bg-2 */
  color: #4A4A55;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.ifg-login-close:hover { background: #E8E6DF; color: #0E0E14; }

/* ---- Texte --------------------------------------------------- */
.ifg-login-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.4px;
  line-height: 1.18;
  margin: 4px 40px 6px 0;          /* Platz fürs Close-Icon */
  color: #0E0E14;
}
.ifg-login-help {
  font-size: 15px;
  line-height: 1.5;
  color: #4A4A55;
  margin: 0 0 22px;
}

/* ---- Formular ------------------------------------------------ */
.ifg-login-form { display: flex; flex-direction: column; }
.ifg-login-field { display: flex; flex-direction: column; margin-bottom: 16px; }
.ifg-login-field > label {
  font-size: 13px;
  font-weight: 500;               /* Medium */
  color: #4A4A55;
  margin-bottom: 6px;
}
.ifg-login-input {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  color: #0E0E14;
  background: #fff;
  border: 1px solid #E8E6DF;
  border-radius: 12px;
  padding: 12px 16px;
  transition: border-color .15s, box-shadow .15s;
}
.ifg-login-input::placeholder { color: #9A988F; }
.ifg-login-input:focus {
  outline: none;
  border-color: #006DB1;                       /* Deep-Blue-Ring */
  box-shadow: 0 0 0 3px rgba(0, 109, 177, .15);
}

/* Passwort-Feld mit Show/Hide-Toggle */
.ifg-login-pw { position: relative; }
.ifg-login-pw .ifg-login-input { padding-right: 48px; }
.ifg-login-pwtoggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #4A4A55;
  cursor: pointer;
}
.ifg-login-pwtoggle:hover { color: #006DB1; }
.ifg-login-pwtoggle .eye-off { display: none; }
.ifg-login-pwtoggle.is-on .eye-on { display: none; }
.ifg-login-pwtoggle.is-on .eye-off { display: block; }

/* ---- Anmelden-Button ---------------------------------------- */
.ifg-login-submit {
  width: 100%;
  height: 48px;
  margin-top: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;               /* Bold */
  color: #fff;
  background: #009FE3;             /* Cyan – nur als CTA-BG */
  border: 0;
  border-radius: 999px;           /* Pill */
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
.ifg-login-submit:hover { background: #006DB1; box-shadow: 0 6px 18px rgba(0, 109, 177, .35); }
.ifg-login-submit:active { background: #006DB1; }

/* ---- Passwort vergessen ------------------------------------- */
.ifg-login-forgot {
  align-self: center;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 500;
  color: #006DB1;
  text-decoration: none;
}
.ifg-login-forgot:hover { text-decoration: underline; }

/* ---- Trennlinie + Registrierungs-Hinweis -------------------- */
.ifg-login-divider { height: 1px; background: #E8E6DF; margin: 24px 0 18px; }
.ifg-login-register {
  text-align: center;
  font-size: 14px;
  color: #4A4A55;
  margin: 0;
}
.ifg-login-register a { color: #006DB1; font-weight: 600; text-decoration: none; }
.ifg-login-register a:hover { text-decoration: underline; }

/* ---- Sichtbarer Focus (konsistent zum Theme) ---------------- */
.ifg-login-dialog a:focus-visible,
.ifg-login-dialog button:focus-visible,
.ifg-login-input:focus-visible {
  outline: 3px solid rgba(0, 159, 227, .45);
  outline-offset: 2px;
}

/* ---- Mobil ≤ 375px ------------------------------------------ */
@media (max-width: 400px) {
  .ifg-login-dialog { padding: 24px 20px; }
  .ifg-login-title { font-size: 21px; }
}
