@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-app: transparent;
  --bg-card: rgba(255, 255, 255, 0.7);
  --bg-card-hover: rgba(255, 255, 255, 0.9);
  --text-main: #1e293b; /* Slate 800 */
  --text-muted: #64748b; /* Slate 500 */
  
  --primary: #312E81; /* Deep Indigo 900 */
  --primary-hover: #3730A3; /* Indigo 800 */
  --secondary: #047857; /* Emerald 700 */
  --accent: #10b981;
  --accent-light: #F0FDF4; /* Green 50 */
  --danger: #b91c1c; /* Red 700 */
  --danger-light: #fef2f2; /* Red 50 */
  --warning: #d97706;
  
  --border-light: rgba(0, 0, 0, 0.08);
  --glass-shadow: 0 10px 40px -10px rgba(49, 46, 129, 0.1);
  --radius-lg: 1.5rem;
  --radius-md: 1.25rem;
  --radius-sm: 0.75rem;
  
  --transition: all 0.3s ease;
}

.disabled-card {
  opacity: 0.6;
  filter: grayscale(0.5);
  pointer-events: none;
}

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

html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

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

.bg-fixed {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  background-color: #F0FDF4;
  background-image: url('../img/ratevy_bg_concept.png');
  background-size: 100% auto;
  background-position: center;
  background-repeat: no-repeat;
}

@media (max-width: 768px) {
  .bg-fixed {
    background-image: url('../img/ratevy_bg_concept_mobile.png');
    background-size: cover; /* Заполняет экран, обрезая лишнее по краям */
    background-position: center top; /* Оставляем фокус на верхней/центральной части картинки */
  }
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: linear-gradient(to bottom, rgba(240, 253, 244, 0.6), rgba(249, 250, 251, 0.8));
  z-index: -1;
  pointer-events: none;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* Typography */
h1, h2, h3, h4, h5 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-main);
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: -1px;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}

p {
  color: var(--text-muted);
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
}

/* Utility Classes */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
  border: none;
  font-family: inherit;
  font-size: 1rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 15px rgba(49, 46, 129, 0.3);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(49, 46, 129, 0.4);
}

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

.btn-outline:hover {
  background: rgba(49, 46, 129, 0.05);
}

.btn-accent {
  background: var(--accent-light);
  color: var(--secondary);
  border: 1px solid var(--secondary);
}

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

/* Layout - Header */
header {
  padding: 1.5rem 0;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

.logo span {
  color: var(--primary);
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--primary);
}

/* Hero Section */
.hero {
  padding: 10rem 0 6rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

/* Search Bar (Hybrid Onboarding) */
.search-box {
  margin-top: 3rem;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 0.5rem;
  display: flex;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  max-width: 600px;
  margin-inline: auto;
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 1rem 1.5rem;
  color: var(--text-main);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

/* Features Grid */
.features {
  padding: 6rem 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 4rem;
}

.feature-card {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  backdrop-filter: blur(12px);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--glass-shadow);
  border-color: rgba(49, 46, 129, 0.2);
}

.feature-icon {
  width: 50px;
  height: 50px;
  background: rgba(49, 46, 129, 0.05);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

/* Pricing Table */
.pricing {
  padding: 6rem 0;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 4rem;
}

.price-card {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.price-card.popular {
  border-color: var(--primary);
  transform: scale(1.05);
  box-shadow: var(--glass-shadow);
  z-index: 10;
}

.popular-badge {
  position: absolute;
  top: 1rem;
  right: -2rem;
  background: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 2.5rem;
  transform: rotate(45deg);
}

.price-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 2rem;
}

.price-amount {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 1rem 0 0.5rem;
}

.price-amount span {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 400;
}

.price-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.price-features li i {
  color: var(--secondary);
  margin-top: 0.25rem;
}

.price-card .btn {
  margin-top: auto;
  width: 100%;
}

/* Footer */
footer {
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  padding: 4rem 0 2rem;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 4rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  color: var(--text-main);
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--text-muted);
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 0.875rem;
}

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

.animate-fade-in {
  animation: fadeIn 0.8s ease forwards;
  opacity: 0;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }

/* Dashboard Base (Shared) */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  background: transparent;
}

