/* ==========================================
   FRANCO PROGETTI - CUSTOM STYLES
   Modern Technical Architecture Website
   ========================================== */

/* ==========================================
   GLOBAL STYLES & ANIMATIONS
   ========================================== */

:root {
  --primary-color: #2563eb;
  --primary-dark: #1e40af;
  --primary-light: #3b82f6;
  --secondary-color: #60a5fa;
  --accent-color: #93c5fd;
  --text-dark: #1f2937;
  --text-light: #6b7280;
  --bg-light: #f9fafb;
  --white: #ffffff;
}

* {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

/* Custom Selection */
::selection {
  background-color: var(--primary-color);
  color: white;
}

::-moz-selection {
  background-color: var(--primary-color);
  color: white;
}

/* ==========================================
   NAVIGATION ENHANCEMENTS
   ========================================== */

#navbar {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#navbar.scrolled {
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* ==========================================
   HERO SECTION EFFECTS
   ========================================== */

#home {
  position: relative;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 50%, #eff6ff 100%);
}

#hero-svg {
  opacity: 0.1;
}

.hero-content {
  animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animated gradient text effect */
.gradient-text {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #60a5fa 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* ==========================================
   SERVICE CARDS ANIMATIONS
   ========================================== */

.service-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  z-index: 10;
  background: white;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(37, 99, 235, 0.1),
    transparent
  );
  transition: left 0.5s ease;
}

.service-card:hover::before {
  left: 100%;
}

.service-card:hover {
  transform: translateY(-8px);
}

.service-card:hover i {
  transform: scale(1.1) rotate(5deg);
  transition: transform 0.3s ease;
}

/* ==========================================
   TECHNICAL LINE DRAWING EFFECT
   ========================================== */

.technical-line {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawLine 2s ease-out forwards;
}

@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

/* ==========================================
   COUNTER ANIMATION
   ========================================== */

.counter {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

/* ==========================================
   FORM ENHANCEMENTS
   ========================================== */

input:focus,
textarea:focus,
select:focus {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input,
textarea,
select {
  transition: all 0.2s ease;
}

/* Custom checkbox/radio styles */
input[type='checkbox'],
input[type='radio'] {
  accent-color: var(--primary-color);
}

/* ==========================================
   BUTTON EFFECTS
   ========================================== */

button,
.btn {
  position: relative;
  overflow: hidden;
}

button::before,
.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition:
    width 0.6s,
    height 0.6s;
}

button:hover::before,
.btn:hover::before {
  width: 300px;
  height: 300px;
}

/* ==========================================
   SCROLL ANIMATIONS
   ========================================== */

[data-aos] {
  opacity: 0;
  transition-property: opacity, transform;
}

[data-aos].aos-animate {
  opacity: 1;
}

/* ==========================================
   LOADING ANIMATION
   ========================================== */

.loading-spinner {
  border: 3px solid rgba(37, 99, 235, 0.1);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================
   SCROLL TO TOP BUTTON
   ========================================== */

#scroll-top {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#scroll-top.show {
  opacity: 1;
  pointer-events: all;
}

/* ==========================================
   GEOMETRIC PATTERNS
   ========================================== */

.pattern-dots {
  background-image: radial-gradient(circle, #2563eb 1px, transparent 1px);
  background-size: 20px 20px;
}

.pattern-grid {
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
}

/* ==========================================
   TECHNICAL BLUEPRINT EFFECT
   ========================================== */

.blueprint-bg {
  background-color: #1e3a8a;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 2px, transparent 2px),
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size:
    100px 100px,
    100px 100px,
    20px 20px,
    20px 20px;
  background-position:
    -2px -2px,
    -2px -2px,
    -1px -1px,
    -1px -1px;
}

/* ==========================================
   HOVER GLOW EFFECT
   ========================================== */

.glow-on-hover {
  position: relative;
  z-index: 0;
}

.glow-on-hover::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #2563eb, #3b82f6, #60a5fa, #93c5fd);
  background-size: 400%;
  border-radius: inherit;
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease;
  filter: blur(5px);
}

.glow-on-hover:hover::before {
  opacity: 1;
  animation: glowRotate 8s linear infinite;
}

@keyframes glowRotate {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ==========================================
   PULSE ANIMATION
   ========================================== */

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ==========================================
   RESPONSIVE UTILITIES
   ========================================== */

@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2.5rem;
  }

  .hero-content p {
    font-size: 1.125rem;
  }

  .service-card {
    margin-bottom: 1rem;
  }
}

@media (max-width: 640px) {
  .hero-content h1 {
    font-size: 2rem;
  }
}

