/* =========================================
   DFL Login Modal
   Scope: Non-logged-in users only
   ========================================= */

.dfl-login-modal {
  position: fixed;
  inset: 0;
  z-index: 999998;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.dfl-login-modal.is-open {
  display: flex;
  opacity: 1;
  visibility: visible;
}

.dfl-login-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 25, 23, 0.7);
  cursor: pointer;
}

.dfl-login-modal__wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: 100%;
  overflow-y: auto;
}

.dfl-login-modal__box {
  background: var(--dfl-white, #fff);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  padding: 32px 28px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.dfl-login-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--dfl-dark, #1C1917);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.2s ease, color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.dfl-login-modal__close:hover,
.dfl-login-modal__close:focus {
  background: rgba(0, 0, 0, 0.06);
  color: var(--dfl-accent, #E74C3C);
}

.dfl-login-modal__title {
  margin: 0 0 24px;
  font-family: var(--dfl-heading-font, 'Inter', sans-serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--dfl-dark, #1C1917);
}

.dfl-login-modal__form {
  margin-bottom: 20px;
}

.dfl-login-modal__row {
  margin: 0 0 16px;
}

.dfl-login-modal__row:last-of-type {
  margin-bottom: 0;
}

.dfl-login-modal__row label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--dfl-dark, #1C1917);
}

.dfl-login-modal__input {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 8px;
  background: #fff;
  color: var(--dfl-dark, #1C1917);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dfl-login-modal__input:focus {
  outline: none;
  border-color: var(--dfl-blue, #2980B9);
  box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.15);
}

.dfl-login-modal__input::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

.dfl-login-modal__remember {
  margin-top: 8px;
}

.dfl-login-modal__remember label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  cursor: pointer;
}

.dfl-login-modal__remember input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--dfl-blue, #2980B9);
}

.dfl-login-modal__error {
  margin: 12px 0 0;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--dfl-red, #E74C3C);
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.3);
  border-radius: 8px;
}

.dfl-login-modal__error:empty,
.dfl-login-modal__error[hidden] {
  display: none !important;
}

.dfl-login-modal__submit {
  margin: 20px 0 0;
}

.dfl-login-modal__btn {
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--dfl-red, #E74C3C);
  border: 1px solid var(--dfl-black, #000);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.dfl-login-modal__btn:hover:not(:disabled) {
  background: var(--dfl-blue, #2980B9);
}

.dfl-login-modal__btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.dfl-login-modal__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.dfl-login-modal__sep {
  color: rgba(0, 0, 0, 0.35);
  font-weight: 400;
  pointer-events: none;
}

.dfl-login-modal__link {
  font-size: 14px;
  color: var(--dfl-blue, #2980B9);
  text-decoration: none;
  transition: color 0.2s ease;
}

.dfl-login-modal__link:hover {
  color: var(--dfl-accent, #E74C3C);
}

/* Tablet: 1024 */
@media (max-width: 1024px) {
  .dfl-login-modal {
    padding: 20px;
  }

  .dfl-login-modal__box {
    padding: 28px 24px;
  }
}

/* Mobile: 768 – full-screen overlay */
@media (max-width: 768px) {
  .dfl-login-modal {
    padding: 16px;
    align-items: flex-start;
    padding-top: max(24px, env(safe-area-inset-top));
  }

  .dfl-login-modal__wrap {
    max-width: none;
    flex: 1;
    display: flex;
    align-items: center;
    min-height: min-content;
  }

  .dfl-login-modal__box {
    width: 100%;
    padding: 28px 20px;
    margin-bottom: env(safe-area-inset-bottom);
  }

  .dfl-login-modal__close {
    top: 8px;
    right: 8px;
    min-width: 48px;
    min-height: 48px;
  }

  .dfl-login-modal__title {
    font-size: 22px;
    margin-bottom: 20px;
  }

  .dfl-login-modal__btn {
    min-height: 48px;
  }
}

/* Scroll lock when modal open */
html.dfl-login-modal-open {
  overflow: hidden;
}
