/* =============================================
   KALFIN.ID - Styles
   ============================================= */

/* --- CSS Custom Properties --- */
:root {
  /* Colors */
  --navy: #001233;
  --primary-blue: #003d79;
  --green: #00b347;
  --green-dark: #009a3d;
  --orange: #e67e22;
  --purple: #8e44ad;
  --teal: #0097a7;
  --light-gray: #f7f9fc;
  --dark: #0a1628;
  --white: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #555;
  --border-color: #e0e0e0;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Spacing */
  --section-padding: clamp(3rem, 6vw, 5rem) clamp(1rem, 4vw, 2rem);
  --container-max: 1140px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);

  /* Transitions */
  --transition: 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

a:hover {
  color: var(--green);
}

ul {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  color: var(--text-primary);
}

/* --- Utilities --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-secondary);
  text-align: center;
  max-width: 600px;
  margin: 0 auto 3rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  min-height: 44px;
  min-width: 44px;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary {
  background: var(--green);
  color: var(--white);
}

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

.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--white);
  color: var(--white);
}

.btn-nav {
  background: var(--green);
  color: var(--white);
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  border-radius: 6px;
}

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

/* --- Navigation --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 0;
  transition: background var(--transition), box-shadow var(--transition), padding var(--transition);
}

.navbar.scrolled {
  background: rgba(0, 18, 51, 0.97);
  box-shadow: var(--shadow-md);
  padding: 0.6rem 0;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.nav-brand span {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition);
}

.nav-links a:hover {
  color: var(--white);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  min-height: 44px;
  min-width: 44px;
  align-items: center;
  justify-content: center;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Hero Section --- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--primary-blue) 100%);
  padding: clamp(7rem, 12vw, 10rem) 0 clamp(4rem, 8vw, 6rem);
  color: var(--white);
  overflow: hidden;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.12);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1.25rem;
  line-height: 1.15;
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 2rem;
  max-width: 520px;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.app-store-badge {
  height: 48px;
  width: auto;
  transition: transform var(--transition);
}

.app-store-badge:hover {
  transform: scale(1.03);
}

/* Phone mockup */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.phone-mockup {
  width: 280px;
  height: 560px;
  background: linear-gradient(180deg, #1a2a4a 0%, #0a1628 100%);
  border-radius: 40px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.phone-mockup::before {
  content: '';
  position: absolute;
  top: 12px;
  width: 100px;
  height: 28px;
  background: #000;
  border-radius: 20px;
  z-index: 2;
}

.phone-mockup-content {
  text-align: center;
  padding: 1.5rem;
}

.phone-mockup-content img {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  margin: 0 auto 1rem;
}

.phone-mockup-content .mockup-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.5rem;
}

.phone-mockup-content .mockup-subtitle {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 1.5rem;
}

.mockup-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.mockup-btn {
  padding: 0.6rem 0.4rem;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--white);
  text-align: center;
  line-height: 1.3;
}

.mockup-btn.blue { background: rgba(0, 61, 121, 0.6); }
.mockup-btn.orange { background: rgba(230, 126, 34, 0.6); }
.mockup-btn.green { background: rgba(0, 179, 71, 0.6); }
.mockup-btn.purple { background: rgba(142, 68, 173, 0.6); }

