/* ==========================================================================
   AYCM EBL 3 – Bejelentkezés – dizájn tokenek
   ========================================================================== */

:root {
  --login-accent: #6F42C1;
  --login-accent-dark: #341F5B;
  --login-accent-pink: #C560FF;
  --login-brand-title-gradient: linear-gradient(90deg, #C560FF 0%, #FF8C27 100%);
  --ebl-border-gradient: linear-gradient(90deg, #C560FF 0%, #FF8C27 100%);
  --bar-border: rgba(255, 0, 0, 0.40);
  --bar-shadow: 0.5px 0.5px 15px rgba(154, 110, 255, 0.20);
  --login-accent-soft: rgba(153, 110, 255, 0.10);
  --login-accent-outline: rgba(153, 110, 255, 0.40);
  --login-text: #1B1A22;
  --login-text-muted: #898989;
  --login-text-subtle: rgba(0, 0, 0, 0.73);
  --login-border: #CACACA;
  --login-surface: #FFFFFF;
  --login-gradient: linear-gradient(90deg, #6F42C1 0%, #341F5B 100%);
  --login-overlay: rgba(0, 0, 0, 0.12);

  color-scheme: light;
}

[data-bs-theme="dark"] {
  --login-text: #F3F1FA;
  --login-text-muted: #A9A6BC;
  --login-text-subtle: rgba(243, 241, 250, 0.78);
  --login-border: #4A4658;
  --login-surface: #1A1826;
  --login-overlay: rgba(0, 0, 0, 0.45);

  color-scheme: dark;
}

/* ==========================================================================
   Alap – teljes képernyős bejelentkezés
   ========================================================================== */

* {
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

html, body {
  height: 100%;
}

body.login-page {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--login-text);
  overflow-x: hidden;
}

.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.login-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--login-overlay);
  pointer-events: none;
}

.login-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Sötét mód kapcsoló – a kártya tetején, csak a tartalom szélességében */
.login-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  width: auto;
  max-width: 100%;
  gap: 4px;
  min-width: 0;
  min-height: 30px;
  margin-bottom: 24px;
  /* Jobb oldali padding nagyobb – az ikon miatt a felirat optikailag középen marad */
  padding: 4px 18px 4px 10px;
  font-family: inherit;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--login-text);
  background: var(--ebl-btn-accent-soft, var(--login-accent-soft));
  border: none;
  border-radius: 20px;
  outline: 1px solid var(--ebl-btn-accent-outline, #9A6EFF);
  outline-offset: -1px;
  cursor: pointer;
  white-space: nowrap;
}

.login-theme-toggle i {
  flex-shrink: 0;
  width: 10px;
  font-size: 10px;
  line-height: 1;
  text-align: center;
}

.login-theme-toggle:hover {
  background: rgba(153, 110, 255, 0.18);
}

/* ==========================================================================
   Bejelentkezési kártya
   ========================================================================== */

.login-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 32px clamp(16px, 5vw, 72px);
}

.login-card {
  width: min(100%, 450px);
  min-height: 560px;
  padding: 48px 45px 40px;
  background: var(--login-surface);
  border-radius: 25px;
  box-shadow: 0 12px 40px rgba(17, 14, 23, 0.18);
  display: flex;
  flex-direction: column;
}

.login-panel[hidden] {
  display: none !important;
}

.login-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.login-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  margin-bottom: 28px;
}

.login-brand__title {
  margin: 0;
  font-weight: var(--ebl-brand-title-weight, 800);
  font-size: var(--ebl-brand-title-size, 32px);
  line-height: 1.1;
  background: var(--login-brand-title-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

@supports not (background-clip: text) {
  .login-brand__title {
    background: none;
    color: var(--ebl-brand-title-fallback, #C560FF);
    -webkit-text-fill-color: currentColor;
  }
}

.login-brand__subtitle {
  margin: 2px 0 0;
}

.login-card--set-password {
  width: min(100%, 420px);
  min-height: 520px;
  box-shadow: 0.5px 0.5px 15px rgba(111, 66, 193, 0.15);
}

.login-card__title--set-password {
  margin-bottom: 24px;
  font-size: 1.5rem;
  line-height: 1.2;
}

.login-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-input--compact {
  height: 37px;
  font-size: 0.75rem;
}

.login-toggle-pw--compact {
  width: 40px;
  height: 37px;
}

.login-field-hint {
  margin: 8px 0 0;
  font-size: 0.625rem;
  font-weight: 400;
  line-height: 1.3;
  color: #808080;
}

.login-field--set-password-confirm {
  margin-bottom: 16px;
}

.login-submit--set-password {
  width: min(100%, 180px);
}

.login-card__title {
  margin: 0 0 28px;
  color: var(--login-text);
  font-size: clamp(1.75rem, 4vw, 1.75rem);
  font-weight: 800;
  line-height: 1.15;
}

/* ==========================================================================
   Űrlap
   ========================================================================== */

.login-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.login-field {
  margin-bottom: 20px;
}

.login-label {
  display: block;
  margin-bottom: 5px;
  color: var(--login-text);
  font-size: 1rem;
  font-weight: 700;
}

.login-input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--login-text);
  background: var(--login-surface);
  border: 1px solid var(--login-border);
  border-radius: 10px;
}

.login-input:focus {
  outline: 2px solid var(--login-accent-outline);
  outline-offset: 1px;
}

.login-input--password:focus,
.login-password-field .login-toggle-pw:focus {
  outline: none;
}

.login-input::placeholder {
  color: #979797;
  font-size: 0.625rem;
  font-weight: 400;
  opacity: 1;
}

.login-input--placeholder {
  font-size: 0.75rem;
}

.login-password-field {
  display: flex;
  align-items: stretch;
  border-radius: 10px;
}

.login-password-field:focus-within {
  outline: 2px solid var(--login-accent-outline);
  outline-offset: 1px;
}

.login-input--password {
  flex: 1;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}

.login-toggle-pw {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--login-text);
  background: var(--login-surface);
  border: 1px solid var(--login-border);
  border-left: none;
  border-radius: 0 10px 10px 0;
  cursor: pointer;
}

