/* ==========================================================================
   I-SAF marketing site — design system
   ========================================================================== */

:root {
  /* Brand palette (from cmms_mobile/lib/config/brand_config.dart) */
  --color-primary: #00A896;    /* turquoise */
  --color-accent:  #02C39A;    /* teal/cyan */
  --color-deep:    #05668D;    /* royal/deep blue */
  --color-highlight: #028090;  /* dark teal */

  --color-ink:     #0B2B33;    /* near-black text */
  --color-muted:   #5C7A78;    /* secondary text */
  --color-bg:      #F6FBFA;    /* off-white, faint teal tint */
  --color-surface: #FFFFFF;
  --color-border:  #E1EDEB;

  --gradient-hero: linear-gradient(135deg, var(--color-deep) 0%, var(--color-primary) 55%, var(--color-accent) 100%);

  --shadow-sm: 0 2px 8px rgba(5, 40, 45, 0.06);
  --shadow-md: 0 8px 24px rgba(5, 40, 45, 0.10);
  --shadow-lg: 0 20px 48px rgba(5, 40, 45, 0.16);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --container-w: 1140px;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---- Reset / base ---------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-ink);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { padding: 0; margin: 0; list-style: none; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; }
p { margin: 0 0 1em; }

.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 88px 0; }
section.tight { padding: 56px 0; }

.eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.section-head { max-width: 680px; margin: 0 auto 48px; text-align: center; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.section-head p { color: var(--color-muted); font-size: 1.05rem; }

/* ---- Buttons ---------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--color-surface);
  color: var(--color-deep);
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { box-shadow: var(--shadow-lg); }

.btn-outline {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,.6);
}
.btn-outline:hover { background: rgba(255,255,255,.12); }

.btn-solid {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-solid:hover { background: var(--color-highlight); box-shadow: var(--shadow-md); }

/* ---- Nav ---------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 251, 250, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--color-deep); }
.nav-brand img { width: 32px; height: 32px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  font-weight: 600;
  font-size: .95rem;
}
.nav-links a { color: var(--color-ink); opacity: .8; }
.nav-links a:hover { opacity: 1; color: var(--color-primary); }

.nav-right { display: flex; align-items: center; gap: 20px; }

.lang-toggle {
  display: flex;
  border: 1.5px solid var(--color-border);
  border-radius: 999px;
  overflow: hidden;
  font-size: .8rem;
  font-weight: 700;
}
.lang-toggle button {
  border: none;
  background: transparent;
  padding: 7px 14px;
  cursor: pointer;
  color: var(--color-muted);
}
.lang-toggle button.active {
  background: var(--color-primary);
  color: #fff;
}

.nav-toggle-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle-btn span { width: 24px; height: 2.5px; background: var(--color-ink); border-radius: 2px; }

/* ---- Hero ---------------------------------------------------------- */

.hero {
  background: var(--gradient-hero);
  color: #fff;
  padding: 96px 0 120px;
  position: relative;
  overflow: hidden;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 48px;
  align-items: center;
}
.hero-logo { width: 64px; margin-bottom: 24px; filter: brightness(0) invert(1); opacity: .95; }
.hero h1 { font-size: clamp(2rem, 4vw, 3rem); }
.hero .lead { font-size: 1.15rem; opacity: .92; max-width: 520px; }
.hero-cta { display: flex; gap: 16px; margin-top: 32px; flex-wrap: wrap; }

.hero-visual { position: relative; display: flex; justify-content: center; }
.phone-frame {
  width: 240px;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 6px solid rgba(255,255,255,.25);
  transform: rotate(4deg);
  background: #000;
}
.phone-frame img { width: 100%; display: block; }

/* ---- Kelebihan / comparison table ---------------------------------- */

.compare-wrap { overflow-x: auto; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
table.compare {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  min-width: 560px;
}
table.compare th, table.compare td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: .95rem;
}
table.compare thead th {
  background: var(--color-deep);
  color: #fff;
  font-weight: 700;
}
table.compare tbody tr:last-child td { border-bottom: none; }
table.compare td.yes { color: var(--color-primary); font-weight: 700; }
table.compare td.maybe { color: var(--color-muted); }

.tagline-banner {
  margin-top: 32px;
  text-align: center;
  font-style: italic;
  color: var(--color-deep);
  font-size: 1.05rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Concept pills (Pengenalan) ------------------------------------- */

.concepts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.concept-pill {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.concept-pill .icon {
  width: 40px; height: 40px; flex: none;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-primary);
  color: #fff;
  font-weight: 800;
}
.concept-pill h4 { margin-bottom: 4px; font-size: 1rem; }
.concept-pill p { margin: 0; font-size: .88rem; color: var(--color-muted); }

/* ---- Card grids (modules / features) -------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
  opacity: 0; transform: translateY(16px);
}
.card.in-view { opacity: 1; transform: translateY(0); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card .icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-deep));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 16px;
}
.card h3 { font-size: 1.05rem; }
.card p { color: var(--color-muted); font-size: .92rem; margin-bottom: 0; }
.card ul { margin-top: 10px; }
.card ul li {
  font-size: .88rem;
  color: var(--color-muted);
  padding-left: 18px;
  position: relative;
  margin-bottom: 6px;
}
.card ul li::before {
  content: "";
  position: absolute; left: 0; top: 8px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-primary);
}

.see-all-link { text-align: center; margin-top: 36px; }
.see-all-link a { font-weight: 700; color: var(--color-deep); }
.see-all-link a::after { content: " →"; }

/* ---- Screenshot gallery ---------------------------------------------- */

.gallery-scroll {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 8px 4px 24px;
  scroll-snap-type: x mandatory;
}
.gallery-scroll::-webkit-scrollbar { height: 8px; }
.gallery-scroll::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 8px; }

.gallery-item {
  flex: none;
  width: 200px;
  scroll-snap-align: start;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
  background: #000;
  transition: transform .18s ease, box-shadow .18s ease;
}
.gallery-item:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.gallery-item img { width: 100%; }

/* ---- Our Apps ---------------------------------------------------------- */

.app-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 18px;
  align-items: center;
}
.app-card img { width: 56px; height: 56px; border-radius: 14px; }
.app-card h3 { margin-bottom: 2px; font-size: 1.05rem; }
.app-card p { margin: 0; color: var(--color-muted); font-size: .88rem; }
.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0,168,150,.12);
  color: var(--color-primary);
  margin-top: 6px;
}