/* ==========================================
   PRINT STYLES
   ========================================== */

@media print {
  header,
  footer,
  #scroll-top,
  .no-print {
    display: none;
  }

  body {
    font-size: 12pt;
  }

  section {
    page-break-inside: avoid;
  }
}

/* ==========================================
   ACCESSIBILITY ENHANCEMENTS
   ========================================== */

/* Focus visible for keyboard navigation */
:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

/* Reduce motion for users with preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --primary-color: #0000ff;
    --text-dark: #000000;
  }
}

/* ==========================================
   CUSTOM SCROLLBAR
   ========================================== */

::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) var(--bg-light);
}

/* ==========================================
   LOADING SCREEN (Optional)
   ========================================== */

.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition:
    opacity 0.5s,
    visibility 0.5s;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.text-shadow {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.text-shadow-strong {
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.box-shadow-hover {
  transition: box-shadow 0.3s ease;
}

.box-shadow-hover:hover {
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ==========================================
   PRIVACY CONTROLS
   ========================================== */

.privacy-modal-open {
  overflow: hidden;
}

.privacy-banner {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 120;
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.privacy-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.privacy-banner__content {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.9fr);
  gap: 24px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 28px;
  background: linear-gradient(
    140deg,
    rgba(8, 47, 73, 0.96),
    rgba(30, 64, 175, 0.96)
  );
  color: #fff;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(20px);
}

.privacy-banner__eyebrow {
  margin: 0 0 8px;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(191, 219, 254, 0.92);
}

.privacy-banner__title,
.privacy-modal__title {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  line-height: 1.15;
}

.privacy-banner__text,
.privacy-modal__intro,
.privacy-option__text,
.privacy-modal__note p {
  margin: 12px 0 0;
  color: rgba(219, 234, 254, 0.92);
  line-height: 1.6;
}

.privacy-banner__links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 16px 0 0;
}

.privacy-banner__links a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.privacy-banner__actions,
.privacy-modal__actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.privacy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.privacy-btn--primary {
  background: #ffffff;
  color: #0f172a;
}

.privacy-btn--secondary {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.privacy-btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

.privacy-fab {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 110;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.3);
}

.privacy-fab.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.privacy-modal {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 24px;
}

.privacy-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(8px);
}

.privacy-modal__panel {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  padding: 32px;
  border-radius: 32px;
  background: linear-gradient(180deg, #0f172a 0%, #172554 100%);
  color: #fff;
  box-shadow: 0 32px 70px rgba(15, 23, 42, 0.45);
}

.privacy-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.privacy-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 22px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid rgba(191, 219, 254, 0.16);
  background: rgba(255, 255, 255, 0.06);
}

.privacy-option--locked {
  background: rgba(59, 130, 246, 0.12);
}

.privacy-option__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.privacy-switch {
  position: relative;
  flex: 0 0 auto;
  width: 62px;
  height: 36px;
}

.privacy-switch input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.privacy-switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.5);
  transition: background 0.2s ease;
}

.privacy-switch span::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.privacy-switch input:checked + span {
  background: #3b82f6;
}

.privacy-switch input:checked + span::after {
  transform: translateX(26px);
}

.privacy-switch input:disabled + span {
  background: #1d4ed8;
}

.privacy-modal__note {
  margin-top: 20px;
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(191, 219, 254, 0.14);
}

@media (max-width: 900px) {
  .privacy-banner__content {
    grid-template-columns: 1fr;
  }

  .privacy-banner__actions,
  .privacy-modal__actions {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .privacy-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .privacy-fab {
    left: 12px;
    bottom: 12px;
    padding: 10px 14px;
  }

  .privacy-modal {
    padding: 12px;
  }

  .privacy-modal__panel,
  .privacy-banner__content {
    padding: 20px;
    border-radius: 24px;
  }

  .privacy-option {
    align-items: flex-start;
    flex-direction: column;
  }
}

.border-gradient {
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
}

.border-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  margin: -2px;
  border-radius: inherit;
  background: linear-gradient(45deg, #2563eb, #3b82f6);
}

/* ==========================================
   ANIMATION DELAYS (for staggered effects)
   ========================================== */

.delay-100 {
  animation-delay: 100ms;
}
.delay-200 {
  animation-delay: 200ms;
}
.delay-300 {
  animation-delay: 300ms;
}
.delay-400 {
  animation-delay: 400ms;
}
.delay-500 {
  animation-delay: 500ms;
}

/* ==========================================
   END OF STYLESHEET
   ========================================== */
