/* =========================
   MIGDA.IT — Premium v3
   IT Infrastructure for Healthcare
========================= */

:root {
  --bg:         #050B18;
  --bg-card:    #0B1220;
  --bg-card-2:  #0E1628;

  --primary:    #1473FF;
  --secondary:  #00D4FF;
  --accent:     #0052CC;

  --text:       #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim:   #64748B;

  --border:     rgba(30, 41, 59, 0.8);
  --border-glow:rgba(20, 115, 255, 0.3);

  --shadow:     0 0 30px rgba(20, 115, 255, 0.2);
  --shadow-lg:  0 20px 60px rgba(0, 0, 0, 0.5);

  --radius:     16px;
  --radius-lg:  24px;

  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body:    'Inter', sans-serif;
}

/* =========================
   RESET
========================= */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  scroll-padding-top: 90px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

a {
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* =========================
   BACKGROUND
========================= */

.bg-grid {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: -3;
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: -2;
}

.bg-glow--1 {
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(20, 115, 255, 0.12), transparent 70%);
  top: -300px;
  right: -200px;
}

.bg-glow--2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.06), transparent 70%);
  bottom: -200px;
  left: -100px;
}

/* =========================
   LAYOUT
========================= */

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

section {
  padding: 120px 0;
}

/* =========================
   SECTION HEADERS
========================= */

.section-header {
  margin-bottom: 60px;
}

.section-tag {
  display: inline-block;
  color: var(--secondary);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding: 6px 14px;
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 30px;
  background: rgba(0, 212, 255, 0.05);
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.section-lead {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 560px;
}

/* =========================
   NAVBAR
========================= */

header {
  position: sticky;
  top: 0;
  z-index: 999;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(5, 11, 24, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.3s, box-shadow 0.3s;
}

header.scrolled {
  background: rgba(5, 11, 24, 0.97);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
}

.logo img {
  height: 48px;
  width: auto;
}

nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.25s;
  position: relative;
}

nav a:not(.nav-cta):hover {
  color: var(--text);
}

nav a:not(.nav-cta).active-link {
  color: var(--secondary);
}

nav a:not(.nav-cta).active-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--secondary);
  border-radius: 2px;
}

.nav-cta {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white !important;
  padding: 10px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: opacity 0.2s, transform 0.2s !important;
}

.nav-cta:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Hamburger */

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================
   HERO
========================= */

.hero {
  padding-top: 0;
  padding-bottom: 0;
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  padding: 100px 0 80px;
  flex: 1;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--secondary);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 24px;
  padding: 7px 16px;
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: 30px;
  background: rgba(0, 212, 255, 0.06);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5.5vw, 4.2rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
}

.hero-gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-lead {
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1.75;
  max-width: 520px;
  margin-bottom: 40px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 44px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-badges span {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}

/* Logo Glow */

.hero-right {
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-glow {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 420px;
  height: 420px;
}

.logo-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(20, 115, 255, 0.15);
  animation: ring-pulse 4s ease-in-out infinite;
}

.logo-ring--outer {
  width: 400px;
  height: 400px;
  animation-delay: 0s;
}

.logo-ring--inner {
  width: 300px;
  height: 300px;
  border-color: rgba(0, 212, 255, 0.1);
  animation-delay: 1s;
}

@keyframes ring-pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50%       { transform: scale(1.05); opacity: 1; }
}

.logo-glow img {
  width: 280px;
  position: relative;
  z-index: 2;
  filter:
    drop-shadow(0 0 20px rgba(20, 115, 255, 0.8))
    drop-shadow(0 0 50px rgba(20, 115, 255, 0.4));
  animation: float 6s ease-in-out infinite;
  will-change: transform;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

/* Hero Banner */

.hero-banner {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050B18;
}

.hero-banner img {
  width: 100%;
  max-width: 1400px;
  height: auto;
  display: block;
  opacity: 1;
}

/* =========================
   BUTTONS
========================= */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 15px 28px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 0 25px rgba(20, 115, 255, 0.3);
  transition: transform 0.25s, box-shadow 0.25s;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 40px rgba(20, 115, 255, 0.6);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 15px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: border-color 0.25s, background 0.25s;
}

.btn-secondary:hover {
  border-color: rgba(0, 212, 255, 0.4);
  background: rgba(0, 212, 255, 0.05);
}

.btn-submit {
  align-self: flex-start;
  padding: 16px 36px;
  font-size: 1rem;
  border-radius: var(--radius);
}

/* =========================
   STATS
========================= */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(20, 115, 255, 0.05), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.stat-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow);
}

.stat-card:hover::before { opacity: 1; }

.stat-icon {
  font-size: 1.8rem;
  margin-bottom: 16px;
  display: block;
}

.stat-card h3 {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  line-height: 1;
}

.stat-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

/* =========================
   CARDS
========================= */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}