/* ---- Architecture pillars --------------------------------------------- */

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.pillar {
  text-align: center;
  padding: 32px 20px;
}
.pillar .icon {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--gradient-hero);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
}
.pillar small { color: var(--color-muted); font-size: .78rem; display: block; margin-top: 8px; }

/* ---- CTA banner --------------------------------------------------------- */

.cta-banner {
  background: var(--gradient-hero);
  color: #fff;
  text-align: center;
  border-radius: var(--radius-lg);
  padding: 56px 32px;
  margin: 0 24px;
}
.cta-banner h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
.cta-banner .hero-cta { justify-content: center; }

/* ---- Footer --------------------------------------------------------- */

footer {
  padding: 56px 0 32px;
  color: var(--color-muted);
  font-size: .9rem;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 24px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--color-deep); }
.footer-brand img { width: 28px; }
.footer-links { display: flex; gap: 24px; }
.footer-links a:hover { color: var(--color-primary); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---- Lightbox ------------------------------------------------------- */

.lightbox {
  position: fixed; inset: 0;
  background: rgba(5, 20, 25, .88);
  display: none;
  align-items: center; justify-content: center;
  z-index: 1000;
  padding: 40px;
}
.lightbox.open { display: flex; }
.lightbox img { max-height: 88vh; border-radius: 12px; box-shadow: var(--shadow-lg); }
.lightbox-close {
  position: absolute; top: 24px; right: 32px;
  color: #fff; font-size: 2rem; cursor: pointer;
  background: none; border: none; line-height: 1;
}

/* ---- Privacy page ----------------------------------------------------- */

.policy-wrap { max-width: 820px; margin: 0 auto; padding: 64px 24px 96px; }
.policy-card { background: var(--color-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 48px; }
.policy-card h1 { font-size: 2rem; }
.policy-card .updated { color: var(--color-muted); margin-bottom: 32px; }
.policy-card h2 { font-size: 1.2rem; margin-top: 32px; color: var(--color-deep); }
.policy-card ul { padding-left: 1.25rem; list-style: disc; }
.policy-card li { margin-bottom: 8px; }

/* ---- Responsive ------------------------------------------------------- */

@media (max-width: 960px) {
  .hero .container { grid-template-columns: 1fr; text-align: center; }
  .hero-cta { justify-content: center; }
  .hero-visual { margin-top: 24px; }
  .hero-logo { margin-left: auto; margin-right: auto; }
}

@media (max-width: 600px) {
  section { padding: 56px 0; }
  .nav-links { display: none; }
  .nav-toggle-btn { display: flex; }
  .nav.open .nav-links {
    display: flex;
    position: absolute;
    top: 72px; left: 0; right: 0;
    background: var(--color-surface);
    flex-direction: column;
    padding: 20px 24px;
    gap: 18px;
    box-shadow: var(--shadow-md);
  }
  .footer-top { flex-direction: column; }
  .cta-banner { margin: 0 12px; padding: 40px 20px; }
}
