/* ============================================================
   OilBridge — EU Oil Marketplace
   Sentari Holding BV
   ============================================================ */

/* === CSS Custom Properties === */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 20px rgba(232,160,32,0.15);
  --transition: 0.2s ease;
  --max-width: 1280px;
  --header-height: 64px;
}

[data-theme="dark"] {
  --bg-primary: #0d0f0e;
  --bg-secondary: #131614;
  --bg-tertiary: #1a1d1b;
  --bg-card: #1e2220;
  --bg-card-hover: #252927;
  --bg-input: #151816;
  --accent: #e8a020;
  --accent-hover: #f0b040;
  --accent-muted: rgba(232,160,32,0.12);
  --accent-border: rgba(232,160,32,0.25);
  --text-primary: #e8e6e3;
  --text-secondary: #a8a5a0;
  --text-muted: #6b6966;
  --text-inverse: #0d0f0e;
  --border: #2a2d2b;
  --border-light: #353835;
  --success: #2ecc71;
  --success-bg: rgba(46,204,113,0.1);
  --error: #e74c3c;
  --error-bg: rgba(231,76,60,0.1);
  --warning: #f39c12;
  --warning-bg: rgba(243,156,18,0.1);
  --info: #3498db;
  --info-bg: rgba(52,152,219,0.1);
  --overlay: rgba(0,0,0,0.7);
}

[data-theme="light"] {
  --bg-primary: #f0f1f0;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f8f8f7;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f5f4;
  --bg-input: #f5f5f4;
  --accent: #c8860a;
  --accent-hover: #b07508;
  --accent-muted: rgba(200,134,10,0.08);
  --accent-border: rgba(200,134,10,0.2);
  --text-primary: #1a1c1b;
  --text-secondary: #555753;
  --text-muted: #8a8d8b;
  --text-inverse: #ffffff;
  --border: #ddddd8;
  --border-light: #e8e8e5;
  --success: #27ae60;
  --success-bg: rgba(39,174,96,0.08);
  --error: #c0392b;
  --error-bg: rgba(192,57,43,0.08);
  --warning: #d4850a;
  --warning-bg: rgba(212,133,10,0.08);
  --info: #2980b9;
  --info-bg: rgba(41,128,185,0.08);
  --overlay: rgba(0,0,0,0.5);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 20px rgba(200,134,10,0.08);
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--transition), color var(--transition);
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
h1, h2, h3, h4, h5, h6 { line-height: 1.3; color: var(--text-primary); }
::selection { background: var(--accent); color: var(--text-inverse); }

/* === Container === */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* === Header & Navigation === */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-height);
  background: rgba(13,15,14,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
[data-theme="light"] .header { background: rgba(255,255,255,0.92); }

.nav {
  max-width: var(--max-width); margin: 0 auto; padding: 0 24px;
  height: 100%; display: flex; align-items: center; gap: 32px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-primary); flex-shrink: 0; }
.nav-brand-text { font-size: 1.2rem; color: var(--text-primary); letter-spacing: -0.5px; }
.nav-brand-text strong { color: var(--accent); }
.nav-logo { flex-shrink: 0; }

.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-link {
  padding: 8px 16px; border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 500;
  color: var(--text-secondary); transition: all var(--transition); white-space: nowrap;
}
.nav-link:hover { color: var(--text-primary); background: var(--accent-muted); }
.nav-link.active { color: var(--accent); background: var(--accent-muted); }

