/* CSS Variables */
:root {
  --primary: #000000;
  --primary-foreground: #FFFFFF;
  --secondary: #8b5cf6;
  --secondary-foreground: #FFFFFF;
  --accent: #2563eb;
  --accent-foreground: #FFFFFF;
  --background: #FFFFFF;
  --foreground: #111827;
  --card: #FFFFFF;
  --card-foreground: #111827;
  --border: #E5E7EB;
  --input: #E5E7EB;
  --ring: #000000;
  --muted: #F3F4F6;
  --muted-foreground: #6B7280;
  --font-family: 'Open Sans', sans-serif;
  --radius: 0.75rem;
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
}

body, h1, h2, h3, h4, h5, h6, p, ul, ol, li, figure, blockquote, dl, dd {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  line-height: 1.6;
  color: var(--foreground);
  background: var(--background);
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

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

/* Utility Classes */
.hidden {
  display: none !important;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.text-primary {
  color: var(--primary);
}

.text-muted {
  color: var(--muted-foreground);
}

.text-lg {
  font-size: 1.125rem;
}

.text-sm {
  font-size: 0.875rem;
}

.font-semibold {
  font-weight: 600;
}

.font-medium {
  font-weight: 500;
}

.mb-4 {
  margin-bottom: 1rem;
}

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

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

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

@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Buttons */
.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  border: 2px solid var(--primary);
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s ease;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  background: var(--foreground);
  border-color: var(--foreground);
  color: var(--primary-foreground);
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  border: 2px solid var(--primary);
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s ease;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--primary-foreground);
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.btn-outline:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Icons */
.icon-box {
  width: 3rem;
  height: 3rem;
  border: 4px solid var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.icon-sm {
  width: 1.25rem;
  height: 1.25rem;
}

.icon-md {
  width: 1.5rem;
  height: 1.5rem;
}

.icon-lg {
  width: 2rem;
  height: 2rem;
}

/* Header and Navigation */
.header {
  background: var(--background);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav {
  padding: 1rem 0;
}

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

.nav-brand .logo-img {
  height: 2.5rem;
  width: auto;
}

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

.nav-links a {
  font-weight: 500;
  transition: color 0.3s ease;
}

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

.marnosteli-top_mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.marnosteli-top_mobile-menu {
  display: none;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}

.marnosteli-top_mobile-menu a {
  padding: 0.5rem 0;
  font-weight: 500;
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  
  .marnosteli-top_mobile-menu-toggle {
    display: block;
  }
  
  .marnosteli-top_mobile-menu {
    display: flex;
  }
  
  .marnosteli-top_mobile-menu.hidden {
    display: none;
  }
}

/* Hero Section */
.hero {
  background: var(--primary);
  color: #fff;
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 7rem 0;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero p {
    font-size: 1.1rem;
  }
  
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
}

/* Sections */
section {
  padding: 7rem 0;
}

.section-alt {
  background: var(--muted);
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.section-header p {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  max-width: 600px;
  margin: 0 auto;
}

/* Page Header */
.page-header {
  background: var(--muted);
  padding: 4rem 0;
  text-align: center;
}

.page-header h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.page-header p {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  max-width: 600px;
  margin: 0 auto;
}

/* Cards */
.feature-card,
.service-card,
.team-card,
.value-card,
.package-card {
  background: var(--card);
  color: var(--card-foreground);
  border-left: 4px solid var(--primary);
  padding: 2rem;
  border-radius: var(--radius);
  height: 100%;
}

.feature-card h3,
.service-card h3,
.team-card h3,
.value-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.feature-card p,
.service-card p,
.team-card p,
.value-card p {
  color: var(--muted-foreground);
  line-height: 1.6;
}

/* Team Cards */
.team-avatar {
  text-align: center;
  margin-bottom: 1.5rem;
}

.avatar-icon {
  width: 4rem;
  height: 4rem;
  color: var(--primary);
}

.team-role {
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.expertise-tag {
  display: inline-block;
  background: var(--muted);
  color: var(--foreground);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  margin: 0.25rem 0.25rem 0 0;
}

/* Service Cards */
.service-image {
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
}

.service-content ul {
  list-style: none;
  margin: 1.5rem 0;
}

.service-content li {
  padding: 0.5rem 0;
  color: var(--muted-foreground);
}

/* Package Cards */
.package-card.featured {
  border-left-color: var(--accent);
  transform: scale(1.05);
}

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

.package-subtitle {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.package-features ul {
  list-style: none;
  margin: 2rem 0;
}

.package-features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.check-icon {
  color: var(--primary);
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.package-cta {
  text-align: center;
}

/* Process Steps */
.process-step {
  text-align: center;
  position: relative;
}

.step-number {
  background: var(--primary);
  color: var(--primary-foreground);
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0 auto 1rem;
}

/* CTA Sections */
.cta-section {
  background: var(--background);
}

.cta-card {
  background: var(--card);
  color: var(--card-foreground);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 4rem 2rem;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.cta-card h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.cta-card p {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  margin-bottom: 2rem;
}

.cta-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .cta-actions {
    flex-direction: column;
    align-items: center;
  }
}

/* Forms */
.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--input);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-actions {
  text-align: center;
  margin-top: 2rem;
}

.marnosteli-top_contact-form {
  max-width: 800px;
  margin: 0 auto;
  background: var(--card);
  padding: 3rem;
  border-radius: var(--radius);
  border-left: 4px solid var(--primary);
}

.form-header {
  text-align: center;
  margin-bottom: 3rem;
}

.form-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.success-message {
  background: #10b981;
  color: white;
  padding: 2rem;
  border-radius: var(--radius);
  text-align: center;
  margin-top: 2rem;
}

.success-message h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

/* FAQ */
.faq-item {
  background: var(--card);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
}

.faq-question {
  padding: 1.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.3s ease;
}

.faq-question:hover {
  background: var(--muted);
}

.faq-question h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.faq-icon {
  flex-shrink: 0;
  margin-left: 1rem;
}

.faq-answer {
  padding: 0 1.5rem 1.5rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

.faq-answer p {
  margin-bottom: 1rem;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

/* Legal Content */
.legal-content {
  padding: 4rem 0;
}

.legal-header {
  text-align: center;
  margin-bottom: 3rem;
}

.legal-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.last-updated {
  color: var(--muted-foreground);
  font-style: italic;
}

.legal-text {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.8;
}

.legal-text h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 3rem 0 1.5rem;
  color: var(--primary);
}

.legal-text h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
}

.legal-text p {
  margin-bottom: 1.5rem;
}

.legal-text ul {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

.legal-text li {
  margin-bottom: 0.75rem;
}

.contact-details {
  background: var(--muted);
  padding: 1.5rem;
  border-radius: var(--radius);
  margin: 2rem 0;
}

/* Cookie Table */
.cookie-table {
  overflow-x: auto;
  margin: 2rem 0;
}

.cookie-table table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
}

.cookie-table th,
.cookie-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.cookie-table th {
  background: var(--muted);
  font-weight: 600;
}

/* Footer */
.footer {
  background: #111827;
  color: #f9fafb;
  padding: 4rem 0 2rem;
}

.footer a {
  color: #d1d5db;
  transition: color 0.3s ease;
}

.footer a:hover {
  color: #ffffff;
}

.footer-content {
  margin-bottom: 2rem;
}

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

.footer-brand h4 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1rem 0;
}

.footer-logo {
  height: 2rem;
  width: auto;
  filter: brightness(0) invert(1);
}

.footer-contact {
  margin-top: 1rem;
}

.footer-contact p {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.footer-links-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.footer-links h5,
.footer-contact-info h5 {
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-links a,
.footer-contact-info a {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.footer-legal-links {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #374151;
}

.footer-legal-links a {
  margin-right: 1rem;
}

.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 2rem;
  text-align: center;
}

.footer-bottom p {
  font-size: 0.875rem;
  color: #9ca3af;
}

@media (max-width: 768px) {
  .footer-main,
  .footer-links-section {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Cookie Banner and Modal */
.marnosteli-top_cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  z-index: 10000;
  box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
}

.marnosteli-top_cookie-banner-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.marnosteli-top_cookie-banner-text {
  flex: 1;
}

.marnosteli-top_cookie-banner-actions {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
}

.marnosteli-top_cookie-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
}

.marnosteli-top_cookie-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.marnosteli-top_cookie-modal-content {
  position: relative;
  background: var(--card);
  padding: 2rem;
  border-radius: var(--radius);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.cookie-toggles {
  margin: 1.5rem 0;
}

.marnosteli-top_cookie-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.marnosteli-top_cookie-toggle-row:last-child {
  border-bottom: none;
}

.marnosteli-top_cookie-modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
}

@media (max-width: 768px) {
  .marnosteli-top_cookie-banner-inner {
    flex-direction: column;
    gap: 1rem;
  }
  
  .marnosteli-top_cookie-banner-actions {
    width: 100%;
    justify-content: center;
  }
  
  .marnosteli-top_cookie-modal-actions {
    flex-direction: column;
  }
}

/* Contact Page Specific */
.contact-info-grid {
  text-align: center;
}

.contact-info-item h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.contact-option {
  text-align: center;
  padding: 2rem;
  background: var(--card);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
}

.contact-option h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.detail-item,
.response-item,
.development-point,
.choose-point {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.detail-item h4,
.response-item h4,
.development-point h4,
.choose-point h4 {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .container {
    padding: 0 1.5rem;
  }
  
  section {
    padding: 5rem 0;
  }
}

@media (max-width: 768px) {
  section {
    padding: 3rem 0;
  }
  
  .section-header h2 {
    font-size: 2rem;
  }
  
  .page-header h1 {
    font-size: 2.5rem;
  }
  
  .cta-card {
    padding: 3rem 1.5rem;
  }
  
  .cta-card h2 {
    font-size: 2rem;
  }
  
  .marnosteli-top_contact-form {
    padding: 2rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .section-header h2 {
    font-size: 1.75rem;
  }
  
  .page-header h1 {
    font-size: 2rem;
  }
  
  .cta-card h2 {
    font-size: 1.75rem;
  }
  
  .marnosteli-top_contact-form {
    padding: 1.5rem;
  }
}

/* === CLASS ALIAS FIXES (injected by engine) === */
.hero-text { /* alias for .hero-content */ }
.hero-text {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 7rem 0;
}

/* === BASELINE SAFETY CSS (injected by engine) === */

/* Ensure .hidden works consistently even with ID-specific overrides */
.hidden { display: none !important; }

/* Prevent content overflow breaking layout */
img, video, iframe { max-width: 100%; height: auto; }
* { box-sizing: border-box; }

/* Ensure container has responsive padding */
.container { width: 100%; max-width: 1200px; margin-left: auto; margin-right: auto; padding-left: 1rem; padding-right: 1rem; }

/* Prevent flex/grid children from overflowing */
.grid-2, .grid-3, .grid-4 { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Responsive grid fallbacks */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* Ensure forms don't break layout */
.form-input, input[type="text"], input[type="email"], input[type="tel"], textarea, select {
  width: 100%;
  max-width: 100%;
}

/* Success message styling */
.success-message {
  margin-top: 1rem;
  padding: 1rem;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  border-radius: 0.5rem;
  color: #065f46;
  text-align: center;
}

/* Stacking context for hero sections — prevents z-index:-1 children from going behind the page */
.hero, .hero-section, .page-header, .cta, .cta-section { isolation: isolate; position: relative; }

/* Desktop nav injected by engine — show on desktop, hide on mobile */
.nav-menu { display: flex; align-items: center; gap: 1.5rem; }
.nav-menu .nav-link { text-decoration: none; color: var(--foreground, #1f2937); font-weight: 500; font-size: 0.95rem; transition: color 0.2s; }
.nav-menu .nav-link:hover { color: var(--primary, #2563eb); }
@media (max-width: 768px) {
  .nav-menu { display: none !important; }
}

/* Fixed header body padding safety */
body { min-height: 100vh; }

/* Prevent long words breaking layout */
h1, h2, h3, h4, p, li, td, th { overflow-wrap: break-word; word-wrap: break-word; }

/* === END BASELINE SAFETY CSS === */

/* Cookie banner visibility rules */
#marnosteli-top_cookie-banner.hidden, #cookie-consent-banner.hidden { display: none !important; }
#marnosteli-top_cookie-banner:not(.hidden), #cookie-consent-banner:not(.hidden) { display: block !important; }
#marnosteli-top_cookie-modal.hidden { display: none !important; }
.hidden { display: none !important; }
