@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800;900&display=swap');

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
  --navy: #0F1B2D;
  --gold: #C9A84C;
  --gold-dark: #A8893A;
  --gold-light: #E4C97A;
  --white: #FFFFFF;
  --off-white: #F8F6F3;
  --light-gray: #F0EDE8;
  --text-dark: #1A1A2E;
  --text-muted: #6B7280;
  --text-light: #9CA3AF;
  --border: #E5E1DB;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --transition: all 0.22s ease;
  --nav-height: 68px;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Montserrat', sans-serif;
  color: var(--text-dark);
  background: var(--off-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-dark);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }

p {
  color: var(--text-muted);
  line-height: 1.75;
}

/* ============================================
   NAV — STANDARD (white bg)
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 40px;
  gap: 32px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  color: var(--navy);
  text-transform: uppercase;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
  list-style: none;
}

.nav-links a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--gold);
}

.nav-links .btn-gold {
  background: var(--gold);
  color: var(--white);
  padding: 9px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: var(--transition);
  text-decoration: none;
}

.nav-links .btn-gold:hover {
  background: var(--gold-dark);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(201,168,76,0.35);
}

/* NAV — TRANSPARENT (hero overlay) */
.nav.nav-transparent {
  background: transparent;
  border-bottom: none;
  box-shadow: none;
}

.nav.nav-transparent .nav-logo {
  color: var(--white);
}

.nav.nav-transparent .nav-links a {
  color: rgba(255,255,255,0.9);
}

.nav.nav-transparent .nav-links a:hover {
  color: var(--gold-light);
}

.nav.nav-transparent .hamburger span {
  background: var(--white);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  margin-left: auto;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: var(--transition);
}

/* Mobile nav drawer */
.nav-mobile {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  z-index: 999;
  padding: 24px 32px;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow-md);
}

.nav-mobile.open {
  display: flex;
}

.nav-mobile a {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  letter-spacing: 0.04em;
  transition: var(--transition);
}

.nav-mobile a:hover {
  color: var(--gold);
}

.nav-mobile .btn-gold {
  background: var(--gold);
  color: var(--white);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}

.btn-primary:hover:not(:disabled) {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201,168,76,0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gold);
  color: var(--white);
}

.btn-outline-white {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.7);
}

.btn-outline-white:hover:not(:disabled) {
  background: rgba(255,255,255,0.15);
  border-color: var(--white);
}

.btn-navy {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.btn-navy:hover:not(:disabled) {
  background: #1a2d47;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15,27,45,0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--light-gray);
  color: var(--text-dark);
}

.btn-danger {
  background: #DC2626;
  color: var(--white);
  border-color: #DC2626;
}

.btn-danger:hover:not(:disabled) {
  background: #B91C1C;
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.78rem;
}

.btn-lg {
  padding: 16px 40px;
  font-size: 0.95rem;
}

.btn-full {
  width: 100%;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-body {
  padding: 28px;
}

.card-header {
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dark);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.92rem;
  color: var(--text-dark);
  background: var(--white);
  transition: var(--transition);
  outline: none;
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-light);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-error {
  font-size: 0.8rem;
  color: #DC2626;
  margin-top: 4px;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================
   AVATAR
   ============================================ */
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--light-gray);
  flex-shrink: 0;
}

.avatar-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.avatar-lg {
  width: 100px;
  height: 100px;
  font-size: 2rem;
}

.avatar-xl {
  width: 140px;
  height: 140px;
  font-size: 2.5rem;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-gold {
  background: rgba(201,168,76,0.15);
  color: var(--gold-dark);
}

.badge-navy {
  background: rgba(15,27,45,0.1);
  color: var(--navy);
}

.badge-pro {
  background: var(--gold);
  color: var(--white);
}

.badge-green {
  background: rgba(16,185,129,0.12);
  color: #059669;
}

.badge-gray {
  background: var(--light-gray);
  color: var(--text-muted);
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}

.container-sm {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }

.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.section {
  padding: 100px 0;
}

.section-sm {
  padding: 64px 0;
}

/* ============================================
   PAGE WRAPPER (for app pages)
   ============================================ */
.page-wrapper {
  padding-top: var(--nav-height);
  min-height: 100vh;
}

.page-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 40px 0;
}

