:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --background: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --white: #ffffff;
  --border: #e5e7eb;
  --radius: 14px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--background);
  color: var(--text-main);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}
.container {
  max-width: 1200px;
  margin: auto;
  padding: 0 1rem;
}
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
}

.nav-actions {
  display: flex;
  gap: 0.75rem;
}
.btn {
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-lg {
  padding: 0.75rem 1.6rem;
  font-size: 1rem;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}
.hero {
  padding: 5rem 1rem;
  background: linear-gradient(135deg, #eef2ff, #f8fafc);
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.3rem, 5vw, 3.2rem);
  font-weight: 800;
  margin-bottom: 1rem;
}

.hero p {
  max-width: 620px;
  margin: auto;
  font-size: 1.05rem;
  color: var(--text-muted);
}

.hero-buttons {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.features {
  padding: 4rem 1rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

.feature-card h3 {
  color: var(--primary);
  margin-bottom: 0.6rem;
}

.feature-card p {
  color: var(--text-muted);
}
.cta {
  background: var(--primary);
  color: var(--white);
  padding: 4rem 1rem;
  text-align: center;
}

.cta h2 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin-bottom: 1.5rem;
}
.site-footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}
@media (max-width: 600px) {
  .nav-actions {
    gap: 0.5rem;
  }

  .btn {
    font-size: 0.9rem;
  }
}
/* ===============================
   AUTH PAGES (LOGIN / REGISTER)
   =============================== */

.auth-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #eef2ff, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Container */
.auth-container {
  width: 100%;
  max-width: 420px;
  padding: 1rem;
}

/* Card */
.auth-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.2rem 2rem;
  border: 1px solid var(--border);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.08);
  animation: fadeInUp 0.5s ease;
}

.auth-card h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  text-align: center;
}

.auth-card p {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 1.8rem;
  font-size: 0.95rem;
}

/* Form */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.form-group input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Submit Button */
.auth-card button {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.75rem;
  font-size: 1rem;
  border-radius: 999px;
}

/* Message */
.form-message {
  margin-top: 0.8rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Footer */
.auth-footer {
  margin-top: 1.6rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--primary);
  font-weight: 600;
}

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

/* Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile */
@media (max-width: 420px) {
  .auth-card {
    padding: 1.8rem 1.5rem;
  }
}
/* ===============================
   REGISTER PAGE EXTRAS
   =============================== */

/* Top brand header */
.auth-header {
  text-align: center;
  margin-bottom: 1.2rem;
}

.auth-header .brand {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.auth-header .brand-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Register subtitle */
.auth-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.6rem;
  text-align: center;
}

/* Stronger button for register */
.auth-card .btn-primary {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  font-weight: 700;
}

/* Success / error messages */
.form-message {
  min-height: 1.2em;
}

.form-message.success {
  color: #16a34a;
}

.form-message.error {
  color: #dc2626;
}

/* Slight spacing fix for long forms */
.auth-card form {
  margin-top: 0.8rem;
}

/* Mobile polish */
@media (max-width: 420px) {
  .auth-header .brand {
    font-size: 1.7rem;
  }
}
/* ===============================
   VERIFY EMAIL PAGE
   =============================== */

/* Title */
.auth-card h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 0.4rem;
  text-align: center;
}

/* Subtitle */
.auth-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.6rem;
  text-align: center;
}

/* Verification code input emphasis */
#codeInput {
  letter-spacing: 4px;
  font-weight: 700;
  text-align: center;
  font-size: 1.1rem;
}

/* Readonly email field style */
input[readonly] {
  background-color: #f1f5f9;
  cursor: not-allowed;
  color: #475569;
}

/* Verify button */
.auth-card .btn-primary {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  font-weight: 800;
  letter-spacing: 0.3px;
}

/* Success & error message spacing */
#verifyMessage {
  margin-top: 0.6rem;
  font-size: 0.9rem;
}

/* Mobile adjustments */
@media (max-width: 420px) {
  .auth-card h1 {
    font-size: 1.4rem;
  }

  #codeInput {
    font-size: 1rem;
    letter-spacing: 3px;
  }
}
/* ===============================
   DASHBOARD LAYOUT
   =============================== */

.dashboard {
  padding-bottom: 70px; /* space for bottom nav */
  min-height: 100vh;
  background: #f8fafc;
}

/* ===============================
   DASHBOARD HEADER
   =============================== */

.dashboard-header {
  background: #ffffff;
  padding: 14px 16px;
  font-weight: 700;
  font-size: 1.1rem;
  border-bottom: 1px solid #e5e7eb;
}

/* ===============================
   TAB CONTENT
   =============================== */

.tab-content {
  display: none;
  padding: 12px;
}