.nav-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.lang-select {
  background: var(--bg-tertiary); color: var(--text-secondary); border: 1px solid var(--border);
  padding: 6px 8px; border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.lang-select:hover { border-color: var(--accent-border); }

.theme-toggle {
  background: none; border: none; color: var(--text-secondary); padding: 6px;
  border-radius: var(--radius-sm); transition: all var(--transition); display: flex; align-items: center;
}
.theme-toggle:hover { color: var(--accent); background: var(--accent-muted); }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

.auth-buttons { display: flex; gap: 8px; }

/* User Menu */
.user-menu { position: relative; }
.user-menu-btn {
  display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px;
  background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: var(--radius-xl);
  color: var(--text-primary); transition: all var(--transition);
}
.user-menu-btn:hover { border-color: var(--accent-border); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent);
  color: var(--text-inverse); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
}
.user-name { font-size: 0.85rem; font-weight: 500; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 200px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: 4px; display: none; z-index: 200;
}
.user-dropdown.open { display: block; }
.dropdown-item {
  display: block; width: 100%; padding: 10px 16px; font-size: 0.9rem; color: var(--text-primary);
  background: none; border: none; text-align: left; border-radius: var(--radius-sm); transition: all var(--transition);
}
.dropdown-item:hover { background: var(--accent-muted); color: var(--accent); }
.dropdown-divider { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

/* Mobile Menu */
.mobile-menu-btn {
  display: none; background: none; border: none; padding: 4px; flex-direction: column; gap: 5px;
}
.mobile-menu-btn span {
  display: block; width: 22px; height: 2px; background: var(--text-primary);
  border-radius: 2px; transition: all 0.3s ease;
}
.mobile-menu-btn.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-menu-btn.open span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.mobile-overlay {
  display: none; position: fixed; inset: 0; z-index: 90; background: var(--overlay);
}
.mobile-overlay.open { display: block; }

/* === Main Content === */
.main { min-height: calc(100vh - var(--header-height) - 200px); margin-top: var(--header-height); }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 600;
  border: none; transition: all var(--transition); white-space: nowrap; cursor: pointer;
  text-decoration: none;
}
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 16px 32px; font-size: 1rem; }
.btn-primary { background: var(--accent); color: var(--text-inverse); }
.btn-primary:hover { background: var(--accent-hover); color: var(--text-inverse); box-shadow: var(--shadow-glow); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent-border); background: var(--bg-card-hover); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--accent); background: var(--accent-muted); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { opacity: 0.9; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* === Form Elements === */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; margin-bottom: 6px; font-size: 0.85rem; font-weight: 600;
  color: var(--text-secondary); letter-spacing: 0.3px;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 12px 16px; background: var(--bg-input); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.95rem;
  transition: all var(--transition); outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-muted);
}
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { min-height: 100px; resize: vertical; }
.form-error { font-size: 0.8rem; color: var(--error); margin-top: 4px; }
.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.form-input.error { border-color: var(--error); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-check {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 0.9rem;
}
.form-check input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--accent); margin-top: 2px; flex-shrink: 0; cursor: pointer;
}

/* File Upload Zone */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius-md); padding: 40px;
  text-align: center; cursor: pointer; transition: all var(--transition);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent); background: var(--accent-muted);
}
.upload-zone-icon { font-size: 2rem; margin-bottom: 8px; }
.upload-zone-text { color: var(--text-secondary); font-size: 0.9rem; }
.upload-zone-text strong { color: var(--accent); }
.upload-zone-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.upload-file-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.upload-file-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: var(--bg-tertiary); border-radius: var(--radius-sm); font-size: 0.85rem;
}
.upload-file-item .file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-file-item .file-remove { background: none; border: none; color: var(--error); font-size: 1.1rem; padding: 0 4px; }

/* === Cards === */
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 24px; transition: all var(--transition);
}
.card:hover { border-color: var(--border-light); }
.card-accent { border-left: 3px solid var(--accent); }

/* === Badges === */
.badge {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: var(--radius-xl);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-error { background: var(--error-bg); color: var(--error); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-accent { background: var(--accent-muted); color: var(--accent); }

/* === Tables === */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border); }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: 14px 16px; font-size: 0.8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted);
  background: var(--bg-tertiary); border-bottom: 1px solid var(--border);
}
.table td {
  padding: 14px 16px; font-size: 0.9rem; border-bottom: 1px solid var(--border);
}
.table tbody tr:hover { background: var(--accent-muted); }
.table tbody tr:last-child td { border-bottom: none; }

