/* =====================================================
   MP Consulenza Informatica — Mattia Pascarella
   Style Sheet v2.0
   ===================================================== */

/* === VARIABILI === */
:root {
  --clr-dark:        #0F172A;
  --clr-navy:        #1E293B;
  --clr-blue:        #2563EB;
  --clr-blue-hover:  #1D4ED8;
  --clr-sky:         #0EA5E9;
  --clr-text:        #1E293B;
  --clr-muted:       #64748B;
  --clr-light:       #F8FAFC;
  --clr-light-blue:  #EFF6FF;
  --clr-border:      #E2E8F0;
  --clr-white:       #FFFFFF;
  --font:            'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius:          12px;
  --radius-lg:       16px;
  --shadow-sm:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:          0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  --shadow-md:       0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
  --shadow-lg:       0 20px 25px -5px rgba(0,0,0,.12), 0 8px 10px -6px rgba(0,0,0,.1);
  --shadow-xl:       0 25px 50px -12px rgba(0,0,0,.25);
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

body {
  font-family: var(--font);
  color: var(--clr-text);
  background: var(--clr-white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

a {
  text-decoration: none;
  transition: color .2s ease;
}

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

/* === NAVBAR === */
#mainNav {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding: 1rem 0;
  transition: padding .3s ease, background .3s ease, box-shadow .3s ease;
}

#mainNav.scrolled {
  padding: .6rem 0;
  background: rgba(15, 23, 42, 0.97);
  box-shadow: 0 4px 24px rgba(0,0,0,.35);
}

#mainNav .navbar-brand img {
  filter: brightness(0) invert(1);
  transition: opacity .2s;
}

#mainNav .navbar-brand:hover img { opacity: .85; }

#mainNav .nav-link {
  color: rgba(255,255,255,.75);
  font-weight: 500;
  font-size: .93rem;
  padding: .45rem .8rem !important;
  border-radius: 7px;
  transition: color .2s, background .2s;
}

#mainNav .nav-link:hover,
#mainNav .nav-link.active {
  color: #fff;
  background: rgba(255,255,255,.08);
}

#mainNav .navbar-toggler {
  border: 1px solid rgba(255,255,255,.25);
  padding: .35rem .55rem;
}

#mainNav .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255%2C255%2C255%2C0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.btn-nav {
  background: var(--clr-blue) !important;
  color: #fff !important;
  padding: .5rem 1.25rem !important;
  border-radius: 8px;
  font-weight: 600;
  font-size: .88rem;
  border: none;
  transition: background .2s, transform .2s, box-shadow .2s !important;
}

.btn-nav:hover {
  background: var(--clr-blue-hover) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37,99,235,.45);
}

/* Mobile nav */
@media (max-width: 991px) {
  #mainNav .navbar-collapse {
    background: rgba(15, 23, 42, 0.97);
    border-top: 1px solid rgba(255,255,255,.08);
    margin-top: .75rem;
    padding: 1rem;
    border-radius: 0 0 var(--radius) var(--radius);
  }
  .btn-nav { display: inline-block; margin-top: .5rem; }
}

/* === HERO === */
.hero-section {
  position: relative;
  background: var(--clr-dark);
  overflow: hidden;
  min-height: 100vh;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 65% 55% at 75% 45%, rgba(37,99,235,.22) 0%, transparent 70%),
    radial-gradient(ellipse 45% 40% at 15% 75%, rgba(14,165,233,.14) 0%, transparent 65%);
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 64px 64px;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(37,99,235,.18);
  border: 1px solid rgba(37,99,235,.38);
  color: #93C5FD;
  padding: .38rem 1rem;
  border-radius: 100px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.badge-pill i { font-size: .7rem; }

.hero-title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  color: #fff;
  line-height: 1.14;
  margin-top: 1rem;
}

.gradient-text {
  background: linear-gradient(135deg, #60A5FA 0%, #38BDF8 60%, #7DD3FC 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: rgba(255,255,255,.62);
  max-width: 580px;
  margin-top: 1.25rem;
  line-height: 1.8;
}

.hero-ctas .btn-primary {
  background: var(--clr-blue);
  border: none;
  padding: .875rem 1.85rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: .97rem;
  transition: background .2s, transform .2s, box-shadow .2s;
}

.hero-ctas .btn-primary:hover {
  background: var(--clr-blue-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(37,99,235,.45);
}

.hero-ctas .btn-outline-light {
  border: 1.5px solid rgba(255,255,255,.32);
  padding: .875rem 1.85rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: .97rem;
  color: rgba(255,255,255,.85);
  background: transparent;
  transition: background .2s, border-color .2s, color .2s;
}

.hero-ctas .btn-outline-light:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.6);
  color: #fff;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

.tech-tag {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.65);
  padding: .38rem .9rem;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 500;
  transition: background .2s, border-color .2s;
}

.tech-tag:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.18);
  color: rgba(255,255,255,.85);
}

.tech-tag i { color: var(--clr-sky); font-size: .82rem; }