.page-content {
  padding: 40px 0;
}

/* ============================================
   LOADING
   ============================================ */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 50%;
  border-top-color: var(--white);
  animation: spin 0.7s linear infinite;
}

.loading-spinner-dark {
  border-color: rgba(201,168,76,0.3);
  border-top-color: var(--gold);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton {
  background: linear-gradient(90deg, var(--light-gray) 25%, var(--border) 50%, var(--light-gray) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   ALERT / TOAST
   ============================================ */
.alert {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 16px;
  border-left: 4px solid;
}

.alert-error {
  background: #FEF2F2;
  color: #DC2626;
  border-color: #DC2626;
}

.alert-success {
  background: #ECFDF5;
  color: #059669;
  border-color: #059669;
}

.alert-info {
  background: rgba(201,168,76,0.1);
  color: var(--gold-dark);
  border-color: var(--gold);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: 56px 0 36px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 32px;
  align-items: center;
}

.footer-logo {
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  color: var(--white);
  text-transform: uppercase;
}

.footer-tagline {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  margin-top: 6px;
  letter-spacing: 0.04em;
}

.footer-links {
  display: flex;
  gap: 28px;
  list-style: none;
  justify-content: center;
}

.footer-links a {
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  transition: var(--transition);
  letter-spacing: 0.03em;
}

.footer-links a:hover {
  color: var(--gold-light);
}

.footer-copy {
  text-align: right;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  line-height: 1.6;
}

.footer-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin: 36px 40px 0;
}

/* ============================================
   OPTION SELECTOR (card-style buttons)
   ============================================ */
.option-grid {
  display: grid;
  gap: 12px;
}

.option-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.option-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.option-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  cursor: pointer;
  transition: var(--transition);
  background: var(--white);
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.option-card:hover {
  border-color: var(--gold);
  background: rgba(201,168,76,0.05);
}

.option-card.selected {
  border-color: var(--gold);
  background: rgba(201,168,76,0.1);
  color: var(--navy);
}

.option-card .option-icon {
  width: 36px;
  height: 36px;
  background: var(--light-gray);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.option-card.selected .option-icon {
  background: var(--gold);
}

.option-card .option-icon svg {
  width: 18px;
  height: 18px;
  fill: var(--text-muted);
}

.option-card.selected .option-icon svg {
  fill: var(--white);
}

/* ============================================
   MEMBER CARD
   ============================================ */
.member-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.member-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.member-card-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--white);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.member-card-avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: 1.6rem;
  border: 3px solid var(--white);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

/* ============================================
   CONVERSATION ROW
   ============================================ */
.conversation-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  background: var(--white);
  text-decoration: none;
  color: inherit;
}

.conversation-row:hover {
  background: var(--off-white);
}

.conversation-row:last-child {
  border-bottom: none;
}

.conv-info {
  flex: 1;
  min-width: 0;
}

.conv-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.conv-preview {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.conv-time {
  font-size: 0.75rem;
  color: var(--text-light);
}

.conv-unread {
  width: 10px;
  height: 10px;
  background: #3B82F6;
  border-radius: 50%;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 80px 40px;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  background: var(--light-gray);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.empty-state-icon svg {
  width: 28px;
  height: 28px;
  fill: var(--text-light);
}

.empty-state h3 {
  font-size: 1.1rem;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.9rem;
  max-width: 340px;
  margin: 0 auto 24px;
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-bar-wrapper {
  height: 4px;
  background: var(--light-gray);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 40px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 24px;
  }

  .footer-copy {
    text-align: center;
  }

  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .nav {
    padding: 0 24px;
  }

  .nav-links {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .container {
    padding: 0 24px;
  }

  .section {
    padding: 64px 0;
  }

  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }

  .option-grid-2, .option-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .option-grid-2 {
    grid-template-columns: 1fr;
  }

  .footer-links {
    gap: 16px;
  }
}