.tab-content.active {
  display: block;
}

/* ===============================
   CHAT PAGE
   =============================== */

.chat-container {
  background: #ffffff;
  border-radius: 12px;
  padding: 12px;
  height: calc(100vh - 200px);
  overflow-y: auto;
  box-shadow: 0 6px 18px rgba(0,0,0,0.04);
}

.msg {
  padding: 8px 10px;
  margin-bottom: 6px;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 0.9rem;
}

.chat-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.chat-form input {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
}

.chat-form button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 600;
}

/* ===============================
   MARKETPLACE
   =============================== */

.marketplace-container {
  display: grid;
  gap: 12px;
}

.listing {
  background: #ffffff;
  padding: 14px;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.04);
}

.listing h4 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.listing p {
  font-size: 0.9rem;
  color: #475569;
  margin-bottom: 6px;
}

.listing b {
  color: #16a34a;
}

.list-btn {
  position: fixed;
  bottom: 80px;
  right: 16px;
  background: var(--primary);
  color: white;
  border: none;
  padding: 14px 18px;
  border-radius: 50px;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(0,0,0,0.2);
}

/* ===============================
   SETTINGS PAGE
   =============================== */

.settings-container {
  background: #ffffff;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.04);
}

.profile-form {
  display: grid;
  gap: 10px;
}

.profile-form input {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
}

.profile-form button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px;
  border-radius: 8px;
  font-weight: 700;
}

.logout-btn {
  margin-top: 12px;
  width: 100%;
  background: #ef4444;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 8px;
  font-weight: 700;
}

/* ===============================
   BOTTOM NAVIGATION
   =============================== */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
}

.nav-btn {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: none;
  font-size: 0.75rem;
  color: #64748b;
}

.nav-btn.active {
  color: var(--primary);
  font-weight: 700;
}

/* ===============================
   EMPTY / ERROR MESSAGES
   =============================== */

.empty-msg,
.error-msg {
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
  margin-top: 20px;
}
/* ===============================
   CREATE LISTING PAGE
   =============================== */

.container {
  max-width: 500px;
  margin: 40px auto;
  padding: 16px;
}

.header {
  text-align: center;
  margin-bottom: 20px;
}

.header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
}

#createListingForm {
  background: #ffffff;
  padding: 20px;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.06);
  display: grid;
  gap: 14px;
}

#createListingForm .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#createListingForm label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}

#createListingForm input,
#createListingForm textarea {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 0.95rem;
}

#createListingForm textarea {
  min-height: 100px;
  resize: vertical;
}

.btn-submit {
  margin-top: 10px;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-submit:active {
  transform: scale(0.98);
}
/* ===============================
   SETTINGS PAGE
   =============================== */

.settings-container {
  max-width: 600px;
  margin: 40px auto;
  padding: 20px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.06);
  display: grid;
  gap: 24px;
}

.settings-container header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
  margin-bottom: 20px;
}

.settings-section {
  display: grid;
  gap: 12px;
}

.settings-section h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 8px;
}

.settings-section label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #334155;
}

.settings-section input {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  font-size: 0.95rem;
}

.settings-section button {
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: var(--primary);
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s;
}

.settings-section button:active {
  transform: scale(0.97);
}

.logout-btn {
  background: #ef4444;
}

.logout-btn:active {
  transform: scale(0.97);
}

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

  .settings-section input, 
  .settings-section button {
    font-size: 0.9rem;
    padding: 10px;
  }
}
/* =========================
   Dashboard Container
========================= */
.dashboard {
  display: flex;
  flex-direction: column;
  height: 100vh;
  font-family: 'Inter', sans-serif;
  background-color: #f4f6f9;
  color: #333;
  padding-bottom: 60px; /* space for bottom nav */
}

/* =========================
   Tab Content (Pages)
========================= */
.tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
}

/* =========================
   Dashboard Headers
========================= */
.dashboard-header {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: #111;
  text-align: center;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
}

/* =========================
   Chat Page
========================= */
.chat-container {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background-color: #fff;
}

.chat-container .msg {
  padding: 8px 12px;
  border-radius: 12px;
  background-color: #e0e7ff;
  max-width: 70%;
}

.chat-container .msg strong {
  color: #1e3a8a;
}

.chat-container .empty-msg,
.chat-container .error-msg {
  text-align: center;
  color: #999;
  margin-top: 20px;
}

.chat-form {
  display: flex;
  gap: 10px;
  padding-top: 10px;
}

.chat-form input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 25px;
  border: 1px solid #ccc;
  outline: none;
}

.chat-form input:focus {
  border-color: #4f46e5;
}