.hero-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: rgba(255,255,255,.35);
  font-size: 1.15rem;
  animation: bounce 2.2s ease-in-out infinite;
  transition: color .2s;
}

.hero-scroll-hint:hover { color: rgba(255,255,255,.7); }

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%        { transform: translateX(-50%) translateY(9px); }
}

/* === STATS BAR === */
.stats-section {
  background: var(--clr-blue);
  padding: 3.5rem 0;
}

.stat-item {
  padding: .5rem;
}

.stat-icon {
  display: block;
  font-size: 1.5rem;
  color: rgba(255,255,255,.55);
  margin-bottom: .6rem;
}

.stat-number {
  display: block;
  font-size: 2.4rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat-label-top {
  display: block;
  font-size: .83rem;
  color: rgba(255,255,255,.7);
  margin-bottom: .2rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* === SHARED SECTION ELEMENTS === */
.section-label {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--clr-blue);
  margin-bottom: .6rem;
}

.section-title {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  color: var(--clr-dark);
  margin-bottom: .9rem;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--clr-muted);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.8;
}

/* === SERVICES === */
.services-section {
  padding: 6rem 0;
  background: var(--clr-white);
}

.service-card {
  background: var(--clr-white);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  height: 100%;
  transition: border-color .3s, box-shadow .3s, transform .3s;
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--clr-blue), var(--clr-sky));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s ease;
}

.service-card:hover {
  border-color: rgba(37,99,235,.2);
  box-shadow: var(--shadow-lg);
  transform: translateY(-5px);
}

.service-card:hover::before { transform: scaleX(1); }

.service-icon {
  width: 52px; height: 52px;
  background: var(--clr-light-blue);
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: var(--clr-blue);
  margin-bottom: 1.25rem;
  transition: background .3s, color .3s;
}

.service-card:hover .service-icon {
  background: var(--clr-blue);
  color: #fff;
}

.service-title {
  font-size: 1.1rem;
  color: var(--clr-dark);
  margin-bottom: .65rem;
}

.service-desc {
  font-size: .92rem;
  color: var(--clr-muted);
  margin-bottom: 1.1rem;
  line-height: 1.75;
}

.service-features {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--clr-border);
  padding-top: 1rem;
}

.service-features li {
  font-size: .85rem;
  color: var(--clr-muted);
  padding: .28rem 0 .28rem 1.2rem;
  position: relative;
}

.service-features li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--clr-blue);
  font-size: .8rem;
}

/* === WHY SECTION === */
.why-section {
  padding: 6rem 0;
  background: #EFF6FF;
}

.why-card {
  background: var(--clr-white);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  height: 100%;
  transition: box-shadow .3s, transform .3s, border-color .3s;
  border: 1.5px solid transparent;
}

.why-card:hover {
  border-color: rgba(37,99,235,.18);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.why-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--clr-blue) 0%, var(--clr-sky) 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  color: #fff;
  margin-bottom: 1.2rem;
  box-shadow: 0 4px 14px rgba(37,99,235,.3);
}

.why-card h4 {
  font-size: 1.05rem;
  color: var(--clr-dark);
  margin-bottom: .55rem;
}

.why-card p {
  font-size: .91rem;
  color: var(--clr-muted);
  margin: 0;
  line-height: 1.75;
}

/* === ABOUT === */
.about-section {
  padding: 6rem 0;
  background: var(--clr-white);
}

.about-image-wrapper {
  position: relative;
  display: block;
  max-width: 430px;
  margin: 0 auto;
}

.about-img {
  width: 100%;
  border-radius: 50%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
  box-shadow: var(--shadow-xl);
}

.about-lead {
  font-size: 1.1rem;
  color: var(--clr-dark);
  font-weight: 500;
  line-height: 1.75;
  margin-bottom: 1rem;
}

.about-section p {
  color: var(--clr-muted);
  font-size: .95rem;
  line-height: 1.8;
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55rem;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .88rem;
  color: var(--clr-text);
  font-weight: 500;
  padding: .55rem .8rem;
  background: var(--clr-light);
  border-radius: 8px;
  border: 1px solid var(--clr-border);
}

.skill-item i {
  color: var(--clr-blue);
  font-size: .75rem;
  flex-shrink: 0;
}

/* === CONTACT === */
.contact-section {
  padding: 6rem 0;
  background: var(--clr-dark);
}