.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.card:hover {
  transform: translateY(-8px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow);
}

.card:hover::after { transform: scaleX(1); }

.card-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.card-icon img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Cards — Why MIGDA variant */

.cards--why {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 40px;
}

.card--why {
  padding: 32px 28px;
}

.card-number {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--primary);
  margin-bottom: 14px;
  opacity: 0.7;
}

/* =========================
   APPROACH BOX
========================= */

.approach-box {
  background: linear-gradient(135deg, rgba(20, 115, 255, 0.08), rgba(0, 212, 255, 0.04));
  border: 1px solid rgba(20, 115, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: 48px 52px;
  font-size: 1.1rem;
  line-height: 1.9;
  color: var(--text-muted);
  position: relative;
}

.approach-box::before {
  content: '"';
  position: absolute;
  top: 12px;
  left: 28px;
  font-size: 5rem;
  color: var(--primary);
  opacity: 0.15;
  font-family: Georgia, serif;
  line-height: 1;
}

/* =========================
   TECH GRID
========================= */

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.tech-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  cursor: default;
}

.tech-card:hover {
  transform: translateY(-5px);
  border-color: rgba(0, 212, 255, 0.35);
  box-shadow: 0 8px 30px rgba(20, 115, 255, 0.15);
}

.tech-card img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  opacity: 0.85;
  transition: opacity 0.3s;
}

.tech-card:hover img { opacity: 1; }

.tech-card span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}

/* =========================
   CONTACT
========================= */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 48px;
  align-items: start;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.3s;
}

.contact-item:hover {
  border-color: var(--border-glow);
}

.contact-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.contact-item strong {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.contact-item a,
.contact-item span {
  color: var(--text);
  font-weight: 500;
}

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

/* Form */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

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

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

input,
textarea {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.25s, box-shadow 0.25s;
  width: 100%;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(20, 115, 255, 0.12);
}

textarea {
  resize: vertical;
  min-height: 140px;
}

/* =========================
   FOOTER
========================= */

footer {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 60px 0;
}

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.footer img {
  height: 48px;
  width: auto;
  opacity: 0.85;
}

.footer p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.footer-copy {
  color: var(--text-dim) !important;
  font-size: 0.82rem !important;
}

/* =========================
   SCROLL TO TOP
========================= */

.scroll-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(20, 115, 255, 0.4);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  z-index: 998;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-top:hover {
  transform: translateY(-3px);
}

/* =========================
   REVEAL ANIMATIONS
========================= */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

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

/* Stagger siblings */
.cards .reveal:nth-child(2) { transition-delay: 0.08s; }
.cards .reveal:nth-child(3) { transition-delay: 0.16s; }
.cards .reveal:nth-child(4) { transition-delay: 0.24s; }
.cards .reveal:nth-child(5) { transition-delay: 0.32s; }
.cards .reveal:nth-child(6) { transition-delay: 0.40s; }

.stats .reveal:nth-child(2) { transition-delay: 0.08s; }
.stats .reveal:nth-child(3) { transition-delay: 0.16s; }
.stats .reveal:nth-child(4) { transition-delay: 0.24s; }

.tech-grid .reveal:nth-child(even) { transition-delay: 0.06s; }

/* =========================
   REDUCED MOTION
========================= */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* =========================
   RESPONSIVE — TABLET
========================= */

@media (max-width: 1024px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .contact-info {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .contact-item {
    flex: 1;
    min-width: 200px;
  }
}

/* =========================
   RESPONSIVE — MOBILE
========================= */

@media (max-width: 900px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 60px;
    text-align: center;
    padding: 80px 0 60px;
  }

  .hero-lead,
  .hero h1 {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-buttons {
    justify-content: center;
  }

  .hero-badges {
    justify-content: center;
  }

  .hero-right {
    order: -1;
  }

  .logo-glow {
    width: 260px;
    height: 260px;
  }

  .logo-glow img { width: 180px; }
  .logo-ring--outer { width: 260px; height: 260px; }
  .logo-ring--inner { width: 190px; height: 190px; }

  nav {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 11, 24, 0.97);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 40px;
    z-index: 1000;
  }

  nav.open {
    display: flex;
  }

  nav a {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
  }

  .nav-cta {
    padding: 14px 32px !important;
    font-size: 1.1rem !important;
  }

  .hamburger {
    display: flex;
  }

  section { padding: 80px 0; }

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

  .form-row {
    grid-template-columns: 1fr;
  }

  .contact-form {
    padding: 28px 24px;
  }

  .approach-box {
    padding: 36px 32px;
  }
}

@media (max-width: 600px) {
  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .stat-card {
    padding: 24px 16px;
  }

  .stat-card h3 {
    font-size: 2.2rem;
  }

  section { padding: 64px 0; }

  .hero-banner img { width: 100%; }

  .tech-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .scroll-top {
    bottom: 20px;
    right: 20px;
  }
}
