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

:root {
  --primary: #E8652A;
  --primary-hover: #D4571F;
  --primary-light: #FDF0E8;
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --border: #E5E0D8;
  --text: #2D2D2D;
  --text-muted: #7A7169;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 2px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --nav-height: 64px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

h1 { font-size: 2.25rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.75rem; font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.4; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}
.btn:hover { text-decoration: none; }

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

.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); color: var(--primary); }

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

.btn-sm { padding: 6px 14px; font-size: 0.875rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius); }
.btn-full { width: 100%; }

/* ===== NAVIGATION ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
}
.nav-logo span { color: var(--text); }
.nav-logo:hover { text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.nav-link:hover { color: var(--text); background: var(--bg); text-decoration: none; }
.nav-link.active { color: var(--primary); background: var(--primary-light); }
.nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8125rem;
  cursor: pointer;
  text-decoration: none;
  margin-left: 8px;
  flex-shrink: 0;
}
.nav-avatar:hover { text-decoration: none; background: var(--primary-hover); }

/* ===== LAYOUT ===== */
.page { max-width: 1100px; margin: 0 auto; padding: 32px 24px; }
.page-sm { max-width: 640px; margin: 0 auto; padding: 32px 24px; }
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 1.75rem; }
.page-header p { color: var(--text-muted); margin-top: 4px; }

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* ===== AVATAR ===== */
.avatar {
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  color: white;
}
.avatar-sm  { width: 36px; height: 36px; font-size: 0.8125rem; }
.avatar-md  { width: 48px; height: 48px; font-size: 1rem; }
.avatar-lg  { width: 72px; height: 72px; font-size: 1.375rem; }
.avatar-xl  { width: 96px; height: 96px; font-size: 1.75rem; }