/* === Tags === */
.tag {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: var(--radius-sm);
  font-size: 0.8rem; font-weight: 500; background: var(--bg-tertiary); color: var(--text-secondary);
}
.tag-buy { background: rgba(52,152,219,0.12); color: var(--info); }
.tag-sell { background: rgba(46,204,113,0.12); color: var(--success); }

/* === Tabs === */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab {
  padding: 12px 20px; background: none; border: none; color: var(--text-secondary);
  font-size: 0.9rem; font-weight: 500; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: all var(--transition); cursor: pointer;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* === Steps === */
.steps { display: flex; gap: 0; margin-bottom: 32px; overflow-x: auto; }
.step {
  flex: 1; display: flex; align-items: center; gap: 10px; padding: 16px 20px; position: relative;
  font-size: 0.85rem; color: var(--text-muted); min-width: 0;
}
.step::after {
  content: ''; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 0; height: 0; border: 8px solid transparent; border-left-color: var(--border);
}
.step:last-child::after { display: none; }
.step-number {
  width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; border: 2px solid var(--border); color: var(--text-muted); flex-shrink: 0;
}
.step.active { color: var(--accent); }
.step.active .step-number { border-color: var(--accent); color: var(--accent); background: var(--accent-muted); }
.step.completed { color: var(--success); }
.step.completed .step-number { border-color: var(--success); color: #fff; background: var(--success); }
.step-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* === Hero Section === */
.hero {
  padding: 100px 24px 80px; text-align: center; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
}
.hero::before {
  content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(ellipse at center, var(--accent-muted) 0%, transparent 60%);
  animation: heroGlow 8s ease-in-out infinite alternate;
}
@keyframes heroGlow {
  0% { transform: translate(-10%, -10%) rotate(0deg); }
  100% { transform: translate(10%, 10%) rotate(5deg); }
}
.hero-content { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }
.hero h1 { font-size: 3rem; font-weight: 800; margin-bottom: 16px; letter-spacing: -1px; }
.hero h1 span { color: var(--accent); }
.hero p { font-size: 1.15rem; color: var(--text-secondary); max-width: 600px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero-stats {
  display: flex; gap: 48px; justify-content: center; margin-top: 64px;
  padding-top: 32px; border-top: 1px solid var(--border);
}
.hero-stat { text-align: center; }
.hero-stat-value { font-size: 2rem; font-weight: 800; color: var(--accent); }
.hero-stat-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }

/* === Listing Cards === */
.listings-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px;
}
.listing-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 0; overflow: hidden; transition: all var(--transition); cursor: pointer;
}
.listing-card:hover { border-color: var(--accent-border); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.listing-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.listing-card-type { font-weight: 700; font-size: 0.9rem; }
.listing-card-body { padding: 20px; }
.listing-card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 12px; }
.listing-card-meta { display: flex; flex-direction: column; gap: 8px; }
.listing-card-meta-item {
  display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-secondary);
}
.listing-card-meta-item svg { flex-shrink: 0; color: var(--text-muted); }
.listing-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-top: 1px solid var(--border); background: var(--bg-tertiary);
}
.listing-card-price { font-size: 1.15rem; font-weight: 800; color: var(--accent); }
.listing-card-price small { font-size: 0.75rem; font-weight: 400; color: var(--text-muted); }
.listing-card-date { font-size: 0.8rem; color: var(--text-muted); }

/* === Filter Bar === */
.filter-bar {
  display: flex; gap: 12px; flex-wrap: wrap; padding: 20px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 24px;
}
.filter-bar .form-input, .filter-bar .form-select {
  flex: 1; min-width: 160px; padding: 10px 14px; font-size: 0.85rem;
}