/* --- Features Section --- */
.features {
  padding: var(--section-padding);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.feature-card {
  text-align: center;
  padding: 2.5rem 2rem;
  border-radius: 12px;
  background: var(--white);
  border: 1px solid var(--border-color);
  transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 1.75rem;
}

.feature-icon.blue { background: rgba(0, 61, 121, 0.1); }
.feature-icon.green { background: rgba(0, 179, 71, 0.1); }
.feature-icon.orange { background: rgba(230, 126, 34, 0.1); }

.feature-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* --- Calculator Showcase --- */
.calculators {
  padding: var(--section-padding);
  background: var(--light-gray);
}

.calc-group {
  margin-bottom: 2.5rem;
}

.calc-group:last-child {
  margin-bottom: 0;
}

.calc-group-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  padding-left: 0.5rem;
  color: var(--text-secondary);
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.calc-card {
  background: var(--white);
  border-radius: 12px;
  padding: 1.75rem;
  border-top: 4px solid transparent;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.calc-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.calc-card.blue { border-top-color: var(--primary-blue); }
.calc-card.teal { border-top-color: var(--teal); }
.calc-card.blue-green { border-top-color: #2e7d32; }
.calc-card.orange { border-top-color: var(--orange); }
.calc-card.purple { border-top-color: var(--purple); }
.calc-card.green { border-top-color: var(--green); }

.calc-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.calc-card .calc-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.calc-card p:last-child {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* --- How It Works --- */
.how-it-works {
  padding: var(--section-padding);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  position: relative;
}

.steps::before {
  content: '';
  position: absolute;
  top: 40px;
  left: calc(16.67% + 1rem);
  right: calc(16.67% + 1rem);
  height: 2px;
  background: var(--border-color);
}

.step {
  text-align: center;
  position: relative;
}

.step-number {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-blue);
  border: 2px solid var(--border-color);
  position: relative;
  z-index: 1;
}

.step h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.step p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* --- CTA Section --- */
.cta {
  padding: var(--section-padding);
  background: linear-gradient(135deg, var(--navy) 0%, var(--primary-blue) 100%);
  text-align: center;
  color: var(--white);
}

.cta h2 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1rem;
}

.cta p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

.cta .app-store-badge {
  height: 52px;
}

.cta .cta-note {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

/* --- Footer --- */
.footer {
  background: var(--dark);
  color: rgba(255, 255, 255, 0.7);
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.footer h4 {
  color: var(--white);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-about p {
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.footer-about a {
  color: var(--green);
  font-size: 0.9rem;
}

.footer-about a:hover {
  color: var(--white);
}

.footer-links a {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  padding: 0.3rem 0;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--white);
}

.footer-legal-text {
  font-size: 0.8rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.45);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.45);
}

/* --- Legal Pages (Privacy, Terms) --- */
.page-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--primary-blue) 100%);
  padding: clamp(7rem, 10vw, 8rem) 0 clamp(2.5rem, 4vw, 3.5rem);
  color: var(--white);
  text-align: center;
}

.page-header h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.5rem;
}

.page-header p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
}

.legal-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem clamp(1rem, 4vw, 2rem);
}

.legal-content h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  color: var(--navy);
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.legal-content ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.legal-content li {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.legal-content a {
  color: var(--green);
  font-weight: 500;
}

.legal-content .highlight-box {
  background: #fff3e0;
  border-left: 4px solid var(--orange);
  padding: 1.25rem 1.5rem;
  border-radius: 0 8px 8px 0;
  margin: 1.5rem 0;
}

.legal-content .highlight-box p {
  color: var(--text-primary);
  margin-bottom: 0;
  font-weight: 500;
}

/* --- Support Page --- */
.faq-section {
  padding: var(--section-padding);
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.25rem;
  background: var(--white);
  border: none;
  cursor: pointer;
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
  min-height: 44px;
  transition: background var(--transition);
}

.faq-question:hover {
  background: var(--light-gray);
}

.faq-question .faq-icon {
  font-size: 1.25rem;
  color: var(--text-secondary);
  transition: transform var(--transition);
  flex-shrink: 0;
  margin-left: 1rem;
}

.faq-item.active .faq-question {
  background: var(--light-gray);
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.faq-answer-inner {
  padding: 0 1.25rem 1.25rem;
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.95rem;
}

.contact-section {
  padding: var(--section-padding);
  background: var(--light-gray);
}

.contact-card {
  max-width: 600px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.contact-card h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.contact-card p {
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--light-gray);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary-blue);
  margin: 1rem 0;
}

.contact-email:hover {
  color: var(--green);
}

.bug-report {
  text-align: left;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.bug-report h3 {
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}

.bug-report ul {
  list-style: disc;
  padding-left: 1.5rem;
}

.bug-report li {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

/* --- Responsive: 1024px --- */
@media (max-width: 1024px) {
  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero p {
    margin-left: auto;
    margin-right: auto;
  }

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

  .hero-visual {
    order: -1;
  }

  .phone-mockup {
    width: 240px;
    height: 480px;
  }

  .features-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }

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

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- Responsive: 768px --- */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(0, 18, 51, 0.98);
    flex-direction: column;
    padding: 1.5rem 2rem;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .phone-mockup {
    width: 200px;
    height: 400px;
  }

  .phone-mockup::before {
    width: 80px;
    height: 22px;
    top: 10px;
  }

  .features-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin: 0 auto;
  }

  .calc-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin: 0 auto;
  }

  .steps {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
    gap: 1.5rem;
  }

  .steps::before {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* --- Responsive: 480px --- */
@media (max-width: 480px) {
  .hero {
    padding: 6rem 0 3rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .phone-mockup {
    width: 180px;
    height: 360px;
    border-radius: 30px;
  }

  .mockup-buttons {
    grid-template-columns: 1fr;
    gap: 6px;
  }

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

  .feature-card {
    padding: 2rem 1.5rem;
  }

  .contact-card {
    padding: 1.5rem;
  }
}
