/* houndwise — Client Login modal
   Loaded on every page. Uses the same dark/glass design language as the
   rest of the site, with CSS variable fallbacks so it works even on pages
   whose :root doesn't define every custom property. */

.hw-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 7, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#hw-login-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#hw-login-modal.open,
#hw-login-modal.open .hw-modal-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.hw-modal-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 380px;
  background: var(--bg-card, rgba(20, 20, 22, 0.9));
  border: 1px solid var(--border-glass, rgba(255, 255, 255, 0.06));
  border-radius: var(--radius-premium, 24px);
  padding: 40px 32px 32px 32px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text-bright, #ffffff);
}

#hw-login-modal.open .hw-modal-card {
  transform: translateY(0) scale(1);
}

.hw-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-bright, #fff);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease;
}
.hw-modal-close:hover { background: rgba(255, 255, 255, 0.14); }

.hw-modal-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--pipe-glow-1, #007aff);
  margin: 0 0 8px 0;
}

.hw-modal-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0 0 6px 0;
}

.hw-modal-card > p.hw-modal-sub {
  font-size: 0.88rem;
  color: var(--text-muted, #8a8a93);
  margin: 0 0 28px 0;
  line-height: 1.5;
}

.hw-field {
  margin-bottom: 16px;
}

.hw-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted, #8a8a93);
  margin-bottom: 8px;
}

.hw-field input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 0.9rem;
  color: var(--text-bright, #fff);
  font-family: 'Plus Jakarta Sans', sans-serif;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.hw-field input:focus {
  border-color: var(--pipe-glow-1, #007aff);
  background: rgba(255, 255, 255, 0.05);
}

.hw-modal-msg {
  font-size: 0.82rem;
  line-height: 1.5;
  min-height: 0;
  margin: -4px 0 16px 0;
  color: var(--text-muted, #8a8a93);
}
.hw-modal-msg.error { color: #ff453a; }
.hw-modal-msg.success { color: #30d158; }
.hw-modal-msg:empty { display: none; }

.hw-modal-submit {
  width: 100%;
  border: none;
  border-radius: 100px;
  background: var(--text-bright, #fff);
  color: var(--bg-dark, #0b0b0c);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 14px 0;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hw-modal-submit:hover:not(:disabled) {
  background: var(--pipe-glow-1, #007aff);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(0, 122, 255, 0.25);
}

.hw-modal-submit:disabled {
  opacity: 0.6;
  cursor: default;
}

.hw-modal-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 16px 0;
  color: var(--text-muted, #8a8a93);
  font-size: 0.75rem;
}
.hw-modal-divider::before,
.hw-modal-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.hw-modal-divider span { padding: 0 10px; }

.hw-modal-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 100px;
  background: transparent;
  color: var(--text-bright, #fff);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 13px 0;
  cursor: pointer;
  transition: all 0.25s ease;
}
.hw-modal-google:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}
.hw-modal-google:disabled { opacity: 0.6; cursor: default; }

.hw-modal-footer {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.hw-modal-footer a {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted, #8a8a93);
  text-decoration: none;
  transition: color 0.25s ease;
}
.hw-modal-footer a:hover { color: var(--text-bright, #fff); }

/* Remove this rule + the .hw-modal-demo-hint element in js/auth.js once
   real accounts are set up (see firebase-setup-guide.md). */
.hw-modal-demo-hint {
  text-align: center;
  font-size: 0.72rem;
  color: var(--pipe-glow-1, #007aff);
  background: rgba(0, 122, 255, 0.08);
  border: 1px solid rgba(0, 122, 255, 0.15);
  border-radius: 10px;
  padding: 8px 12px;
  margin: 18px 0 0 0;
}

@media (max-width: 480px) {
  .hw-modal-card { padding: 32px 24px 26px 24px; }
}
