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

:root {
  --primary: #5B8DEF;
  --primary-light: #7BA3F5;
  --primary-dark: #4A7DE0;
  --primary-soft: #E8F0FE;
  --secondary: #8896AB;
  --success: #34C759;
  --warning: #FFD60A;
  --light: #F8FAFD;
  --dark: #2D3748;
  --bg-light: #F5F7FA;
  --bg-soft: #F0F4FF;
  --text-muted: #8896AB;
  --text-color: #4A5568;
  --border-light: #E8EDF2;
  --shadow: 0 4px 20px rgba(91, 141, 239, 0.08);
  --shadow-hover: 0 12px 40px rgba(91, 141, 239, 0.15);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.06);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-color);
  line-height: 1.7;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--primary); color: #fff; }

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
}
.site-header.scrolled { box-shadow: var(--shadow); }
.site-header .navbar {
  padding: 0.6rem 0;
}
.site-header .navbar-brand {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--dark) !important;
  letter-spacing: -0.5px;
}
.site-header .navbar-brand span { color: var(--primary); }
.site-header .navbar-brand small {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
  display: block;
  letter-spacing: 1px;
  margin-top: -2px;
}
.site-header .nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  margin: 0 2px;
  padding: 0.5rem 1rem !important;
  color: var(--dark) !important;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  position: relative;
}
.site-header .nav-link::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: var(--transition);
  transform: translateX(-50%);
  border-radius: 2px;
}
.site-header .nav-link:hover { color: var(--primary) !important; background: var(--primary-soft); }
.site-header .nav-link:hover::after { width: 60%; }
.site-header .nav-link.active { color: var(--primary) !important; font-weight: 600; }
.site-header .nav-link.active::after { width: 60%; }
.navbar-toggler { border: none; padding: 0.5rem; color: var(--dark); }
.navbar-toggler:focus { box-shadow: none; }

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, #F0F4FF 0%, #E8F0FE 40%, #DCE8FA 100%);
  min-height: 520px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(91,141,239,0.08) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 8s ease-in-out infinite;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(91,141,239,0.05) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 10s ease-in-out infinite reverse;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -20px) scale(1.1); }
}
.hero-content { position: relative; z-index: 1; }
.hero-badge {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.6s ease;
}
.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.2;
  margin-bottom: 1rem;
  animation: fadeInUp 0.6s ease 0.1s both;
}
.hero h1 span { color: var(--primary); }
.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 540px;
  animation: fadeInUp 0.6s ease 0.2s both;
}
.hero .btn { animation: fadeInUp 0.6s ease 0.3s both; }
.hero-image {
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.8s ease 0.3s both;
}
.hero-image-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.hero-image-card .icon-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-image-card .icon-item {
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  border-radius: var(--radius);
  color: var(--primary);
  font-size: 1.8rem;
  transition: var(--transition);
}
.hero-image-card .icon-item:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-5px);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== SECTION HEADERS ===== */
.section {
  padding: 5rem 0;
}
.section-bg-light { background: var(--bg-light); }
.section-bg-soft { background: var(--bg-soft); }
.section-tag {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 0.3rem 0.9rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
  letter-spacing: 0.5px;
}
.section-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 0.75rem;
  letter-spacing: -0.5px;
}
.section-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 3rem;
}

/* ===== CARDS ===== */
.card {
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  background: #fff;
}
.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}
.card-img-top { height: 200px; object-fit: cover; transition: var(--transition); }
.card:hover .card-img-top { transform: scale(1.05); }
.card-body { padding: 1.5rem; }
.card-title { font-weight: 700; margin-bottom: 0.75rem; color: var(--dark); font-size: 1.1rem; }
.card-text { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }
.card-footer { padding: 1rem 1.5rem; }