/* === Page Sections === */
.page-section { padding: 48px 24px; }
.page-section .container { max-width: var(--max-width); margin: 0 auto; }
.section-header { margin-bottom: 32px; }
.section-header h2 { font-size: 1.8rem; font-weight: 800; margin-bottom: 8px; }
.section-header p { color: var(--text-secondary); font-size: 1rem; }

/* === Auth Pages === */
.auth-page {
  min-height: calc(100vh - var(--header-height));
  display: flex; align-items: center; justify-content: center; padding: 48px 24px;
}
.auth-card {
  width: 100%; max-width: 480px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px; box-shadow: var(--shadow-lg);
}
.auth-card h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: 8px; }
.auth-card .auth-subtitle { color: var(--text-secondary); margin-bottom: 32px; }

.register-card { max-width: 640px; }

/* === Match Cards === */
.match-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; margin-bottom: 16px;
}
.match-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.match-card-body { padding: 24px; }
.match-card-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 24px; border-top: 1px solid var(--border); background: var(--bg-tertiary);
}
.match-details { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.match-detail { font-size: 0.9rem; }
.match-detail-label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 2px; }
.match-detail-value { font-weight: 600; }
.match-contact {
  margin-top: 16px; padding: 16px; background: var(--accent-muted);
  border-radius: var(--radius-sm); border: 1px solid var(--accent-border);
}
.match-contact h4 { font-size: 0.9rem; color: var(--accent); margin-bottom: 8px; }
.match-locked {
  margin-top: 16px; padding: 16px; text-align: center; color: var(--text-muted);
  font-size: 0.9rem; background: var(--bg-tertiary); border-radius: var(--radius-sm);
}

/* === Profile Page === */
.profile-page { padding: 48px 24px; }
.profile-header {
  display: flex; align-items: center; gap: 24px; margin-bottom: 40px;
  padding-bottom: 24px; border-bottom: 1px solid var(--border);
}
.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%; background: var(--accent);
  color: var(--text-inverse); display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 800; flex-shrink: 0;
}
.profile-info h2 { font-size: 1.5rem; font-weight: 800; }
.profile-info p { color: var(--text-secondary); }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* === Admin Page === */
.admin-page { padding: 48px 24px; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }
.admin-stat-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 24px; text-align: center;
}
.admin-stat-value { font-size: 2rem; font-weight: 800; color: var(--accent); }
.admin-stat-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }

/* === Commission Banner === */
.commission-banner {
  background: var(--accent-muted); border: 1px solid var(--accent-border);
  border-radius: var(--radius-md); padding: 16px 20px; margin-bottom: 24px;
  display: flex; align-items: center; gap: 12px;
}
.commission-banner-icon { font-size: 1.5rem; }
.commission-banner-text { font-size: 0.9rem; color: var(--text-secondary); }
.commission-banner-text strong { color: var(--accent); }

/* === Empty State === */
.empty-state { text-align: center; padding: 64px 24px; }
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 1.2rem; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); margin-bottom: 24px; }

/* === Watermark === */
.watermark-canvas {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: 0.035;
  display: none;
}
.watermark-active .watermark-canvas { display: block; }

/* === Onboarding === */
.onboarding-overlay { position: fixed; inset: 0; z-index: 10000; }
.onboarding-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.onboarding-tooltip {
  position: absolute; z-index: 10001; background: var(--bg-card); border: 1px solid var(--accent-border);
  border-radius: var(--radius-md); padding: 24px; max-width: 380px; box-shadow: var(--shadow-lg);
}
.onboarding-step-indicator {
  display: flex; gap: 6px; margin-bottom: 16px;
}
.onboarding-step-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--border);
}
.onboarding-step-dot.active { background: var(--accent); }
.onboarding-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.onboarding-desc { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.5; }
.onboarding-actions { display: flex; align-items: center; justify-content: space-between; }
.onboarding-nav { display: flex; gap: 8px; }

