/**
 * lex-member-modal.css  v2.0
 * Lexington Group — login bar + modal styles
 * Matches site palette: red #c0281c, charcoal #2a2520, Playfair Display
 */

/* ── Scroll lock ──────────────────────────────────────────────────────────── */
body.lex-modal-open { overflow: hidden; }

/* ══════════════════════════════════════════════════════════════════════════════
   LOGIN BAR — sits above the red nav bar, flush right
   ══════════════════════════════════════════════════════════════════════════════ */

#lex-login-bar {
  background: #1e1a16;          /* slightly darker than charcoal for contrast */
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0 20px;
  min-height: 34px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

/* ── "Log In" button (logged-out state) ─────────────────────────────────── */
#lex-login-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.82);
  font-family: Georgia, serif;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

#lex-login-btn:hover {
  border-color: rgba(255,255,255,0.6);
  color: #fff;
  background: rgba(255,255,255,0.07);
}

.lex-login-icon { font-size: 0.85rem; opacity: 0.7; }

/* ── Member button + dropdown (logged-in state) ──────────────────────────── */
#lex-member-menu { position: relative; }

#lex-member-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.82);
  font-family: Georgia, serif;
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 2px;
  transition: background 0.15s, color 0.15s;
}

#lex-member-btn:hover { background: rgba(255,255,255,0.09); color: #fff; }

.lex-member-check {
  color: #6abf6a;
  font-size: 0.8rem;
  font-weight: bold;
}

.lex-member-name { font-style: italic; }

.lex-caret {
  font-size: 0.6rem;
  opacity: 0.55;
  transition: transform 0.15s;
}

#lex-member-btn[aria-expanded="true"] .lex-caret {
  transform: rotate(180deg);
}

/* Dropdown */
#lex-member-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: #fff;
  border: 1px solid #d4cfc8;
  border-radius: 2px;
  box-shadow: 0 4px 18px rgba(20,16,12,0.14);
  min-width: 180px;
  list-style: none;
  padding: 5px 0;
  margin: 0;
  z-index: 99998;
}

#lex-member-dropdown.lex-open { display: block; }

#lex-member-dropdown li a,
#lex-member-dropdown li button {
  display: block;
  width: 100%;
  padding: 9px 16px;
  font-family: Georgia, serif;
  font-size: 0.82rem;
  color: #2a2520;
  text-decoration: none;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
  box-sizing: border-box;
}

#lex-member-dropdown li a:hover,
#lex-member-dropdown li button:hover {
  background: #f7f4ef;
  color: #c0281c;
}

.lex-dropdown-divider {
  border-top: 1px solid #e8e4de;
  margin: 4px 0;
}

/* ══════════════════════════════════════════════════════════════════════════════
   MODAL OVERLAY
   ══════════════════════════════════════════════════════════════════════════════ */

#lex-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,16,12,0.65);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

#lex-modal-overlay.lex-active { opacity: 1; }

/* ── Modal box ───────────────────────────────────────────────────────────── */
#lex-modal {
  background: #fdfcfa;
  width: 100%;
  max-width: 455px;
  border-radius: 3px;
  box-shadow: 0 12px 48px rgba(20,16,12,0.22), 0 2px 8px rgba(20,16,12,0.1);
  overflow: hidden;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
}

#lex-modal-overlay.lex-active #lex-modal {
  transform: translateY(0) scale(1);
}

/* ── Modal header ────────────────────────────────────────────────────────── */
.lex-modal-header {
  background: #2a2520;
  padding: 26px 30px 22px;
  position: relative;
}

.lex-modal-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: #c0281c;
}

.lex-modal-org {
  font-family: Georgia, serif;
  font-size: 0.63rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.42);
  margin: 0 0 5px;
}

.lex-modal-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 5px;
  line-height: 1.2;
}

.lex-modal-subtitle {
  font-family: Georgia, serif;
  font-size: 0.79rem;
  color: rgba(255,255,255,0.48);
  font-style: italic;
  margin: 0;
}

