:root {
  --primary: #000000;
  --primary-foreground: #FFFFFF;
  --secondary: #F59F0A;
  --secondary-foreground: #111827;
  --accent: #28DCAF;
  --accent-foreground: #111827;
  --background: #0F172A;
  --foreground: #F8FAFC;
  --card: #1E293B;
  --card-foreground: #F8FAFC;
  --border: #334155;
  --input: #334155;
  --ring: #000000;
  --muted: #1E293B;
  --muted-foreground: #94A3B8;
  --font-family: 'Open Sans', sans-serif;
  --radius: 0.25rem;
}

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

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

.hidden {
  display: none !important;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

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

/* Buttons */
.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
  text-decoration: none;
}

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

.btn-outline {
  background: transparent;
  color: var(--foreground);
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--border);
  border-radius: 0;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
  text-decoration: none;
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

/* Grid Layouts */
.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;
}

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

/* Icons */
.icon-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.icon-sm { width: 1rem; height: 1rem; }
.icon-md { width: 1.5rem; height: 1.5rem; }
.icon-lg { width: 2rem; height: 2rem; }
.icon-xl { width: 3rem; height: 3rem; }

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

/* Forms */
.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--input);
  color: var(--foreground);
  font-family: var(--font-family);
}

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

.success-message {
  background: var(--card);
  border: 1px solid var(--secondary);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1rem;
  text-align: center;
}

.success-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

/* Top Bar */
.topbar {
  background: var(--secondary);
  color: var(--secondary-foreground);
  padding: 0.5rem 0;
  font-size: 0.875rem;
}

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

.topbar-left,
.topbar-right {
  display: flex;
  gap: 1rem;
}

.topbar a {
  color: var(--secondary-foreground);
  text-decoration: none;
}

.topbar a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .topbar-content {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .topbar-left,
  .topbar-right {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Navigation */
.navbar {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: relative;
  z-index: 1000;
}

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

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

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: var(--foreground);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.dorvalenti-top_mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.dorvalenti-top_mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--foreground);
  transition: all 0.3s ease;
}

.dorvalenti-top_mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 1rem;
}

.dorvalenti-top_mobile-menu ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dorvalenti-top_mobile-menu a {
  color: var(--foreground);
  font-weight: 500;
  text-decoration: none;
  padding: 0.5rem 0;
  display: block;
}

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

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  padding: 5rem 0;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: var(--radius);
}

.hero-text h1 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  color: #fff;
}

.hero-text p {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.9);
}

.hero-actions {
  display: flex;
  gap: 1rem;
}

@media (max-width: 768px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .hero-text h1 {
    font-size: 2rem;
  }
  
  .hero-actions {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* CTA Section */
.cta-section {
  background: var(--background);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 3rem 0;
  margin: 5rem 0;
}

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

.cta-content h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

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

/* Newsletter Section */
.newsletter-section {
  background: linear-gradient(180deg, var(--background) 0%, var(--muted) 100%);
  padding: 5rem 0;
}

.newsletter-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.newsletter-form-inner {
  display: flex;
  gap: 1rem;
}

.newsletter-form-inner input {
  flex: 1;
}

@media (max-width: 768px) {
  .newsletter-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .newsletter-form-inner {
    flex-direction: column;
  }
}

/* About Preview Section */
.about-preview {
  background: linear-gradient(180deg, var(--muted) 0%, var(--background) 100%);
  padding: 5rem 0;
}

.about-preview-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.about-preview-image img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: var(--radius);
}

@media (max-width: 768px) {
  .about-preview-content {
    grid-template-columns: 1fr;
  }
}

/* Process Section */
.process-section {
  background: linear-gradient(180deg, var(--background) 0%, var(--muted) 100%);
  padding: 5rem 0;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
}

.process-step {
  text-align: center;
  padding: 1.5rem;
}

.process-step h3 {
  margin-bottom: 1rem;
}

/* Stats Section */
.stats-section {
  background: linear-gradient(180deg, var(--muted) 0%, var(--background) 100%);
  padding: 5rem 0;
}

.stat-item {
  text-align: center;
  padding: 1.5rem;
}

.stat-item h3 {
  margin-bottom: 1rem;
}

/* Page Header */
.page-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  padding: 3rem 0;
  text-align: center;
}

.page-header h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #fff;
}

.page-header p {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.9);
}

/* Service Sections */
.service-section {
  background: linear-gradient(180deg, var(--background) 0%, var(--muted) 100%);
  padding: 5rem 0;
}

.service-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.service-content.reverse {
  background: linear-gradient(180deg, var(--muted) 0%, var(--background) 100%);
}

.service-content.reverse .service-text {
  order: 2;
}

.service-content.reverse .service-image {
  order: 1;
}

.service-image img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: var(--radius);
}

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

.service-features li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
  .service-content {
    grid-template-columns: 1fr;
  }
  
  .service-content.reverse .service-text,
  .service-content.reverse .service-image {
    order: unset;
  }
}