/* === Toast === */
.toast-container { position: fixed; top: 80px; right: 24px; z-index: 11000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 14px 20px; border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 500;
  min-width: 280px; max-width: 420px; box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease; display: flex; align-items: center; gap: 10px;
}
.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--error); color: #fff; }
.toast-info { background: var(--info); color: #fff; }
.toast-warning { background: var(--warning); color: #fff; }
.toast-close { background: none; border: none; color: inherit; opacity: 0.7; font-size: 1.2rem; margin-left: auto; padding: 0 4px; }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* === Modal === */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9000; background: var(--overlay);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  max-width: 560px; width: 100%; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; padding: 4px; cursor: pointer; }
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 24px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--border); }

/* === NDA Content === */
.nda-content {
  max-height: 300px; overflow-y: auto; padding: 20px; background: var(--bg-tertiary);
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  font-size: 0.85rem; line-height: 1.7; color: var(--text-secondary); margin-bottom: 16px;
}
.nda-content h4 { color: var(--text-primary); margin: 16px 0 8px; }
.nda-content h4:first-child { margin-top: 0; }

/* === Footer === */
.footer {
  border-top: 1px solid var(--border); padding: 48px 0 32px;
  background: var(--bg-secondary);
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.footer-brand .nav-brand-text { font-size: 1.3rem; }
.footer-tagline { color: var(--text-muted); margin-top: 8px; font-size: 0.9rem; }
.footer-company { color: var(--text-muted); font-size: 0.8rem; margin-top: 12px; }
.footer-links h4 { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; color: var(--text-muted); }
.footer-links a { display: block; color: var(--text-secondary); font-size: 0.9rem; padding: 4px 0; }
.footer-links a:hover { color: var(--accent); }
.footer-links p { font-size: 0.9rem; color: var(--text-secondary); padding: 4px 0; }

/* === Utility === */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-muted { color: var(--text-muted); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.inline-flex { display: inline-flex; align-items: center; gap: 8px; }

/* === Spinner === */
.spinner {
  width: 20px; height: 20px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === Divider === */
.divider { display: flex; align-items: center; gap: 16px; margin: 24px 0; color: var(--text-muted); font-size: 0.85rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* === Feature Cards (Homepage) === */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 32px; }
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 32px 24px; text-align: center; transition: all var(--transition);
}
.feature-card:hover { border-color: var(--accent-border); transform: translateY(-2px); }
.feature-card-icon { font-size: 2.5rem; margin-bottom: 16px; }
.feature-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.5; }

/* === Listing Detail === */
.listing-detail { padding: 48px 24px; }
.listing-detail-header { margin-bottom: 32px; }
.listing-detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; }
.listing-detail-info .card { margin-bottom: 16px; }
.listing-detail-sidebar .card { position: sticky; top: calc(var(--header-height) + 24px); }

/* === Responsive === */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 2.4rem; }
  .hero-stats { gap: 32px; }
  .listing-detail-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-links {
    display: none; flex-direction: column; position: fixed; top: var(--header-height);
    left: 0; right: 0; background: var(--bg-secondary); border-bottom: 1px solid var(--border);
    padding: 16px; gap: 4px; z-index: 95;
  }
  .nav-links.open { display: flex; }
  .mobile-menu-btn { display: flex; }
  .auth-buttons { display: none; }
  .user-name { display: none; }

  .hero { padding: 60px 16px 48px; }
  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: 1rem; }
  .hero-stats { flex-direction: column; gap: 16px; }
  .hero-actions { flex-direction: column; align-items: center; }

  .listings-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; }
  .form-row { grid-template-columns: 1fr; }
  .match-details { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .steps { flex-direction: column; }
  .step::after { display: none; }
  .admin-stats { grid-template-columns: 1fr 1fr; }

  .auth-card, .register-card { padding: 24px; }
  .page-section { padding: 32px 16px; }

  .table th, .table td { padding: 10px 12px; font-size: 0.8rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.5rem; }
  .hero-stat-value { font-size: 1.5rem; }
  .listing-card-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .match-card-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .match-card-footer { flex-direction: column; }
  .admin-stats { grid-template-columns: 1fr; }
  .profile-header { flex-direction: column; text-align: center; }
}