.contact-section .section-label { color: #38BDF8; }
.contact-section .section-title { color: #fff; }
.contact-section .section-subtitle { color: rgba(255,255,255,.6); }

.contact-info { padding-top: .5rem; }

.contact-info h4 {
  color: #fff;
  font-size: 1.05rem;
  margin-bottom: 1.75rem;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.contact-icon {
  width: 42px; height: 42px;
  background: rgba(37,99,235,.25);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-sky);
  font-size: .95rem;
  flex-shrink: 0;
  margin-top: .1rem;
}

.contact-label {
  display: block;
  font-size: .73rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: rgba(255,255,255,.38);
  margin-bottom: .2rem;
}

.contact-item a,
.contact-item span {
  color: rgba(255,255,255,.82);
  font-weight: 500;
  font-size: .93rem;
}

.contact-item a:hover { color: var(--clr-sky); }

.contact-promise {
  background: rgba(37,99,235,.14);
  border: 1px solid rgba(37,99,235,.28);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: 2rem;
}

.contact-promise i {
  color: #FCD34D;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.contact-promise p {
  color: rgba(255,255,255,.7);
  font-size: .88rem;
  margin: 0;
  line-height: 1.5;
}

.contact-promise strong { color: rgba(255,255,255,.9); }

.contact-form {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}

.contact-form .form-label {
  color: rgba(255,255,255,.72);
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: .4rem;
}

.contact-form .form-control,
.contact-form .form-select {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 8px;
  color: #fff;
  padding: .75rem 1rem;
  font-size: .93rem;
  font-family: var(--font);
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.contact-form .form-control::placeholder { color: rgba(255,255,255,.28); }

.contact-form .form-control:focus,
.contact-form .form-select:focus {
  background: rgba(255,255,255,.09);
  border-color: rgba(37,99,235,.7);
  box-shadow: 0 0 0 3px rgba(37,99,235,.22);
  color: #fff;
  outline: none;
}

.contact-form .form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba%28255%2C255%2C255%2C0.5%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
}

.contact-form .form-select option { background: var(--clr-navy); color: #fff; }

.btn-submit {
  display: block;
  width: 100%;
  background: var(--clr-blue);
  color: #fff;
  border: none;
  padding: .9rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  font-family: var(--font);
  cursor: pointer;
  transition: background .2s, transform .2s, box-shadow .2s;
}

.btn-submit:hover:not(:disabled) {
  background: var(--clr-blue-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(37,99,235,.45);
}

.btn-submit:disabled {
  opacity: .75;
  cursor: not-allowed;
  transform: none;
}

.form-note {
  font-size: .78rem;
  color: rgba(255,255,255,.38);
  text-align: center;
  margin: 0;
}

.form-note a {
  color: rgba(255,255,255,.55);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-note a:hover { color: rgba(255,255,255,.85); }

/* === FOOTER === */
.site-footer {
  background: #080E1C;
  padding-top: 4.5rem;
  color: rgba(255,255,255,.5);
  font-size: .9rem;
}

.footer-top {
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.footer-logo { filter: brightness(0) invert(1); opacity: .85; }

.site-footer > .container > .footer-top > div > p {
  color: rgba(255,255,255,.48);
  font-size: .88rem;
  line-height: 1.75;
  margin-top: .25rem;
  margin-bottom: 1rem;
}

.footer-email {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: rgba(255,255,255,.6);
  font-size: .88rem;
  transition: color .2s;
}

.footer-email:hover { color: var(--clr-sky); }
.footer-email i { color: var(--clr-sky); font-size: .82rem; }

.footer-heading {
  color: rgba(255,255,255,.85);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li + li { margin-top: .5rem; }

.footer-links a {
  color: rgba(255,255,255,.5);
  font-size: .88rem;
  transition: color .2s;
}

.footer-links a:hover { color: rgba(255,255,255,.88); }

.footer-legal {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.footer-divider { color: rgba(255,255,255,.2); }

.footer-legal a {
  color: rgba(255,255,255,.4);
  font-size: .82rem;
  transition: color .2s;
}

.footer-legal a:hover { color: rgba(255,255,255,.78); }

.footer-bottom {
  padding: 1.5rem 0;
  border-top: 1px solid rgba(255,255,255,.05);
  margin-top: 0;
}

.footer-bottom p {
  margin: 0;
  color: rgba(255,255,255,.28);
  font-size: .8rem;
}

/* === ANIMAZIONI SCROLL === */
.fade-up {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .55s ease, transform .55s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .fade-up,
  .service-card,
  .why-card,
  .hero-scroll-hint {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* === PAGINE INTERNE (privacy, cookie) === */
.inner-page {
  padding-top: 5rem;
  min-height: 80vh;
}

.inner-page h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--clr-dark);
  margin-bottom: 1.5rem;
}

.inner-page h3 {
  font-size: 1.2rem;
  color: var(--clr-dark);
  margin-top: 2rem;
  margin-bottom: .65rem;
}

.inner-page p, .inner-page li {
  color: var(--clr-muted);
  font-size: .96rem;
  line-height: 1.8;
}

.inner-page a { color: var(--clr-blue); }
.inner-page a:hover { color: var(--clr-blue-hover); text-decoration: underline; }

/* === RESPONSIVE === */
@media (max-width: 991px) {
  .skills-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  .services-section,
  .why-section,
  .about-section,
  .contact-section { padding: 4rem 0; }
  .stats-section { padding: 2.5rem 0; }
  .stat-number { font-size: 2rem; }
  .contact-form { padding: 1.5rem; }
  .footer-legal { flex-direction: column; gap: .4rem; }
  .footer-divider { display: none; }
}

@media (max-width: 575px) {
  .hero-title { font-size: 1.9rem; }
  .hero-ctas { flex-direction: column; }
  .hero-ctas .btn { width: 100%; text-align: center; }
}
