/* Fastighetsbevakningen — SPA Styles v8 */
/* ===================================== */
:root {
  --bg: #0a0a0b;
  --bg-card: #18181b;
  --bg-card-hover: #1f1f23;
  --bg-elevated: #1c1c20;
  --border: #27272a;
  --border-light: #3f3f46;
  --text: #e4e4e7;
  --text-muted: #a1a1aa;
  --text-dim: #52525b;
  --primary: #0d9488;
  --primary-hover: #0f766e;
  --primary-bg: rgba(13,148,136,0.12);
  --primary-glow: rgba(13,148,136,0.25);
  --success: #22c55e;
  --success-bg: rgba(34,197,94,0.12);
  --warning: #eab308;
  --warning-bg: rgba(234,179,8,0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239,68,68,0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.4);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.page { display: none; min-height: 100vh; }
.page.active { display: block; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.anim-fade { animation: fadeIn 0.4s ease forwards; }
.anim-fade-up { animation: fadeInUp 0.5s ease forwards; }

.stagger > * { opacity: 0; animation: fadeInUp 0.5s ease forwards; }
.stagger > :nth-child(1) { animation-delay: 0.05s; }
.stagger > :nth-child(2) { animation-delay: 0.1s; }
.stagger > :nth-child(3) { animation-delay: 0.15s; }
.stagger > :nth-child(4) { animation-delay: 0.2s; }
.stagger > :nth-child(5) { animation-delay: 0.25s; }

/* Navigation */
.nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1.5rem; border-bottom: 1px solid var(--border);
  background: rgba(10,10,11,0.92); backdrop-filter: blur(16px);
  position: sticky; top: 0; z-index: 100;
}
.nav-logo { font-weight: 800; font-size: 1.25rem; color: #fff; text-decoration: none; display: flex; align-items: center; gap: 0.4rem; }
.nav-links { display: flex; gap: 1.25rem; align-items: center; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 0.875rem; transition: color 0.2s; font-weight: 500; }
.nav-links a:hover { color: #fff; }

.nav-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #0891b2);
  color: #fff; font-weight: 700; font-size: 0.85rem;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font); font-weight: 600; font-size: 0.875rem;
  text-decoration: none; border: none; border-radius: var(--radius);
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; padding: 0.55rem 1.1rem; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: transparent; color: var(--text-muted); padding: 0.55rem 1.1rem; border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--border-light); color: #fff; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.75rem 1.75rem; font-size: 1rem; }
.btn-ghost { background: transparent; color: var(--text-muted); padding: 0.5rem 0.75rem; }
.btn-ghost:hover { color: #fff; }
.btn-full { width: 100%; justify-content: center; }
.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.2); }

/* Dashboard Layout */
.dashboard-grid { display: flex; min-height: calc(100vh - 56px); }
.sidebar {
  width: 240px; padding: 1.5rem; border-right: 1px solid var(--border);
  background: var(--bg); flex-shrink: 0;
}
.sidebar h3 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); margin-bottom: 0.75rem; }
.sidebar-menu { list-style: none; }
.sidebar-menu li { margin-bottom: 0.25rem; }
.sidebar-menu a {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.75rem; border-radius: var(--radius);
  color: var(--text-muted); text-decoration: none; font-size: 0.875rem; transition: all 0.2s;
}
.sidebar-menu a:hover { background: var(--bg-card); color: #fff; }
.main-content { flex: 1; padding: 1.5rem; min-width: 0; }

/* Cards */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem; transition: all 0.2s;
}
.card:hover { border-color: var(--border-light); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.card-title { font-size: 1rem; font-weight: 600; }

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.8125rem; font-weight: 500; color: var(--text-muted); margin-bottom: 0.375rem; }
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 0.625rem 0.75rem;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: var(--font); font-size: 0.875rem; transition: border-color 0.2s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus { outline: none; border-color: var(--primary); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.25rem; }