/* === Blog === */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 24px; }
.blog-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; transition: all var(--transition); cursor: pointer;
}
.blog-card:hover { border-color: var(--accent-border); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.blog-card-image {
  height: 200px; background: var(--bg-tertiary); display: flex; align-items: center;
  justify-content: center; font-size: 3.5rem; border-bottom: 1px solid var(--border);
}
.blog-card-body { padding: 24px; }
.blog-card-tag { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--accent); margin-bottom: 8px; }
.blog-card-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; line-height: 1.4; }
.blog-card-excerpt { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 16px; }
.blog-card-meta { font-size: 0.8rem; color: var(--text-muted); display: flex; gap: 16px; }

.blog-article { max-width: 800px; margin: 0 auto; }
.blog-article h1 { font-size: 2rem; font-weight: 800; margin-bottom: 16px; line-height: 1.3; }
.blog-article .article-meta { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 32px; display: flex; gap: 16px; flex-wrap: wrap; }
.blog-article .article-body { font-size: 1rem; line-height: 1.85; color: var(--text-secondary); }
.blog-article .article-body h2 { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); margin: 40px 0 16px; }
.blog-article .article-body h3 { font-size: 1.15rem; font-weight: 600; color: var(--text-primary); margin: 32px 0 12px; }
.blog-article .article-body p { margin-bottom: 16px; }
.blog-article .article-body ul, .blog-article .article-body ol { margin-bottom: 16px; padding-left: 24px; }
.blog-article .article-body li { margin-bottom: 8px; }
.blog-article .article-body blockquote {
  border-left: 3px solid var(--accent); padding: 16px 20px; margin: 24px 0;
  background: var(--accent-muted); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
}
.blog-article .article-cta {
  margin-top: 40px; padding: 32px; background: var(--bg-card); border: 1px solid var(--accent-border);
  border-radius: var(--radius-md); text-align: center;
}
.blog-article .article-cta h3 { margin-bottom: 8px; }
.blog-article .article-cta p { color: var(--text-secondary); margin-bottom: 20px; }

@media (max-width: 768px) {
  .blog-grid { grid-template-columns: 1fr; }
  .blog-article h1 { font-size: 1.5rem; }
}

