/* ==========================================================================
   IMMOBILIARE SAAS APP STYLESHEET
   ========================================================================== */

:root {
  --primary-hue: 218;
  --primary-sat: 85%;
  --primary-light: 45%;
  --primary: hsl(var(--primary-hue), var(--primary-sat), var(--primary-light));
  --primary-hover: hsl(var(--primary-hue), var(--primary-sat), 38%);
  --primary-glow: hsla(var(--primary-hue), var(--primary-sat), 45%, 0.15);
  
  --accent-hue: 155;
  --accent: hsl(var(--accent-hue), 70%, 42%);
  --accent-light: hsl(var(--accent-hue), 65%, 94%);
  --accent-glow: hsla(var(--accent-hue), 70%, 42%, 0.2);

  --gold-hue: 38;
  --gold: hsl(var(--gold-hue), 92%, 50%);
  --gold-light: hsl(var(--gold-hue), 100%, 95%);

  --danger-hue: 355;
  --danger: hsl(var(--danger-hue), 78%, 56%);
  --danger-light: hsl(var(--danger-hue), 100%, 96%);

  --bg-main: #f8fafc;
  --surface-card: #ffffff;
  --surface-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #cbd5e1;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --dark-bg: #0b1329;
  --dark-surface: #141f36;
  --dark-border: #233354;

  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
  --shadow-xl: 0 20px 30px -10px rgba(15, 23, 42, 0.2);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

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

.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--dark-bg);
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.brand-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  background: var(--dark-bg);
  color: #fbbf24;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 700;
}

.role-switcher-container {
  display: flex;
  align-items: center;
  background: var(--surface-subtle);
  padding: 4px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
  gap: 4px;
}

.role-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.role-btn:hover { color: var(--text-main); }
.role-btn.active {
  background: var(--surface-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-glow);
  color: var(--primary);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  border: 2px solid var(--border-color);
}

.app-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

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

.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: hsl(var(--accent-hue), 70%, 35%); }

.btn-outline { background: white; border-color: var(--border-color); color: var(--text-main); }
.btn-outline:hover { background: var(--surface-subtle); }

.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.82rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 0.85rem 1.75rem; font-size: 1rem; border-radius: var(--radius-md); }
.btn-full { width: 100%; }

.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--text-main); }

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: white;
  color: var(--text-main);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }

@media (max-width: 992px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .top-nav { flex-direction: column; gap: 0.75rem; }
}

.card {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-title { font-size: 1.15rem; font-weight: 700; color: var(--text-main); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-primary { background: var(--primary-glow); color: var(--primary); }
.badge-accent { background: var(--accent-light); color: var(--accent); }
.badge-gold { background: var(--gold-light); color: hsl(var(--gold-hue), 90%, 35%); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-neutral { background: var(--surface-subtle); color: var(--text-muted); }

.hero-section {
  background: linear-gradient(135deg, var(--dark-bg) 0%, #17254d 100%);
  color: white;
  border-radius: var(--radius-xl);
  padding: 4rem 3rem;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-xl);
}

.hero-content { max-width: 650px; }

.hero-title {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.hero-highlight {
  background: linear-gradient(120deg, #38bdf8, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc { font-size: 1.15rem; color: #94a3b8; margin-bottom: 2rem; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--dark-border);
}

.stat-val { font-size: 1.6rem; font-weight: 800; color: #38bdf8; }
.stat-lbl { font-size: 0.82rem; color: #94a3b8; }

.paywall-banner {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 1px solid #fdba74;
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.paywall-info h4 { font-size: 1.1rem; font-weight: 700; color: #9a3412; margin-bottom: 0.25rem; }
.paywall-info p { font-size: 0.9rem; color: #c2410c; }

.property-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.property-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.property-thumb {
  height: 200px;
  width: 100%;
  object-fit: cover;
  background: var(--surface-subtle);
  position: relative;
}

.property-blur-overlay {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(12px);
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  padding: 1rem;
  text-align: center;
}

.property-content {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.property-price { font-size: 1.4rem; font-weight: 800; color: var(--primary); margin-bottom: 0.25rem; }
.property-title { font-size: 1.05rem; font-weight: 700; color: var(--text-main); margin-bottom: 0.5rem; }
.property-specs { display: flex; gap: 1rem; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1rem; }

.property-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-container {
  background: white;
  border-radius: var(--radius-xl);
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: var(--shadow-xl);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  border: none;
  background: var(--surface-subtle);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.metric-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.metric-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.metric-data h3 { font-size: 1.6rem; font-weight: 800; margin-bottom: 0.25rem; }
.metric-data p { font-size: 0.82rem; color: var(--text-muted); font-weight: 600; }

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.custom-table th {
  background: var(--surface-subtle);
  padding: 0.75rem 1rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.custom-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.custom-table tr:hover { background: #f8fafc; }