/* Toast */
#toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 1000; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
  padding: 0.75rem 1rem; border-radius: var(--radius);
  font-size: 0.875rem; display: flex; align-items: center; gap: 0.5rem;
  background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text);
  box-shadow: var(--shadow-lg); transform: translateX(120%); transition: transform 0.3s ease;
}
.toast-visible { transform: translateX(0); }
.toast-exit { transform: translateX(120%); opacity: 0; }
.toast-success { border-color: rgba(34,197,94,0.3); }
.toast-error { border-color: rgba(239,68,68,0.3); }

/* Auth Pages */
.auth-page { max-width: 400px; margin: 4rem auto; padding: 2rem; }
.auth-page h1 { font-size: 1.75rem; margin-bottom: 0.5rem; }
.auth-page p { color: var(--text-muted); margin-bottom: 2rem; }
.auth-separator { display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0; color: var(--text-dim); font-size: 0.8125rem; }
.auth-separator::before, .auth-separator::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Google Button */
.btn-google {
  background: #fff; color: #1f1f1f; border: 1px solid #d1d5db;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem; width: 100%;
}
.btn-google:hover { background: #f9fafb; }

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

/* Stat cards */
.stat-card { text-align: center; }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.25rem; }

/* Brief cards */
.brief-card { margin-bottom: 1rem; }
.brief-card h3 { font-size: 1.0625rem; font-weight: 600; margin-bottom: 0.5rem; }
.brief-meta { font-size: 0.75rem; color: var(--text-dim); margin-bottom: 0.75rem; }
.brief-body { font-size: 0.875rem; color: var(--text-muted); line-height: 1.7; }
.brief-body strong { color: var(--text); }

/* Tags */
.tag {
  display: inline-flex; align-items: center;
  padding: 0.15rem 0.5rem; border-radius: 999px;
  font-size: 0.6875rem; font-weight: 600;
}
.tag-primary { background: var(--primary-bg); color: var(--primary); }
.tag-success { background: var(--success-bg); color: var(--success); }
.tag-warning { background: var(--warning-bg); color: var(--warning); }

/* Pricing in dashboard */
.plan-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem; text-align: center; transition: all 0.2s;
}
.plan-card:hover { border-color: var(--primary); }
.plan-card.featured { border-color: var(--primary); box-shadow: 0 0 0 1px rgba(13,148,136,0.1); }
.plan-name { font-size: 1rem; font-weight: 700; margin-bottom: 0.25rem; }
.plan-price { font-size: 2rem; font-weight: 800; }
.plan-period { font-size: 0.875rem; color: var(--text-muted); font-weight: 400; }
.plan-features { list-style: none; margin: 1rem 0; font-size: 0.8125rem; color: var(--text-muted); }
.plan-features li { padding: 0.25rem 0; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center; z-index: 200;
}
.modal {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 2rem; max-width: 500px; width: 90%;
  box-shadow: var(--shadow-lg); animation: fadeIn 0.2s ease;
}
.modal h2 { margin-bottom: 1rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; }

/* Blog */
.blog-post { max-width: 680px; margin: 2rem auto; }
.blog-post h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.blog-post .blog-date { color: var(--text-dim); font-size: 0.875rem; margin-bottom: 2rem; }
.blog-post .blog-content { font-size: 1rem; line-height: 1.8; }
.blog-post .blog-content p { margin-bottom: 1rem; }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.125rem; margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* Profile */
.profile-section { margin-bottom: 2rem; }
.profile-section h3 { font-size: 0.9375rem; font-weight: 600; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }

/* FAQ */
.faq-item { margin-bottom: 1.5rem; }
.faq-item h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
.faq-item p { color: var(--text-muted); font-size: 0.875rem; line-height: 1.6; }

/* Utility */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.8125rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* Landing page redirect banner */
.landing-banner {
  text-align: center; padding: 0.5rem 1rem;
  background: var(--primary-bg); border-bottom: 1px solid rgba(13,148,136,0.2);
  font-size: 0.8125rem; color: var(--primary);
}
.landing-banner a { color: var(--primary); font-weight: 600; }

/* Responsive */
@media (max-width: 768px) {
  .dashboard-grid { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: 1rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .nav-links { gap: 0.75rem; }
  .nav-links a { font-size: 0.8125rem; }
}