.login-toggle-pw:hover {
  background: var(--login-accent-soft);
}

.login-field:has(+ .login-error-slot) {
  margin-bottom: 6px;
}

.login-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: flex-end;
  width: min(100%, 210px);
  margin-top: auto;
  gap: 12px;
}

.login-forgot-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 0;
}

.login-forgot {
  padding: 0;
  border: none;
  background: none;
  color: var(--login-accent);
  font-family: inherit;
  font-size: 0.625rem;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
}

.login-forgot:hover {
  text-decoration: underline;
}

.login-page button.login-forgot {
  margin: 0;
  background: none;
  border: none;
  padding: 0;
}

/* Egyedi jelölőnégyzet – „Maradjak bejelentkezve” */
.login-remember {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
  cursor: pointer;
  user-select: none;
}

.login-remember__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.login-remember__box {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--login-border);
  border-radius: 5px;
  background: var(--login-surface);
  flex-shrink: 0;
}

.login-remember__icon {
  font-size: 0.7rem;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.login-remember__input:checked + .login-remember__box {
  border-color: var(--login-accent);
  background: var(--login-accent-soft);
}

.login-remember__input:checked + .login-remember__box .login-remember__icon {
  opacity: 1;
  transform: scale(1);
}

.login-remember__input:focus-visible + .login-remember__box {
  outline: 2px solid var(--login-accent-outline);
  outline-offset: 2px;
}

.login-remember__label {
  color: var(--login-text-subtle);
  font-size: 0.825rem;
  font-weight: 400;
}

.login-error-slot {
  /* Fix magasság: a hibaüzenet helye mindig foglalt, így nem ugrál a panel megjelenéskor */
  min-height: 1.25rem;
  margin: 0 0 8px;
}

.login-error {
  margin: 0;
  color: #E5484D;
  font-size: 0.75rem;
  line-height: 1.25;
}

.login-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: min(100%, 210px);
  min-height: 40px;
  margin: 0;
  padding: 4px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--login-text);
  background: var(--ebl-btn-accent-soft, var(--login-accent-soft));
  border: none;
  border-radius: 20px;
  outline: 1px solid var(--ebl-btn-accent-outline, #9A6EFF);
  outline-offset: -1px;
  cursor: pointer;
}

.login-submit:hover {
  background: rgba(153, 110, 255, 0.18);
}

.login-submit:active {
  transform: translateY(1px);
}

/* Jelszó-helyreállítás panelek */
.login-reset__lead {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--login-text);
}

.login-reset__hint {
  margin: 0 0 20px;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--login-text);
}

.login-field--reset {
  margin-bottom: 24px;
}

#passwordResetRequestForm.login-form {
  flex: 1 1 auto;
  min-height: 0;
}

.login-reset-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-top: auto;
  padding-top: 24px;
}

.login-reset-actions .login-forgot {
  flex: 0 1 auto;
  text-align: right;
}

.login-submit--inline {
  margin-top: 0;
  align-self: auto;
  flex-shrink: 0;
}

.login-reset-success {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.login-reset-success__text {
  margin: 0 0 12px;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--login-text);
}

.login-reset-success__text:last-child {
  margin-bottom: 0;
}

.login-reset-success__text--emphasis {
  font-weight: 700;
}

/* ==========================================================================
   Reszponzivitás
   ========================================================================== */

@media (max-width: 991.98px) {
  .login-shell {
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
  }

  .login-card {
    min-height: auto;
    padding: 32px 24px 28px;
  }
}

@media (max-width: 575.98px) {
  .login-theme-toggle {
    padding: 4px 16px 4px 8px;
    margin-bottom: 16px;
  }

  .login-card__title {
    margin-bottom: 20px;
  }

  .login-reset-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
  }

  .login-reset-actions .login-submit--inline {
    width: min(100%, 210px);
  }

  .login-actions,
  .login-submit {
    width: min(100%, 210px);
  }
}
