/* ============================================================
   AUTH-MODAL.CSS — Login & Registration modals
   ============================================================ */

/* ── Backdrop overlay ──────────────────────────────────────── */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.auth-overlay.auth-open {
  opacity: 1;
  visibility: visible;
}

/* ── Modal cards ───────────────────────────────────────────── */
.auth-card {
  background: #fff;
  border-radius: 16px;
  width: 480px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow:
    0 20px 25px -5px rgba(0,0,0,0.10),
    0  8px 10px -6px rgba(0,0,0,0.10);
  display: none;
  scrollbar-width: thin;
  scrollbar-color: #e2e8f0 transparent;
}
.auth-card.auth-card-active {
  display: block;
  animation: authSlideIn 0.26s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.auth-card::-webkit-scrollbar { width: 4px; }
.auth-card::-webkit-scrollbar-track { background: transparent; }
.auth-card::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }

@keyframes authSlideIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* Register card — slightly wider + lighter shadow */
.auth-register-card {
  width: 488px;
  border: 1px solid #d1d5dc;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

/* ── Close button ──────────────────────────────────────────── */
.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  border-radius: 6px;
  font-size: 18px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
  z-index: 1;
}
.auth-close:hover { background: #f3f4f6; color: #111827; }

/* ── Logo area ─────────────────────────────────────────────── */
.auth-logo-wrap {
  display: flex;
  justify-content: center;
  padding: 32px 32px 0;
}
.auth-logo-wrap .logo-wrap {
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  width: 110px;
}
.auth-logo-wrap .logo-house {
  width: 100%;
  height: auto;
}
.auth-logo-wrap .logo-wordmark {
  width: 100%;
  height: auto;
}
.auth-logo-wrap .logo-fill {
  fill: #1B2C6B;
}
body.dark-mode .auth-logo-wrap .logo-fill {
  fill: #FFFFFF;
}

/* ── Card body ─────────────────────────────────────────────── */
.auth-body {
  padding: 16px 32px 36px;
}
.auth-register-card .auth-body {
  padding: 16px 40px 40px;
}

/* ── Heading & sub ─────────────────────────────────────────── */
.auth-heading {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 20px;
  font-weight: 400;
  color: #101828;
  letter-spacing: -0.45px;
  text-align: center;
  margin-bottom: 6px;
}
.auth-register-card .auth-heading {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 24px;
  font-weight: 600;
}
.auth-subheading {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #6a7282;
  text-align: center;
  letter-spacing: -0.15px;
  line-height: 1.5;
  margin-bottom: 22px;
}

/* ── Login tab switcher ────────────────────────────────────── */
.auth-tabs-login {
  display: flex;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  padding: 1px;
  margin-bottom: 18px;
}
.auth-tab-login {
  flex: 1;
  height: 42px;
  border: none;
  border-bottom: 2px solid transparent;
  background: #f9fafb;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #6a7282;
  cursor: pointer;
  letter-spacing: -0.15px;
  transition: all 0.18s;
}
.auth-tab-login.active {
  background: #fff;
  color: #155dfc;
  border-bottom-color: #155dfc;
}
.auth-tab-login:not(.active):hover {
  background: #f3f4f6;
  color: #374151;
}

/* ── Register tab switcher ─────────────────────────────────── */
.auth-tabs-register {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}
.auth-tab-register {
  flex: 1;
  height: 46px;
  border: 1px solid #d1d5dc;
  border-radius: 8px;
  background: #fff;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #2563eb;
  cursor: pointer;
  letter-spacing: -0.15px;
  transition: all 0.18s;
}
.auth-tab-register.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.auth-tab-register:not(.active):hover {
  background: #eff6ff;
}

/* ── Form & fields ─────────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.auth-label {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #364153;
  line-height: 1.5;
}

.auth-input {
  width: 100%;
  height: 46px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0 16px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #101828;
  outline: none;
  background: #fff;
  transition: border-color 0.18s, box-shadow 0.18s;
  -webkit-appearance: none;
}
.auth-register-card .auth-input {
  border-color: #d1d5dc;
  border-radius: 8px;
  height: 47px;
}
.auth-input:focus {
  border-color: #155dfc;
  box-shadow: 0 0 0 3px rgba(21, 93, 252, 0.09);
}
.auth-register-card .auth-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.09);
}
.auth-input::placeholder { color: #99a1af; }
.auth-input.auth-input-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}

/* Password wrap with eye toggle */
.auth-password-wrap {
  position: relative;
}
.auth-password-wrap .auth-input {
  padding-right: 48px;
}
.auth-eye-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  border-radius: 5px;
  transition: color 0.15s, background 0.15s;
}
.auth-eye-btn:hover { color: #374151; background: #f3f4f6; }

/* ── Remember / forgot row ─────────────────────────────────── */
.auth-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #4a5565;
  cursor: pointer;
  user-select: none;
}
.auth-remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #155dfc;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 4px;
}
.auth-forgot {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #155dfc;
  text-decoration: none;
  letter-spacing: -0.15px;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s;
}
.auth-forgot:hover { color: #0d4fd6; text-decoration: underline; }

/* ── Submit buttons ────────────────────────────────────────── */
.auth-submit-login {
  display: block;
  width: 100%;
  height: 48px;
  background: #101828;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.31px;
  cursor: pointer;
  transition: background 0.18s;
}
.auth-submit-login:hover { background: #1e3050; }

.auth-submit-register {
  display: block;
  width: 100%;
  height: 50px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: not-allowed;
  opacity: 0.4;
  transition: opacity 0.2s, background 0.18s;
  pointer-events: none;
}
.auth-submit-register.auth-enabled {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}
.auth-submit-register.auth-enabled:hover { background: #1d4ed8; }

/* ── Divider ───────────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
}
.auth-divider-line {
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}
.auth-divider-text {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 13px;
  color: #99a1af;
  white-space: nowrap;
  letter-spacing: -0.1px;
}

/* ── Social buttons ────────────────────────────────────────── */
.auth-social-row {
  display: flex;
  gap: 10px;
}
.auth-social-btn {
  flex: 1;
  height: 42px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #364153;
  cursor: pointer;
  letter-spacing: -0.15px;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.auth-social-btn:hover { background: #f9fafb; border-color: #d1d5db; }
.auth-social-btn img { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Panel-switch link rows ────────────────────────────────── */
.auth-switch-row {
  text-align: center;
  margin-top: 21px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 16px;
  color: #6a7282;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.auth-switch-btn {
  color: #155dfc;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  margin-left: 4px;
  letter-spacing: -0.31px;
  background: none;
  border: none;
  font-family: inherit;
  transition: color 0.15s;
}
.auth-switch-btn:hover { color: #0d4fd6; text-decoration: underline; }

/* ── Password requirements box ─────────────────────────────── */
.auth-pw-req-box {
  background: #f9fafb;
  border: 1px solid #d1d5dc;
  border-radius: 8px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-pw-req-title {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #364153;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.auth-pw-req-item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #99a1af;
  line-height: 1.5;
  transition: color 0.18s;
}
.auth-pw-req-item.auth-req-met { color: #16a34a; }
.auth-pw-req-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d5dc;
  flex-shrink: 0;
  transition: background 0.18s;
}
.auth-pw-req-item.auth-req-met .auth-pw-req-dot { background: #16a34a; }

/* ── Checkboxes ────────────────────────────────────────────── */
.auth-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #364153;
  line-height: 1.5;
  cursor: pointer;
  user-select: none;
}
.auth-checkbox-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: #2563eb;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
}
.auth-checkbox-row a {
  color: #2563eb;
  text-decoration: none;
}
.auth-checkbox-row a:hover { text-decoration: underline; }


/* ============================================================
   DARK MODE
   ============================================================ */
body.dark-mode .auth-card {
  background: #111c30;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.5), 0 8px 10px -6px rgba(0,0,0,0.35);
}
body.dark-mode .auth-register-card { border-color: rgba(148,163,184,0.2); }
body.dark-mode .auth-close { color: #64748b; }
body.dark-mode .auth-close:hover { background: rgba(148,163,184,0.1); color: #e2e8f0; }

body.dark-mode .auth-heading { color: #f1f5f9; }
body.dark-mode .auth-subheading { color: #64748b; }

body.dark-mode .auth-tabs-login { border-color: rgba(148,163,184,0.2); }
body.dark-mode .auth-tab-login { background: #0d1a2d; color: #64748b; }
body.dark-mode .auth-tab-login.active { background: #111c30; color: #60a5fa; border-bottom-color: #60a5fa; }
body.dark-mode .auth-tab-login:not(.active):hover { background: #0d1a2d; color: #94a3b8; }

body.dark-mode .auth-tab-register { background: #111c30; border-color: rgba(148,163,184,0.25); color: #60a5fa; }
body.dark-mode .auth-tab-register.active { background: #2563eb; border-color: #2563eb; color: #fff; }
body.dark-mode .auth-tab-register:not(.active):hover { background: rgba(37,99,235,0.1); }

body.dark-mode .auth-label { color: #94a3b8; }
body.dark-mode .auth-input { background: #0d1a2d; border-color: rgba(148,163,184,0.25); color: #e2e8f0; }
body.dark-mode .auth-register-card .auth-input { border-color: rgba(148,163,184,0.25); }
body.dark-mode .auth-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }
body.dark-mode .auth-input::placeholder { color: #374151; }

body.dark-mode .auth-eye-btn { color: #4b5563; }
body.dark-mode .auth-eye-btn:hover { color: #94a3b8; background: rgba(148,163,184,0.1); }

body.dark-mode .auth-remember { color: #94a3b8; }
body.dark-mode .auth-remember input[type="checkbox"] { accent-color: #60a5fa; }
body.dark-mode .auth-forgot { color: #60a5fa; }
body.dark-mode .auth-forgot:hover { color: #93c5fd; }

body.dark-mode .auth-submit-login { background: #1a2f50; }
body.dark-mode .auth-submit-login:hover { background: #213a62; }
body.dark-mode .auth-divider-line { background: rgba(148,163,184,0.2); }
body.dark-mode .auth-divider-text { color: #374151; }

body.dark-mode .auth-social-btn { background: #0d1a2d; border-color: rgba(148,163,184,0.2); color: #94a3b8; }
body.dark-mode .auth-social-btn:hover { background: #111c30; border-color: rgba(148,163,184,0.35); }

body.dark-mode .auth-switch-row { color: #64748b; }
body.dark-mode .auth-switch-btn { color: #60a5fa; }
body.dark-mode .auth-switch-btn:hover { color: #93c5fd; }

body.dark-mode .auth-pw-req-box { background: #0d1a2d; border-color: rgba(148,163,184,0.2); }
body.dark-mode .auth-pw-req-title { color: #94a3b8; }
body.dark-mode .auth-pw-req-item { color: #374151; }
body.dark-mode .auth-pw-req-item.auth-req-met { color: #4ade80; }
body.dark-mode .auth-pw-req-dot { background: rgba(148,163,184,0.3); }
body.dark-mode .auth-pw-req-item.auth-req-met .auth-pw-req-dot { background: #16a34a; }

body.dark-mode .auth-checkbox-row { color: #94a3b8; }
body.dark-mode .auth-checkbox-row input[type="checkbox"] { accent-color: #3b82f6; }
body.dark-mode .auth-checkbox-row a { color: #60a5fa; }


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 540px) {
  .auth-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .auth-card,
  .auth-register-card {
    width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
  }
  @keyframes authSlideIn {
    from { opacity: 0; transform: translateY(32px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .auth-logo-wrap { padding-top: 24px; }
  .auth-social-row { flex-direction: column; gap: 8px; }
  .auth-social-btn { width: 100%; }
}