/* Benefits Section */
.benefits-section {
  background: linear-gradient(180deg, var(--background) 0%, var(--muted) 100%);
  padding: 5rem 0;
}

.benefit-item {
  text-align: center;
  padding: 1.5rem;
}

/* Company Story */
.company-story {
  background: linear-gradient(180deg, var(--background) 0%, var(--muted) 100%);
  padding: 5rem 0;
}

.story-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: center;
}

.story-image img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: var(--radius);
}

@media (max-width: 768px) {
  .story-content {
    grid-template-columns: 1fr;
  }
}

/* Mission & Vision */
.mission-vision {
  background: linear-gradient(180deg, var(--muted) 0%, var(--background) 100%);
  padding: 5rem 0;
}

.mission-card,
.vision-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}

/* Values Section */
.values-section {
  background: linear-gradient(180deg, var(--background) 0%, var(--muted) 100%);
  padding: 5rem 0;
}

.value-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

/* Team Section */
.team-section {
  background: linear-gradient(180deg, var(--muted) 0%, var(--background) 100%);
  padding: 5rem 0;
}

.team-member {
  text-align: center;
  padding: 1.5rem;
}

.member-icon {
  margin-bottom: 1rem;
}

/* Achievements Section */
.achievements-section {
  background: linear-gradient(180deg, var(--background) 0%, var(--muted) 100%);
  padding: 5rem 0;
}

.achievements-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: center;
}

.achievement-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.achievement-text h3 {
  margin-bottom: 0.5rem;
}

.achievements-image img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: var(--radius);
}

@media (max-width: 768px) {
  .achievements-content {
    grid-template-columns: 1fr;
  }
}

/* Contact Section */
.contact-section {
  background: linear-gradient(180deg, var(--background) 0%, var(--muted) 100%);
  padding: 5rem 0;
}

.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.dorvalenti-top_contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

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

.contact-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.contact-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.contact-placeholder {
  flex: 1;
}

.map-placeholder {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.contact-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-text p {
  margin-bottom: 0.25rem;
}

@media (max-width: 768px) {
  .contact-content {
    grid-template-columns: 1fr;
  }
}

/* Company Info Section */
.company-info-section {
  background: linear-gradient(180deg, var(--muted) 0%, var(--background) 100%);
  padding: 5rem 0;
}

.info-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

/* Legal Content */
.legal-content {
  background: linear-gradient(180deg, var(--background) 0%, var(--muted) 100%);
  padding: 5rem 0;
}

.legal-document {
  max-width: 800px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem;
}

.legal-document h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

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

.legal-document h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--secondary);
}

.legal-document h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.legal-document ul {
  margin: 1rem 0;
  padding-left: 2rem;
}

.legal-document li {
  margin-bottom: 0.5rem;
}

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

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

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

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

/* Cookie Banner */
.dorvalenti-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: 9999;
}

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

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

.dorvalenti-top_cookie-banner-actions {
  display: flex;
  gap: 0.5rem;
}

@media (max-width: 768px) {
  .dorvalenti-top_cookie-banner-inner {
    flex-direction: column;
    text-align: center;
  }
  
  .dorvalenti-top_cookie-banner-actions {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Cookie Modal */
.dorvalenti-top_cookie-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
}

.dorvalenti-top_cookie-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.dorvalenti-top_cookie-modal-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

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

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

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

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

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

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

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

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

.dorvalenti-top_cookie-modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (max-width: 768px) {
  .dorvalenti-top_cookie-modal-actions {
    flex-direction: column;
  }
}

/* Footer */
footer {
  background: transparent;
  border-top: 1px solid var(--border);
  color: var(--foreground);
  padding: 3rem 0 1rem;
}

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

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

.footer-left {
  display: flex;
  flex-direction: column;
}

.footer-logo {
  height: 2rem;
  width: auto;
  margin-bottom: 1rem;
}

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

.footer-address p {
  margin-bottom: 0.25rem;
}

.footer-right {
  display: flex;
  justify-content: flex-end;
}

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

.footer-column h4 {
  margin-bottom: 1rem;
  color: var(--secondary);
}

.footer-column ul {
  list-style: none;
}

.footer-column li {
  margin-bottom: 0.5rem;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  text-align: center;
  color: var(--muted-foreground);
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .footer-right {
    justify-content: center;
  }
  
  .footer-links {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Responsive Typography */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  
  .section-title {
    font-size: 2rem;
  }
  
  .page-header h1 {
    font-size: 2rem;
  }
}

/* === 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 */
#dorvalenti-top_cookie-banner.hidden, #cookie-consent-banner.hidden { display: none !important; }
#dorvalenti-top_cookie-banner:not(.hidden), #cookie-consent-banner:not(.hidden) { display: block !important; }
#dorvalenti-top_cookie-modal.hidden { display: none !important; }
.hidden { display: none !important; }
