:root {
  --champagne: #F7E7CE;
  --rose: #C4918E;
  --deep-plum: #2D1B2E;
  --warm-black: #1A1017;
  --gold: #D4A853;
  --soft-white: #FDF8F4;
  --muted-rose: #E8C4C0;
  --card-bg: rgba(45, 27, 46, 0.5);
  --input-bg: rgba(253, 248, 244, 0.06);
  --input-border: rgba(212, 168, 83, 0.25);
  --success: #6BCB77;
  --error: #E74C3C;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--warm-black);
  color: var(--soft-white);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ========== Navigation ========== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(26, 16, 23, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(212, 168, 83, 0.1);
  z-index: 100;
}

nav .nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 13px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  font-weight: 400;
}

nav .nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}

nav .nav-links a {
  color: var(--muted-rose);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  padding: 8px 14px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

nav .nav-links a:hover {
  color: var(--gold);
  background: rgba(212, 168, 83, 0.08);
}

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

/* ========== Main ========== */
main {
  padding-top: 64px;
  min-height: 100vh;
}

/* ========== Page Container ========== */
.page {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px;
}

.page-wide {
  max-width: 1100px;
}

/* ========== Typography ========== */
h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
}

h1 {
  font-size: 36px;
  color: var(--soft-white);
  margin-bottom: 8px;
}

h2 {
  font-size: 28px;
  color: var(--champagne);
  margin-bottom: 24px;
}

h3 {
  font-size: 20px;
  color: var(--champagne);
}

.subtitle {
  font-size: 16px;
  color: var(--muted-rose);
  font-weight: 300;
  margin-bottom: 40px;
  line-height: 1.6;
}

.section-label {
  font-size: 11px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 24px;
  font-weight: 500;
}

/* ========== Forms ========== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--muted-rose);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--soft-white);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(253, 248, 244, 0.3);
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%23D4A853'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.form-group select option {
  background: var(--deep-plum);
  color: var(--soft-white);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  gap: 8px;
  line-height: 1.4;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), #C4952E);
  color: var(--warm-black);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(212, 168, 83, 0.3);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--input-border);
  color: var(--muted-rose);
}

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

.btn-danger {
  background: rgba(231, 76, 60, 0.12);
  border: 1px solid rgba(231, 76, 60, 0.25);
  color: #E8A099;
}

.btn-danger:hover {
  background: rgba(231, 76, 60, 0.2);
}

.btn-block { width: 100%; }

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ========== Cards ========== */
.card {
  background: var(--card-bg);
  border: 1px solid rgba(212, 168, 83, 0.1);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
  transition: border-color 0.3s ease;
}

.card:hover {
  border-color: rgba(212, 168, 83, 0.2);
}

/* ========== Match Cards ========== */
.match-card {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.match-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(212, 168, 83, 0.4);
  flex-shrink: 0;
}

.match-photo-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--deep-plum));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  color: var(--champagne);
  flex-shrink: 0;
  border: 2px solid rgba(212, 168, 83, 0.3);
}

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

.match-info h3 {
  margin-bottom: 4px;
  font-size: 18px;
}

.match-detail {
  font-size: 14px;
  color: var(--muted-rose);
  margin-bottom: 8px;
}

.match-reasoning {
  font-size: 13px;
  color: rgba(253, 248, 244, 0.5);
  font-style: italic;
  margin-bottom: 12px;
  line-height: 1.6;
}

.match-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.match-score {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--gold);
  background: rgba(212, 168, 83, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.prep-cost-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--champagne);
  background: rgba(196, 145, 142, 0.15);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(196, 145, 142, 0.2);
  margin-bottom: 12px;
}

.interest-chip {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(196, 145, 142, 0.1);
  color: var(--muted-rose);
  display: inline-block;
}

/* ========== Chat ========== */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 280px);
  min-height: 400px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(212, 168, 83, 0.2);
  border-radius: 2px;
}

.message {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.5;
  word-wrap: break-word;
}

.message.sent {
  align-self: flex-end;
  background: var(--gold);
  color: var(--warm-black);
  border-bottom-right-radius: 4px;
}

.message.received {
  align-self: flex-start;
  background: var(--card-bg);
  border: 1px solid rgba(212, 168, 83, 0.1);
  border-bottom-left-radius: 4px;
}

.message-time {
  font-size: 11px;
  opacity: 0.6;
  margin-top: 4px;
}

.chat-input {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid rgba(212, 168, 83, 0.1);
}

.chat-input input {
  flex: 1;
  padding: 14px 20px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 24px;
  color: var(--soft-white);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.3s ease;
}

.chat-input input:focus {
  border-color: var(--gold);
}

.chat-input input::placeholder {
  color: rgba(253, 248, 244, 0.3);
}

.chat-input button {
  padding: 14px 24px;
  background: var(--gold);
  color: var(--warm-black);
  border: none;
  border-radius: 24px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.chat-input button:hover {
  box-shadow: 0 4px 16px rgba(212, 168, 83, 0.3);
}

/* ========== Gender Selection ========== */
.gender-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 40px 0;
}

.gender-card {
  padding: 40px 24px;
  text-align: center;
  background: var(--card-bg);
  border: 2px solid rgba(212, 168, 83, 0.12);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.gender-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(212, 168, 83, 0.1);
}

.gender-card .gender-icon {
  font-size: 48px;
  margin-bottom: 16px;
  line-height: 1;
}