.chat-form button {
  padding: 10px 20px;
  border-radius: 25px;
  border: none;
  background-color: #4f46e5;
  color: #fff;
  cursor: pointer;
  transition: 0.3s;
}

.chat-form button:hover {
  background-color: #4338ca;
}

/* =========================
   Marketplace Page
========================= */
.marketplace-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.listing {
  padding: 15px;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.listing h4 {
  margin-bottom: 5px;
  color: #1e3a8a;
}

.listing p {
  font-size: 0.9rem;
  color: #555;
}

.listing b {
  color: #4f46e5;
}

.list-btn {
  margin-top: 15px;
  padding: 10px 20px;
  border: none;
  border-radius: 25px;
  background-color: #4f46e5;
  color: #fff;
  cursor: pointer;
  align-self: flex-start;
  transition: 0.3s;
}

.list-btn:hover {
  background-color: #4338ca;
}

.empty-msg {
  text-align: center;
  color: #999;
}

/* =========================
   Settings Page
========================= */
.settings-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-section {
  background-color: #fff;
  padding: 15px 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.settings-section h2 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.settings-section input {
  width: 100%;
  padding: 10px 12px;
  margin: 5px 0 10px 0;
  border-radius: 8px;
  border: 1px solid #ccc;
  outline: none;
}

.settings-section input:focus {
  border-color: #4f46e5;
}

.settings-section button {
  padding: 10px 20px;
  border-radius: 25px;
  border: none;
  background-color: #4f46e5;
  color: #fff;
  cursor: pointer;
  transition: 0.3s;
}

.settings-section button:hover {
  background-color: #4338ca;
}

.logout-btn {
  background-color: #ef4444;
}

.logout-btn:hover {
  background-color: #dc2626;
}

/* =========================
   Bottom Navigation
========================= */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: #fff;
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid #ddd;
  z-index: 100;
}

.bottom-nav .nav-btn {
  flex: 1;
  border: none;
  background: none;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #777;
  cursor: pointer;
  transition: 0.3s;
}

.bottom-nav .nav-btn.active {
  color: #4f46e5;
}

.bottom-nav .nav-btn .material-icons {
  font-size: 24px;margin-bottom: 2px;
}

/* =========================
   Responsive
========================= */
@media screen and (max-width: 768px) {
  .chat-container .msg {
    max-width: 90%;
  }

  .chat-form button, .list-btn, .settings-section button {
    padding: 8px 16px;
  }
}
/* ===========================
   Auth Pages (Register/Login/Verify)
=========================== */
.auth-body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #6a11cb, #2575fc);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  color: #fff;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header .brand {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
}

.auth-header .brand-sub {
  font-size: 1.1rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
}

.auth-container {
  width: 100%;
  max-width: 400px;
  background: #fff;
  color: #333;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  padding: 2rem;
  box-sizing: border-box;
}

.auth-card h2 {
  margin-top: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: #222;
}

.auth-card p.auth-note {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 1.5rem;
}

.auth-card .form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.25rem;
}

.auth-card label {
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"] {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 1rem;
  transition: all 0.2s ease-in-out;
}

.auth-card input[type="text"]:focus,
.auth-card input[type="email"]:focus,
.auth-card input[type="password"]:focus {
  outline: none;
  border-color: #2575fc;
  box-shadow: 0 0 8px rgba(37, 117, 252, 0.3);
}

.auth-card button.btn-primary {
  width: 100%;
  padding: 0.85rem;
  background-color: #2575fc;
  color: #fff;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease-in-out;
}

.auth-card button.btn-primary:hover {
  background-color: #1a5edb;
  transform: translateY(-2px);
}

.auth-card .form-message {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #e74c3c; /* error message */
}

.auth-card .auth-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: #555;
}

.auth-card .auth-footer a {
  color: #2575fc;
  text-decoration: none;
  font-weight: 600;
}

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

/* Resend code link */
#resendCode {
  color: #2575fc;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

#resendCode:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 480px) {
  .auth-container {
    padding: 1.5rem;
  }

  .auth-card h2 {
    font-size: 1.5rem;
  }

  .auth-card input[type="text"],
  .auth-card input[type="email"],
  .auth-card input[type="password"] {
    font-size: 0.95rem;
  }

  .auth-card button.btn-primary {
    font-size: 0.95rem;
  }
}
/* Center the register card specifically */
body.auth-body.register-page {
  display: flex;
  justify-content: center; /* horizontal */
  align-items: center;     /* vertical */
  min-height: 100vh;
  background-color: #f5f7fa;
}

.auth-container.register-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 1rem;
}

.auth-card.register-card {
  background-color: #ffffff;
  padding: 2rem;
  max-width: 400px;
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.1);
  text-align: center;
}