.lex-modal-close {
  position: absolute;
  top: 13px; right: 14px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 2px;
  font-family: Arial, sans-serif;
  transition: color 0.15s, background 0.15s;
}
.lex-modal-close:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* ── Modal body ──────────────────────────────────────────────────────────── */
.lex-modal-body { padding: 26px 30px 24px; }

/* ── Error box ───────────────────────────────────────────────────────────── */
.lex-error-box {
  display: none;
  background: #fdf2f2;
  border: 1px solid #f5c6c6;
  border-left: 3px solid #c0281c;
  border-radius: 2px;
  padding: 10px 13px;
  margin-bottom: 15px;
  font-family: Georgia, serif;
  font-size: 0.81rem;
  color: #8b2020;
  line-height: 1.55;
}

/* ── Form elements ───────────────────────────────────────────────────────── */
.lex-modal-desc {
  font-family: Georgia, serif;
  font-size: 0.85rem;
  color: #5a5550;
  line-height: 1.65;
  margin: 0 0 18px;
}

.lex-form-group { margin-bottom: 14px; }

.lex-form-group label {
  display: block;
  font-family: Georgia, serif;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6b6560;
  margin-bottom: 6px;
}

.lex-form-group input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  font-family: Georgia, serif;
  font-size: 0.92rem;
  border: 1.5px solid #d4cfc8;
  border-radius: 2px;
  background: #fff;
  color: #2a2520;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.lex-form-group input[type="email"]:focus {
  border-color: #c0281c;
  box-shadow: 0 0 0 3px rgba(192,40,28,0.1);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.lex-btn-primary {
  display: block;
  width: 100%;
  background: #c0281c;
  color: #fff;
  border: none;
  padding: 12px 20px;
  font-family: Georgia, serif;
  font-size: 0.81rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  margin-top: 4px;
  transition: background 0.15s, transform 0.08s;
}
.lex-btn-primary:hover   { background: #9e2016; }
.lex-btn-primary:active  { transform: scale(0.99); }
.lex-btn-primary:disabled { background: #a0a0a0; cursor: not-allowed; transform: none; }

.lex-btn-secondary {
  display: block;
  width: 100%;
  margin-top: 9px;
  padding: 10px 20px;
  background: none;
  border: 1.5px solid #d4cfc8;
  color: #6b6560;
  font-family: Georgia, serif;
  font-size: 0.79rem;
  cursor: pointer;
  border-radius: 2px;
  transition: border-color 0.15s, color 0.15s;
}
.lex-btn-secondary:hover { border-color: #2a2520; color: #2a2520; }

/* ── Footnote ────────────────────────────────────────────────────────────── */
.lex-modal-footnote {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e8e4de;
  font-family: Georgia, serif;
  font-size: 0.74rem;
  color: #6b6560;
  line-height: 1.65;
  text-align: center;
  font-style: italic;
}
.lex-modal-footnote a { color: #c0281c; text-decoration: none; }
.lex-modal-footnote a:hover { text-decoration: underline; }

/* ── Success / error states ──────────────────────────────────────────────── */
.lex-state-icon {
  width: 50px; height: 50px;
  background: #edf7ed;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.4rem;
  line-height: 50px;
  text-align: center;
}

.lex-icon-warn { background: #fdf2f2; }

.lex-state-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #2a2520;
  text-align: center;
  margin: 0 0 10px;
}
.lex-title-red { color: #c0281c; }

.lex-state-desc {
  font-family: Georgia, serif;
  font-size: 0.85rem;
  color: #5a5550;
  text-align: center;
  line-height: 1.7;
  margin: 0 0 14px;
}
.lex-state-desc strong { color: #2a2520; }

.lex-info-note {
  background: #f7f4ef;
  border-left: 3px solid #b8922a;
  border-radius: 2px;
  padding: 11px 14px;
  font-family: Georgia, serif;
  font-size: 0.78rem;
  color: #6b6560;
  line-height: 1.6;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
  .lex-modal-header { padding: 20px 20px 18px; }
  .lex-modal-body   { padding: 20px 20px 18px; }
  .lex-modal-title  { font-size: 1.25rem; }
}