.gender-card h3 {
  font-size: 24px;
  margin-bottom: 8px;
}

.gender-card p {
  font-size: 14px;
  color: var(--muted-rose);
  line-height: 1.5;
}

/* ========== Interest Tags ========== */
.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.interest-tag {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--input-border);
  color: var(--muted-rose);
  background: transparent;
  font-family: 'DM Sans', sans-serif;
}

.interest-tag.selected {
  background: rgba(212, 168, 83, 0.15);
  border-color: var(--gold);
  color: var(--gold);
}

.interest-tag:hover {
  border-color: var(--gold);
}

/* ========== Tabs ========== */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 32px;
  border-bottom: 1px solid rgba(212, 168, 83, 0.1);
  overflow-x: auto;
}

.tab {
  padding: 12px 20px;
  font-size: 14px;
  color: var(--muted-rose);
  cursor: pointer;
  border: none;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
  background: none;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
}

.tab:hover {
  color: var(--champagne);
}

.tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.tab-count {
  font-size: 12px;
  background: rgba(212, 168, 83, 0.15);
  color: var(--gold);
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
}

/* ========== Empty State ========== */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state h3 {
  color: var(--muted-rose);
  margin-bottom: 8px;
  font-size: 18px;
}

.empty-state p {
  font-size: 14px;
  color: rgba(253, 248, 244, 0.4);
  max-width: 360px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ========== Payment Modal ========== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--deep-plum);
  border: 1px solid rgba(212, 168, 83, 0.2);
  border-radius: 16px;
  padding: 36px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  animation: slideUp 0.3s ease;
}

.modal h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.modal .amount {
  font-family: 'Playfair Display', serif;
  font-size: 52px;
  color: var(--gold);
  margin: 24px 0;
}

.modal p {
  font-size: 14px;
  color: var(--muted-rose);
  line-height: 1.6;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.modal-actions .btn {
  flex: 1;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ========== Toast ========== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 24px;
  background: var(--deep-plum);
  border: 1px solid var(--gold);
  border-radius: 10px;
  color: var(--soft-white);
  font-size: 14px;
  z-index: 300;
  animation: slideIn 0.3s ease;
  max-width: 360px;
}

.toast.error {
  border-color: var(--error);
}

@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ========== Loading ========== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(212, 168, 83, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ========== Profile ========== */
.profile-header {
  text-align: center;
  margin-bottom: 40px;
}

.profile-photo-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold);
  margin-bottom: 16px;
}

.profile-photo-placeholder-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--deep-plum));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 40px;
  color: var(--champagne);
  margin: 0 auto 16px;
  border: 3px solid rgba(212, 168, 83, 0.3);
}

/* ========== Step Indicator ========== */
.step-indicator {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 40px;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(212, 168, 83, 0.2);
  transition: all 0.3s ease;
}

.step-dot.active {
  background: var(--gold);
  width: 24px;
  border-radius: 4px;
}

.step-dot.done {
  background: var(--gold);
}

/* ========== Auth Link ========== */
.auth-link {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--muted-rose);
}

.auth-link a {
  color: var(--gold);
  text-decoration: none;
}

.auth-link a:hover {
  text-decoration: underline;
}

/* ========== Prep Cost ========== */
.prep-cost-display {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  color: var(--gold);
  text-align: center;
  margin: 16px 0;
}

input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  background: transparent;
  margin: 8px 0;
}

input[type="range"]::-webkit-slider-track {
  height: 4px;
  background: rgba(212, 168, 83, 0.2);
  border-radius: 2px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  margin-top: -9px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(212, 168, 83, 0.3);
}

input[type="range"]::-moz-range-track {
  height: 4px;
  background: rgba(212, 168, 83, 0.2);
  border-radius: 2px;
  border: none;
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(212, 168, 83, 0.3);
}

/* ========== Back Link ========== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-rose);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 24px;
  transition: color 0.3s ease;
}

.back-link:hover {
  color: var(--gold);
}

/* ========== Partner Profile ========== */
.partner-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 24px;
  padding: 32px;
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid rgba(212, 168, 83, 0.1);
}

.partner-interests {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
}

.partner-interests span {
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 16px;
  background: rgba(196, 145, 142, 0.12);
  color: var(--muted-rose);
  border: 1px solid rgba(196, 145, 142, 0.15);
}

/* ========== Divider ========== */
.divider {
  width: 60px;
  height: 1px;
  background: var(--gold);
  margin: 32px auto;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .page {
    padding: 24px 16px;
  }

  h1 { font-size: 28px; }
  h2 { font-size: 22px; }

  .match-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .match-actions {
    justify-content: center;
  }

  .gender-cards {
    grid-template-columns: 1fr;
  }

  nav {
    padding: 0 16px;
  }

  .modal {
    margin: 16px;
    padding: 28px 20px;
  }

  .message {
    max-width: 85%;
  }

  .chat-container {
    height: calc(100vh - 240px);
  }

  .chat-input button {
    padding: 14px 18px;
  }
}

@media (max-width: 480px) {
  .tab {
    font-size: 13px;
    padding: 10px 14px;
  }

  .match-photo,
  .match-photo-placeholder {
    width: 64px;
    height: 64px;
    font-size: 22px;
  }

  .btn-lg {
    padding: 14px 24px;
    font-size: 15px;
  }
}
