﻿/*
  Estilos principales del sitio corporativo PROTECMIN SpA.
  Paleta sobria: verdes industriales y escala de grises.
*/
:root {
  --green-dark: #1f3d33;
  --green-mid: #2f6b4f;
  --green-light: #7cab4f;
  --gray-050: #f4f5f5;
  --gray-100: #e7eaeb;
  --gray-400: #6a7477;
  --gray-700: #2c3335;
  --white: #ffffff;
  --shadow-soft: 0 12px 28px rgba(31, 61, 51, 0.14);
  --radius: 12px;
  --header-height: 74px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--gray-700);
  background: linear-gradient(180deg, #fcfdfd 0%, #f3f6f5 100%);
  line-height: 1.6;
}

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

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.section {
  padding: 84px 0;
  scroll-margin-top: calc(var(--header-height) + 12px);
}

.section-alt {
  background: linear-gradient(180deg, #f5f8f7 0%, #e9efec 100%);
}

.section-heading {
  max-width: 740px;
  margin-bottom: 34px;
}

.section-heading h2 {
  margin: 0 0 10px;
  color: var(--green-dark);
  font-size: clamp(1.7rem, 2.2vw, 2.25rem);
}

.section-heading p {
  margin: 0;
  color: var(--gray-400);
}

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  background: linear-gradient(90deg, rgba(206, 226, 214, 0.94) 0%, rgba(222, 238, 229, 0.94) 52%, rgba(202, 223, 210, 0.94) 100%);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid rgba(47, 107, 79, 0.2);
  box-shadow: 0 8px 20px rgba(31, 61, 51, 0.12);
}

.header-content {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  gap: 10px;
}

.brand-icon {
  display: block;
  height: 40px;
  width: auto;
}

.brand-logo {
  display: block;
  height: 48px;
  width: auto;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.main-nav a {
  color: #243932;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.94rem;
  padding: 6px 0;
  position: relative;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--green-mid);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after {
  transform: scaleX(1);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(31, 61, 51, 0.22);
  border-radius: 8px;
  background: rgba(229, 240, 233, 0.88);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.menu-toggle span {
  width: 20px;
  height: 2px;
  background: var(--green-dark);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Hero */
.hero {
  position: relative;
  min-height: 95vh;
  display: grid;
  align-items: center;
  padding: calc(var(--header-height) + 36px) 0 56px;
  background: url("assets/hero-industrial.svg") center / cover no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(20, 40, 33, 0.72) 0%, rgba(36, 70, 56, 0.52) 50%, rgba(65, 110, 87, 0.35) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  color: var(--white);
}

.hero-eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-weight: 700;
  font-size: 0.8rem;
  color: #d2dfd8;
}

.hero-logo-space {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 18px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(211, 225, 217, 0.85);
  box-shadow: 0 10px 28px rgba(9, 19, 16, 0.34);
}

.hero-logo {
  width: min(320px, 72vw);
  height: auto;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4.8vw, 3.7rem);
  line-height: 1.12;
}

.hero p {
  margin: 0 0 28px;
  max-width: 64ch;
  color: #d9e5e0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 12px 24px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.btn-primary {
  background: var(--green-light);
  color: #102018;
  box-shadow: 0 8px 20px rgba(124, 171, 79, 0.36);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  transform: translateY(-2px);
  background: #8fbc63;
  box-shadow: 0 12px 26px rgba(124, 171, 79, 0.45);
}

/* Cards */
.cards-grid,
.projects-grid,
.values-grid {
  display: grid;
  gap: 18px;
}

.cards-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card,
.value-card {
  background: var(--white);
  border: 1px solid #dbe3de;
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.card:hover,
.value-card:hover {
  transform: translateY(-4px);
  border-color: #b2c7b8;
}

.card h3,
.value-card h3 {
  margin: 0 0 10px;
  color: var(--green-mid);
  font-size: 1.1rem;
}

.card p,
.value-card p {
  margin: 0;
  color: var(--gray-400);
}

/* Projects */
.projects-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-card {
  overflow: hidden;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid #d6dfdb;
  box-shadow: var(--shadow-soft);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 30px rgba(31, 61, 51, 0.2);
}

.project-card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
}

.project-body {
  padding: 18px 18px 22px;
}

.project-body h3 {
  margin: 0 0 8px;
  color: var(--green-mid);
}

.project-body p {
  margin: 0;
  color: var(--gray-400);
}

/* About */
.about-layout {
  display: grid;
  gap: 24px;
}

.values-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Contact */
.contact-layout {
  display: grid;
  gap: 24px;
}

.contact-form {
  background: var(--white);
  border: 1px solid #cfdbd4;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 26px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--green-dark);
}

.form-group input,
.form-group textarea {
  width: 100%;
  border: 1px solid #bcc7c2;
  border-radius: 9px;
  padding: 11px 12px;
  font: inherit;
  background: #f9fbfa;
  color: var(--gray-700);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--green-light);
  box-shadow: 0 0 0 3px rgba(124, 171, 79, 0.24);
}

.form-group input.error,
.form-group textarea.error {
  border-color: #b13d3d;
  box-shadow: 0 0 0 3px rgba(177, 61, 61, 0.16);
}

.field-error {
  display: block;
  min-height: 18px;
  margin-top: 4px;
  font-size: 0.84rem;
  color: #b13d3d;
}

.form-status {
  margin: 12px 0 0;
  font-weight: 600;
  min-height: 24px;
}

.form-status.success {
  color: #1f6b40;
}

.form-status.error {
  color: #9d2f2f;
}

/* Footer */
.site-footer {
  background: #15261f;
  color: #d2ddda;
  padding: 26px 0;
}

.footer-content {
  display: grid;
  gap: 4px;
}

.footer-content p {
  margin: 0;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 1024px) {
  .cards-grid,
  .values-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: inline-flex;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    right: 4%;
    width: min(320px, 92%);
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    background: rgba(225, 237, 230, 0.98);
    border: 1px solid rgba(31, 61, 51, 0.16);
    border-radius: 12px;
    padding: 14px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  }

  .main-nav a {
    width: 100%;
    padding: 10px 8px;
    border-radius: 8px;
  }

  .main-nav a:hover,
  .main-nav a:focus-visible {
    background: rgba(47, 107, 79, 0.12);
  }

  .main-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .hero {
    min-height: 86vh;
  }

  .brand-icon {
    height: 32px;
  }

  .brand-logo {
    height: 40px;
  }

  .hero-logo {
    width: min(270px, 76vw);
  }

  .section {
    padding: 70px 0;
  }

  .cards-grid,
  .projects-grid,
  .values-grid {
    grid-template-columns: 1fr;
  }

  .contact-form {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