.sidebar {
  width: 260px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  z-index: 100;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
}

.sidebar-nav {
  margin-top: 2rem;
  flex: 1;
}



.sidebar-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  transition: var(--transition);
  font-weight: 500;
}

.sidebar-link:hover, .sidebar-link.active {
  background: rgba(49, 46, 129, 0.05);
  color: var(--primary);
}

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  margin-left: 260px;
}

/* Responsive */
@media (max-width: 768px) {
  header { padding: 0.75rem 0; }
  .logo { font-size: 1.25rem; }
  .nav-links { display: none; }
  .nav-actions { gap: 0.5rem; }
  .nav-actions .btn { padding: 0.5rem 1rem; font-size: 0.85rem; }
  h1 { font-size: 2.5rem; }
  .price-card.popular { transform: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .dashboard-layout { flex-direction: column; overflow-x: hidden; width: 100%; }
  .sidebar { width: 100%; max-width: 100vw; height: auto; border-right: none; border-bottom: 1px solid var(--border-light); padding: 1rem; position: relative; }
  .main-content { margin-left: 0; width: 100%; max-width: 100vw; padding: 1rem; overflow-x: hidden; }
  .sidebar-nav { display: flex; overflow-x: auto; margin-top: 1rem; padding-bottom: 0.5rem; -webkit-overflow-scrolling: touch; }
  .sidebar-link { white-space: nowrap; margin-right: 0.5rem; }
}

/* Location Dropdown */
.location-dropdown {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  margin-left: -0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.location-dropdown:hover {
  background: rgba(0,0,0,0.05);
}
.location-dropdown h2 {
  margin: 0;
  font-size: 1.5rem;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content {
  background: white;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  color: var(--text-main);
}

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

.modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.75rem;
  cursor: pointer;
  transition: var(--transition);
}

.close-btn:hover {
  color: var(--danger);
}

/* Dashboard Elements Styled like Pricing Cards */
.stat-card {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--glass-shadow);
  transition: var(--transition);
}

.alert-box {
  background: rgba(239, 68, 68, 0.05); /* Reddish tint */
  border: 1px solid rgba(239, 68, 68, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--glass-shadow);
}

.alert-box.positive {
  background: rgba(16, 185, 129, 0.05); /* Greenish tint */
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.review-card {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  padding: 0; /* Handle internal padding in main.js */
  margin-bottom: 1.5rem;
  box-shadow: var(--glass-shadow);
  overflow: hidden;
}

.ai-reply-box {
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
  position: relative;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.ai-reply-box::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 30px;
  border-width: 0 10px 10px 10px;
  border-style: solid;
  border-color: transparent transparent rgba(255, 255, 255, 0.6) transparent;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 25px rgba(49, 46, 129, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}
.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Legal Documents Styles */
.legal-document {
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    line-height: 1.8;
}

.legal-document h1 { font-size: 2rem; margin-bottom: 8px; color: var(--text-main); }
.legal-document h2 { font-size: 1.3rem; margin-top: 40px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 8px; color: var(--primary); }
.legal-document h3 { font-size: 1.1rem; margin-top: 24px; color: var(--text-main); }
.legal-document table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 0.9rem; }
.legal-document th { background: rgba(255,255,255,0.05); padding: 10px 12px; text-align: left; color: var(--text-main); }
.legal-document td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.05); color: var(--text-muted); }
.legal-document .doc-meta { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 32px; }
.legal-document .doc-breadcrumb { margin-bottom: 24px; font-size: 0.9rem; color: var(--text-muted); }
.legal-document .doc-breadcrumb a { color: var(--primary); text-decoration: none; }
.legal-document .doc-version { margin-top: 60px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.85rem; color: var(--text-muted); }
.legal-document .doc-version a { color: var(--primary); }
.doc-actions { margin-top: 40px; display: flex; gap: 16px; align-items: center; }
.doc-actions button { padding: 10px 20px; cursor: pointer; }