/* === Trust Badges === */
.trust-badges-section {
  padding: 32px 24px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.trust-badges {
  max-width: var(--max-width); margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.trust-badge {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); transition: all var(--transition);
}
.trust-badge:hover {
  border-color: var(--accent-border); transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.trust-badge-icon {
  font-size: 1.75rem; flex-shrink: 0; width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-muted); border-radius: var(--radius-sm);
}
.trust-badge-text { min-width: 0; }
.trust-badge-title {
  font-weight: 700; font-size: 0.9rem; color: var(--text-primary);
  margin-bottom: 2px; line-height: 1.3;
}
.trust-badge-sub {
  font-size: 0.75rem; color: var(--text-muted); line-height: 1.3;
}

/* Count-up number styling: monospace width for smooth animation */
.hero-stat-value {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
  .trust-badges { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .trust-badges { grid-template-columns: 1fr; }
  .trust-badge { padding: 12px 16px; }
  .trust-badge-icon { width: 40px; height: 40px; font-size: 1.5rem; }
}

/* === Chat === */
.chat-page { padding: 24px; max-width: 800px; margin: 0 auto; }
.chat-header {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.chat-header-info { min-width: 0; }
.chat-header-info h3 { font-size: 1rem; font-weight: 700; }
.chat-header-info .text-muted { font-size: 0.8rem; }
.chat-status-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--success); display: inline-block;
  margin-right: 6px; animation: pulse 2s infinite;
}
.chat-status-dot.disconnected { background: var(--error); animation: none; }
@keyframes pulse { 0%,100% {opacity:1} 50% {opacity:0.4} }

.chat-body {
  background: var(--bg-secondary); border: 1px solid var(--border); border-top: none;
  height: 60vh; min-height: 400px; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.chat-empty { text-align: center; color: var(--text-muted); font-size: 0.9rem; margin: auto; }

.chat-msg { display: flex; flex-direction: column; max-width: 75%; }
.chat-msg.own { align-self: flex-end; align-items: flex-end; }
.chat-msg.other { align-self: flex-start; align-items: flex-start; }
.chat-msg-bubble {
  padding: 10px 14px; border-radius: var(--radius-md); font-size: 0.9rem;
  line-height: 1.5; word-wrap: break-word; white-space: pre-wrap;
}
.chat-msg.own .chat-msg-bubble { background: var(--accent); color: var(--text-inverse); border-bottom-right-radius: 4px; }
.chat-msg.other .chat-msg-bubble { background: var(--bg-card); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chat-msg.blocked .chat-msg-bubble {
  background: var(--error-bg); border: 1px dashed var(--error); color: var(--error); font-style: italic;
}
.chat-msg-meta { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; padding: 0 4px; }

.chat-system {
  align-self: center; max-width: 90%; padding: 10px 16px;
  background: var(--accent-muted); border: 1px solid var(--accent-border); color: var(--accent);
  border-radius: var(--radius-md); font-size: 0.85rem; text-align: center;
}
.chat-system.success { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.chat-system.warning { background: var(--warning-bg); border-color: var(--warning); color: var(--warning); }

.chat-input {
  background: var(--bg-card); border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md); padding: 12px;
  display: flex; gap: 8px; align-items: flex-end;
}
.chat-input textarea {
  flex: 1; min-height: 40px; max-height: 120px; padding: 10px 12px;
  background: var(--bg-input); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.9rem;
  resize: none; outline: none; font-family: inherit;
}
.chat-input textarea:focus { border-color: var(--accent); }
.chat-input button { flex-shrink: 0; }

.chat-warning-banner {
  background: var(--warning-bg); border: 1px solid var(--warning); color: var(--warning);
  padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.85rem; margin-bottom: 12px;
}

.chat-closed-banner {
  background: var(--warning-bg); border: 1px solid var(--warning); color: var(--warning);
  padding: 16px 20px; border-radius: var(--radius-md); margin-bottom: 16px; text-align: center;
}
.chat-closed-banner h3 { color: var(--warning); margin-bottom: 4px; }

.chat-confirmed-banner {
  background: var(--success-bg); border: 1px solid var(--success); color: var(--success);
  padding: 16px 20px; border-radius: var(--radius-md); margin-bottom: 16px; text-align: center;
}
.chat-confirmed-banner h3 { color: var(--success); margin-bottom: 4px; }
.chat-confirmed-banner code {
  background: rgba(0,0,0,0.15); padding: 2px 8px; border-radius: 4px;
  font-size: 0.9rem; color: var(--text-primary);
}

.chat-templates {
  background: var(--bg-card); border: 1px solid var(--border); border-top: none;
  padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.chat-templates-label {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); font-weight: 600; margin-right: 4px;
}
.chat-template-btn {
  background: var(--bg-tertiary); color: var(--text-secondary);
  border: 1px solid var(--border); padding: 6px 12px; border-radius: var(--radius-sm);
  font-size: 0.8rem; font-weight: 500; cursor: pointer; transition: all var(--transition);
}
.chat-template-btn:hover {
  background: var(--accent-muted); color: var(--accent); border-color: var(--accent-border);
}

@media (max-width: 768px) {
  .chat-msg { max-width: 90%; }
  .chat-body { height: 55vh; }
}

/* === Print === */
@media print {
  .header, .footer, .watermark-canvas, .toast-container, .onboarding-overlay { display: none !important; }
  .main { margin-top: 0; }
  body { background: #fff; color: #000; }
}