/* ===== SERVICE CARDS ===== */
.service-card {
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  background: #fff;
  height: 100%;
}
.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}
.service-card .card-body { padding: 2rem 1.5rem; }
.service-icon-wrap {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  border-radius: var(--radius);
  margin-bottom: 1.2rem;
  font-size: 1.5rem;
  color: var(--primary);
  transition: var(--transition);
}
.service-card:hover .service-icon-wrap {
  background: var(--primary);
  color: #fff;
  transform: scale(1.1) rotate(-5deg);
}

/* ===== WHY US ===== */
.why-us-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: 5rem 0;
  position: relative;
  overflow: hidden;
}
.why-us-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.why-us-section .section-title { color: #fff; }
.why-us-section .section-subtitle { color: rgba(255,255,255,0.8); }
.why-us-section .section-tag { background: rgba(255,255,255,0.2); color: #fff; }
.col-lg-2-4 { flex: 0 0 auto; width: 20%; }
@media (max-width: 992px) { .col-lg-2-4 { width: 33.333%; } }
@media (max-width: 768px) { .col-lg-2-4 { width: 50%; } }
@media (max-width: 576px) { .col-lg-2-4 { width: 100%; } }

.why-us-card {
  text-align: center;
  padding: 2rem 1.5rem;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  transition: var(--transition);
  height: 100%;
  border: 1px solid rgba(255,255,255,0.1);
}
.why-us-card:hover {
  background: rgba(255,255,255,0.22);
  transform: translateY(-8px);
}
.why-us-card i {
  color: #fff;
  font-size: 2rem;
  transition: var(--transition);
}
.why-us-card:hover i { transform: scale(1.2); }
.why-us-card h5 { color: #fff; font-weight: 700; margin: 1rem 0 0.5rem; }
.why-us-card p { color: rgba(255,255,255,0.85); font-size: 0.9rem; margin: 0; }

/* ===== REFERENCES ===== */
.ref-logo-card {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  border: 1px solid var(--border-light);
}
.ref-logo-card:hover {
  background: #fff;
  box-shadow: var(--shadow);
  transform: translateY(-4px);
  border-color: transparent;
}

/* ===== PROJECT CARD ===== */
.project-card { height: 100%; }
.project-card .card-img-top { height: 200px; }
.project-placeholder {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  color: var(--primary-light);
  font-size: 3rem;
}
.project-img-wrap { overflow: hidden; position: relative; }
.project-img-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(40, 167, 69, 0.9);
  color: #fff;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

/* ===== STATS ===== */
.stats-section {
  background: #fff;
  padding: 4rem 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}
.stat-item {
  text-align: center;
  padding: 1.5rem;
}
.stat-number { font-size: 2.5rem; font-weight: 800; color: var(--primary); }
.stat-label { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.3rem; }

/* ===== PAGE HERO ===== */
.page-hero {
  background: linear-gradient(135deg, #F0F4FF 0%, #E8F0FE 100%);
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
}
.page-hero h1 { color: var(--dark); font-weight: 800; }
.page-hero p { color: var(--text-muted); }

/* ===== FOOTER ===== */
.site-footer {
  background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
  color: rgba(255,255,255,0.75);
  padding: 4rem 0 1.5rem;
}
.site-footer a { color: rgba(255,255,255,0.65); transition: var(--transition); }
.site-footer a:hover { color: #fff !important; }
.footer-brand { font-size: 1.4rem; font-weight: 800; color: #fff; letter-spacing: -0.5px; }
.footer-brand span { color: var(--primary-light); }
.footer-title { color: #fff; font-weight: 600; margin-bottom: 1.2rem; font-size: 1rem; letter-spacing: 0.5px; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.6rem; }
.footer-links li a { font-size: 0.9rem; }
.footer-links li a:hover { padding-left: 4px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 1.5rem; margin-top: 2rem; }

/* ===== BUTTONS ===== */
.btn {
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.6rem;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  border: none;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(91, 141, 239, 0.35);
}
.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline-primary:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}
.btn-light {
  background: #fff;
  color: var(--primary);
}
.btn-light:hover {
  background: var(--primary-soft);
  transform: translateY(-2px);
}
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }

/* ===== FORM ===== */
.form-control {
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-light);
  transition: var(--transition);
  background: var(--bg-light);
  font-size: 0.9rem;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(91, 141, 239, 0.12);
  outline: none;
  background: #fff;
}
.form-label { font-weight: 500; color: var(--dark); font-size: 0.9rem; margin-bottom: 0.4rem; }

/* ===== BADGE ===== */
.badge { border-radius: 50px; padding: 0.3em 0.7em; font-weight: 500; font-size: 0.75rem; }

/* ===== ALERT ===== */
.alert { border-radius: var(--radius-sm); border: none; padding: 1rem 1.25rem; }
.alert-success { background: #E8FAF0; color: #1A7D42; }
.alert-danger { background: #FEF0F0; color: #B91C1C; }
.alert-warning { background: #FFFBEB; color: #92400E; }
.alert-info { background: #EFF6FF; color: #1E40AF; }

/* ===== BREADCRUMB ===== */
.breadcrumb { background: transparent; padding: 0; margin-bottom: 1rem; }
.breadcrumb-item a { color: var(--primary); }
.breadcrumb-item.active { color: var(--text-muted); }
.breadcrumb-item + .breadcrumb-item::before { content: "›"; color: var(--text-muted); }

/* ===== SCROLL TOP ===== */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 999;
  box-shadow: 0 4px 15px rgba(91,141,239,0.3);
}
.scroll-top.show { opacity: 1; visibility: visible; }
.scroll-top:hover { background: var(--primary-dark); transform: translateY(-3px); }

/* ===== CTA SECTION ===== */
.cta-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: 4rem 0;
  text-align: center;
}
.cta-section h2 { color: #fff; font-weight: 800; }
.cta-section p { color: rgba(255,255,255,0.85); }

/* ===== CONTACT PAGE ===== */
.contact-info-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  height: 100%;
}
.contact-info-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}
.contact-info-item:last-child { margin-bottom: 0; }
.contact-info-item i {
  width: 44px;
  height: 44px;
  line-height: 44px;
  text-align: center;
  background: var(--primary-soft);
  border-radius: 50%;
  color: var(--primary);
  margin-right: 1rem;
  flex-shrink: 0;
  font-size: 1rem;
}
.contact-info-item div { flex: 1; }
.contact-info-item strong { display: block; color: var(--dark); font-size: 0.85rem; margin-bottom: 0.2rem; }
.contact-info-item span { color: var(--text-muted); font-size: 0.9rem; }

/* ===== ABOUT PAGE ===== */
.about-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}
.about-stat {
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-light);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  transition: var(--transition);
}
.about-stat:hover {
  background: #fff;
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}
.about-stat i { font-size: 1.8rem; color: var(--primary); margin-bottom: 0.8rem; }
.about-stat h3 { font-size: 1.8rem; font-weight: 800; color: var(--dark); }
.about-stat p { color: var(--text-muted); font-size: 0.85rem; margin: 0; }

/* ===== FEATURE LIST ===== */
.feature-list { list-style: none; padding: 0; margin: 0; }
.feature-list li { padding: 0.5rem 0; display: flex; align-items: center; gap: 0.5rem; color: var(--text-color); }
.feature-list li i { color: var(--success); }

/* ===== AUTOMATION SECTION ===== */
.automation-category {
  margin-bottom: 3rem;
}
.automation-category:last-child { margin-bottom: 0; }

/* ===== ANIMATIONS ===== */
.fade-in { animation: fadeIn 0.6s ease; }
.fade-in-up { animation: fadeInUp 0.6s ease; }
.fade-in-down { animation: fadeInDown 0.6s ease; }
[data-aos] { transform: translateY(20px); transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
[data-aos].aos-animate { transform: translateY(0); }

@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
  .hero { min-height: auto; padding: 4rem 0; }
  .hero h1 { font-size: 2.2rem; }
  .hero-image { margin-top: 2rem; }
  .section-title { font-size: 1.6rem; }
  .page-hero { padding: 3rem 0; }
  .page-hero h1 { font-size: 1.8rem; }
  .stat-number { font-size: 2rem; }
  .cta-section { padding: 3rem 0; }
  .cta-section h2 { font-size: 1.5rem; }
}

@media (max-width: 768px) {
  .hero { min-height: auto; padding: 3rem 0; }
  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: 1rem; }
  .site-header .nav-link { padding: 0.6rem 0.8rem !important; }
  .section { padding: 2.5rem 0; }
  .section-title { font-size: 1.4rem; }
  .section-subtitle { font-size: 0.95rem; }
  .why-us-section { padding: 2.5rem 0; }
  .site-footer { padding: 2.5rem 0 1rem; }
  .about-stats { grid-template-columns: repeat(2, 1fr); }
  .stats-section { padding: 2.5rem 0; }
  .stat-number { font-size: 1.8rem; }
  .stat-item { padding: 1rem; }
  .cta-section { padding: 2.5rem 0; }
  .cta-section h2 { font-size: 1.4rem; }
  .cta-section .lead { font-size: 1rem; }
  .page-hero { padding: 2.5rem 0; }
  .page-hero h1 { font-size: 1.5rem; }
  .page-hero .lead { font-size: 0.95rem; }
  .service-detail-icon { width: 60px; height: 60px; font-size: 1.5rem; }
  .ref-logo-card { min-height: 70px; padding: 0.75rem !important; }
  .about-stat h3 { font-size: 1.5rem; }
  .post-content { overflow-x: auto; }
  .map-container iframe { width: 100%; height: 250px; }
}

@media (max-width: 576px) {
  .hero h1 { font-size: 1.5rem; }
  .hero-badge { font-size: 0.75rem; }
  .btn-lg { padding: 0.7rem 1.5rem; font-size: 0.9rem; }
  .section-title { font-size: 1.3rem; }
  .about-stats { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .stat-number { font-size: 1.5rem; }
  .page-hero h1 { font-size: 1.3rem; }
  .page-hero .lead { font-size: 0.85rem; }
  .cta-section h2 { font-size: 1.3rem; }
  .cta-section .btn { font-size: 0.85rem; }
  .why-us-card { padding: 1.5rem 1rem; }
  .why-us-card h5 { font-size: 1rem; }
  .why-us-card p { font-size: 0.85rem; }
  .contact-info-item { padding: 1rem; }
  .service-card .card-body { padding: 1.25rem; }
  .project-card .card-img-top { height: 180px; }
  .ref-logo-card { min-height: 60px; }
  .about-stat h3 { font-size: 1.3rem; }
  .about-stat p { font-size: 0.85rem; }
  .error-page h1 { font-size: 2rem; }
  .error-page i { font-size: 3rem !important; }
}

/* ===== FORM INPUT ZOOM FIX (iOS) ===== */
@media (max-width: 768px) {
  input[type="text"], input[type="email"], input[type="password"],
  input[type="tel"], input[type="url"], input[type="number"],
  textarea, select {
    font-size: 16px !important;
  }
}

/* ===== TOUCH TARGET FIX ===== */
@media (max-width: 768px) {
  .btn { min-height: 44px; }
  .nav-link { min-height: 44px; display: flex; align-items: center; }
  .scroll-top { width: 44px; height: 44px; bottom: 16px; right: 16px; }
}

/* ===== PAGE SPECIFIC ===== */
.posts-page .card-img-top { height: 180px; }
.map-container { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border-light); }
.post-content { overflow-x: auto; word-wrap: break-word; }
.post-content img { max-width: 100%; height: auto; }
.post-content table { width: 100%; overflow-x: auto; display: block; }
.post-content pre { overflow-x: auto; }

/* ===== SERVICE DETAIL ===== */
.service-detail-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  border-radius: var(--radius);
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

/* ===== LOADING ===== */
.spinner { width: 40px; height: 40px; border: 3px solid var(--border-light); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }