/* ============================================================
   CTPS — PT. Cahaya Timur Prima Sejati
   Global Stylesheet — style.css
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: #1a1a2e;
  background: #ffffff;
}

img {
  max-width: 100%;
  display: block;
}
a {
  text-decoration: none;
  color: inherit;
}

/* ── CSS Variables ───────────────────────────────────────── */
:root {
  --green-dark: #0f6e56;
  --green-mid: #1d9e75;
  --green-light: #e1f5ee;
  --blue-dark: #0c447c;
  --blue-mid: #185fa5;
  --blue-light: #e6f1fb;
  --gray-bg: #f5f6f8;
  --gray-border: #e0e4ea;
  --gray-text: #6b7280;
  --white: #ffffff;
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.07);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

/* ── Utility ─────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 4rem 0;
}
.section-alt {
  background: var(--gray-bg);
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--green-dark);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 0.6rem;
  line-height: 1.3;
}

.section-desc {
  font-size: 0.95rem;
  color: var(--gray-text);
  max-width: 560px;
  margin-bottom: 2rem;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--white);
  color: var(--blue-dark);
}
.btn-primary:hover {
  background: var(--blue-light);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-green {
  background: var(--green-dark);
  color: var(--white);
}
.btn-green:hover {
  background: var(--green-mid);
}

.btn-green-outline {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.btn-green-outline:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-primary-outline {
  display: inline-block;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-dark);
  border: 1px solid var(--blue-dark);
  transition: all 0.2s;
}
.btn-primary-outline:hover {
  background: var(--blue-dark);
  color: var(--white);
}

/* ── Cards (global) ──────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.card:hover {
  border-color: var(--blue-mid);
  box-shadow: var(--shadow-md);
}

/* ── Navbar ──────────────────────────────────────────────── */
.navbar {
  background: var(--blue-dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: all 0.3s ease;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 1.5rem;
  transition: height 0.3s ease;
}

/* Logo Kombinasi */
.logo-combo {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  flex-shrink: 0;
}

.logo-combo img {
  object-fit: contain;
  flex-shrink: 0;
}
.logo-combo .logo-security {
  width: 38px;
  height: 38px;
}
.logo-combo .logo-karyawan {
  width: 34px;
  height: 34px;
}

.logo-sep {
  width: 1px;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.logo-center {
  text-align: center;
  line-height: 1.25;
}

.logo-center .logo-name {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.2px;
}

.logo-center .logo-tagline {
  display: block;
  font-size: 8.5px;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.3px;
  margin-top: 1px;
}

/* Nav Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition:
    background 0.2s,
    color 0.2s;
  position: relative;
  background: transparent;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.nav-links .btn-nav-cta {
  background: var(--green-dark);
  color: var(--white);
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  margin-left: 6px;
  transition: background 0.2s;
}
.nav-links .btn-nav-cta:hover {
  background: var(--green-mid);
}

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all 0.3s;
}

/* Navbar compact saat scroll */
.navbar.compact {
  padding: 0;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.25);
}
.navbar.compact .navbar-inner {
  height: 52px;
}
.navbar.compact .logo-combo {
  padding: 6px 10px;
}
.navbar.compact .logo-combo .logo-security {
  width: 30px;
  height: 30px;
}
.navbar.compact .logo-combo .logo-karyawan {
  width: 26px;
  height: 26px;
}
.navbar.compact .logo-center .logo-tagline {
  display: none;
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  background: var(--blue-dark);
  color: rgba(255, 255, 255, 0.65);
  padding: 3rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.875rem;
}
.footer-logo img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  opacity: 0.85;
}
.footer-brand-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 2px;
}
.footer-brand-tag {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 0.75rem;
}
.footer-brand-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.7;
}

.footer-col-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.footer-col-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-col-links a {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  transition: color 0.2s;
}
.footer-col-links a:hover {
  color: var(--white);
}

.footer-contact {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.6;
}
.footer-contact svg {
  width: 14px;
  height: 14px;
  stroke: rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
  margin-top: 2px;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
}
.footer-copy {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}
.footer-nib {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--blue-dark);
    flex-direction: column;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    gap: 4px;
    align-items: stretch;
  }
  .nav-links.open {
    display: flex;
  }

  .nav-links a,
  .nav-links .btn-nav-cta {
    display: block;
    padding: 10px 12px;
    margin-left: 0;
  }

  .logo-center .logo-name {
    font-size: 11px;
  }
  .logo-center .logo-tagline {
    display: none;
  }

  .section-title {
    font-size: 1.4rem;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }
}

/* ── Scroll Progress Bar ─────────────────────────────────── */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(to right, var(--green-dark), var(--green-mid));
  z-index: 9999;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

/* ── Back to Top Button ──────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--blue-dark);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    background 0.2s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

#back-to-top:hover {
  background: var(--green-dark);
}

#back-to-top svg {
  width: 18px;
  height: 18px;
  stroke: var(--white);
}

/* ── Preloader ───────────────────────────────────────────── */
#preloader {
  position: fixed;
  inset: 0;
  background: var(--blue-dark);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}

#preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

.preloader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  animation: preloader-fade-in 0.5s ease forwards;
}

@keyframes preloader-fade-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.preloader-logos {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 16px 28px;
}

.preloader-logos img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.preloader-sep {
  width: 1px;
  height: 44px;
  background: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.preloader-text {
  text-align: center;
  line-height: 1.3;
  display: flex;
  flex-direction: column;
}

.preloader-pt {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.5px;
}

.preloader-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.3px;
}

.preloader-tag {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
  letter-spacing: 0.3px;
}

/* Loading bar di bawah logo */
.preloader-bar {
  width: 200px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.preloader-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, var(--green-dark), var(--green-mid));
  border-radius: 4px;
  animation: preloader-progress 1.5s ease forwards;
}

@keyframes preloader-progress {
  0% {
    width: 0%;
  }
  60% {
    width: 80%;
  }
  100% {
    width: 100%;
  }
}