.avatar-orange { background: #E8652A; }
.avatar-green  { background: #3D7A5E; }
.avatar-blue   { background: #3B72C4; }
.avatar-purple { background: #7C4DB8; }
.avatar-rose   { background: #C44D6E; }
.avatar-teal   { background: #2A8A8A; }

/* ===== TAGS & BADGES ===== */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 500;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.tag-primary { background: var(--primary-light); border-color: #F5C9AD; color: #C4521F; }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--primary);
  color: white;
}

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 0.9375rem; font-weight: 600; margin-bottom: 6px; }
.form-hint { font-size: 0.8125rem; color: var(--text-muted); margin-top: 4px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s;
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232, 101, 42, 0.12);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ===== MISC ===== */
.stars { color: #F59E0B; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state .icon { font-size: 2.5rem; margin-bottom: 12px; }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-info    { background: #EFF6FF; border: 1px solid #BFDBFE; color: #1E40AF; }
.alert-warning { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }
.alert-success { background: #ECFDF5; border: 1px solid #A7F3D0; color: #065F46; }

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 24px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.filter-bar select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  outline: none;
  cursor: pointer;
}
.filter-bar select:focus { border-color: var(--primary); }

/* ===== LANDING ===== */
.landing-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 24px;
}
.landing-header-inner {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hero {
  background: linear-gradient(150deg, #FDF0E8 0%, #FAFAF8 55%);
  padding: 88px 24px;
  text-align: center;
}
.hero-inner { max-width: 680px; margin: 0 auto; }
.hero h1 { font-size: 3rem; font-weight: 800; margin-bottom: 16px; line-height: 1.15; }
.hero h1 span { color: var(--primary); }
.hero p { font-size: 1.125rem; color: var(--text-muted); margin-bottom: 36px; line-height: 1.7; }
.hero-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.section-wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.section-title { text-align: center; margin-bottom: 48px; }
.section-title h2 { font-size: 2rem; margin-bottom: 8px; }
.section-title p { color: var(--text-muted); font-size: 1rem; }
.how-section { padding: 72px 0; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.step { text-align: center; }
.step-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem; margin: 0 auto 16px;
}
.step h3 { margin-bottom: 8px; }
.step p { color: var(--text-muted); font-size: 0.9375rem; }
.why-section { background: var(--surface); border-top: 1px solid var(--border); padding: 72px 0; }
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.why-card { padding: 28px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--border); }
.why-card .icon { font-size: 2rem; margin-bottom: 12px; }
.why-card h3 { margin-bottom: 8px; }
.why-card p { color: var(--text-muted); font-size: 0.9375rem; }
.landing-footer { background: #1A1A1A; color: #9CA3AF; padding: 32px 24px; text-align: center; font-size: 0.875rem; }
.landing-footer a { color: #D1D5DB; }

/* ===== AUTH ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(150deg, #FDF0E8 0%, #FAFAF8 100%);
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  box-shadow: var(--shadow-lg);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo a { font-size: 1.75rem; font-weight: 800; color: var(--primary); }
.auth-logo a:hover { text-decoration: none; }
.auth-tabs {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--text-muted);
  transition: all 0.15s;
  font-family: inherit;
}
.auth-tab.active { background: var(--primary); color: white; }

/* ===== DASHBOARD ===== */
.greeting {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}
.greeting h1 { font-size: 1.75rem; }
.city-select {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  font-size: 0.9375rem;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  font-weight: 500;
  outline: none;
}
.city-select:focus { border-color: var(--primary); }
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-heading h2 { font-size: 1.25rem; }
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ===== COMPANION CARD ===== */
.companion-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.companion-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.companion-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.companion-name { font-size: 1rem; font-weight: 600; margin-bottom: 1px; }
.companion-from { font-size: 0.8125rem; color: var(--text-muted); }
.companion-time { display: flex; align-items: center; gap: 6px; font-size: 0.9375rem; font-weight: 600; color: var(--primary); margin-bottom: 4px; }
.companion-location { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 12px; }
.companion-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ===== BROWSE GRID ===== */
.browse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s;
}
.profile-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.profile-card-head { padding: 20px; display: flex; gap: 14px; align-items: flex-start; }
.profile-card-name { font-size: 1.0625rem; font-weight: 600; margin-bottom: 2px; }
.profile-card-meta { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 5px; }
.profile-card-rating { display: flex; align-items: center; gap: 5px; font-size: 0.8125rem; color: var(--text-muted); }
.profile-card-body { padding: 0 20px 16px; }
.profile-card-bio { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; }
.profile-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.avail-banner {
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  gap: 8px;
}
.avail-banner.on { background: var(--primary-light); border-top-color: #F5C9AD; }
.avail-banner.off { background: var(--bg); color: var(--text-muted); }
.avail-text { display: flex; align-items: center; gap: 5px; font-weight: 600; color: #C4521F; }

/* ===== PROFILE PAGE ===== */
.profile-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.profile-hero-info { flex: 1; min-width: 0; }
.profile-hero-info h1 { font-size: 1.75rem; margin-bottom: 4px; }
.profile-hero-meta { color: var(--text-muted); font-size: 0.9375rem; margin-bottom: 16px; }
.profile-stats { display: flex; gap: 28px; margin-bottom: 16px; }
.stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.profile-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.profile-section-title {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 12px;
}

/* ===== MESSAGES ===== */
.conversation-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.convo-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.1s;
  cursor: pointer;
}
.convo-item:last-child { border-bottom: none; }
.convo-item:hover { background: var(--bg); text-decoration: none; }
.convo-content { flex: 1; min-width: 0; }
.convo-name-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3px; }
.convo-name { font-weight: 600; font-size: 0.9375rem; }
.convo-time { font-size: 0.8125rem; color: var(--text-muted); }
.convo-preview { font-size: 0.875rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo-preview.unread { color: var(--text); font-weight: 500; }

/* ===== CHAT ===== */
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - var(--nav-height)); }
.chat-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.chat-header-info h3 { font-size: 1rem; margin-bottom: 1px; }
.chat-header-info p { font-size: 0.8125rem; color: var(--text-muted); }
.chat-safety {
  background: #FFFBEB;
  border-bottom: 1px solid #FDE68A;
  padding: 8px 24px;
  font-size: 0.8125rem;
  color: #92400E;
  text-align: center;
  flex-shrink: 0;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.message { display: flex; flex-direction: column; max-width: 70%; }
.message.in { align-self: flex-start; align-items: flex-start; }
.message.out { align-self: flex-end; align-items: flex-end; }
.bubble {
  padding: 10px 14px;
  font-size: 0.9375rem;
  line-height: 1.5;
  border-radius: 16px;
}
.in .bubble { background: var(--surface); border: 1px solid var(--border); border-radius: 16px 16px 16px 4px; }
.out .bubble { background: var(--primary); color: white; border-radius: 16px 16px 4px 16px; }
.msg-time { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; padding: 0 4px; }
.chat-input-row {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  font-size: 0.9375rem;
  font-family: inherit;
  outline: none;
  resize: none;
  max-height: 120px;
  background: var(--bg);
}
.chat-input:focus { border-color: var(--primary); }
.send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.send-btn:hover { background: var(--primary-hover); }

/* ===== SUCCESS ===== */
.success-card { text-align: center; padding: 48px 24px; }
.success-icon {
  width: 72px; height: 72px; background: #ECFDF5; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; margin: 0 auto 20px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  .hero h1 { font-size: 2.25rem; }
  .steps { grid-template-columns: 1fr; gap: 24px; }
  .why-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-hero { flex-direction: column; }
  .browse-grid { grid-template-columns: 1fr; }
  .grid-cards { grid-template-columns: 1fr; }
  .page { padding: 20px 16px; }
  .page-sm { padding: 20px 16px; }
  .nav-link span:last-child { display: none; }
}
@media (max-width: 480px) {
  .hero { padding: 56px 16px; }
  .hero h1 { font-size: 1.875rem; }
  .hero-buttons { flex-direction: column; align-items: stretch; }
  .how-section, .why-section { padding: 48px 0; }
}
