/* ==========================================================================
   Cemcu Finance Hub - Style System
   Theme: Glassmorphism Emerald & Slate (Bento Grid Showcase)
   Palette: #07090e (Obsidian), #10b981 (Emerald Accent), #064e3b (Deep Emerald)
   Font: Plus Jakarta Sans
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-main: #07090e;
  --bg-card: rgba(18, 24, 38, 0.6);
  --bg-card-hover: rgba(24, 32, 50, 0.75);
  --bg-card-solid: #0d121d;
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-emerald: rgba(16, 185, 129, 0.3);
  
  --primary: #10b981;
  --primary-hover: #34d399;
  --primary-glow: rgba(16, 185, 129, 0.25);
  --primary-dark: #064e3b;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-glow: 0 0 40px rgba(16, 185, 129, 0.15);
}

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

html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  position: relative;
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* Container */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Typography Utilities */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.65rem); }

.gradient-text {
  background: linear-gradient(135deg, #ffffff 0%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-muted { color: var(--text-muted); }
.text-emerald { color: var(--primary); }

/* Header & Navigation */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  padding: 0.75rem 0;
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  position: relative;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  min-height: 48px;
  min-width: 48px;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 78, 59, 0.4));
  border: 1px solid var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  min-height: 48px;
  min-width: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
}

.nav-link:hover {
  color: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  min-height: 48px;
  min-width: 48px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: #07090e;
  box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(16, 185, 129, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-glass);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(16, 185, 129, 0.05);
}

.burger-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 0;
  min-width: 48px;
  min-height: 48px;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.burger-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Hero Section */
.hero {
  padding: 9rem 0 4rem;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--border-emerald);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero-content {
  text-align: center;
  max-width: 860px;
  margin: 0 auto 3.5rem;
}

.hero-description {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin: 1.5rem 0 2rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-image-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-glow);
  margin-top: 2rem;
}

.hero-image-wrapper img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Bento Grid System */
.bento-section {
  padding: 4rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-subtitle {
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

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

.bento-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.bento-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-emerald);
  transform: translateY(-4px);
}

.bento-col-4 { grid-column: span 4; }
.bento-col-6 { grid-column: span 6; }
.bento-col-8 { grid-column: span 8; }
.bento-col-12 { grid-column: span 12; }

.card-icon {
  width: 48px;
  height: 48px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid var(--border-emerald);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

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

/* Main Longread Section */
.article-section {
  padding: 4rem 0;
}

.article-container {
  max-width: 900px;
  margin: 0 auto;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 3rem;
}

.article-content h2 {
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-glass);
}

.article-content h3 {
  margin: 1.75rem 0 0.75rem;
  color: var(--primary);
}

.article-content p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
  line-height: 1.8;
}

.article-content ul, .article-content ol {
  color: var(--text-muted);
  margin: 1rem 0 1.5rem 1.5rem;
  font-size: 1.05rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.highlight-box {
  background: rgba(16, 185, 129, 0.06);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.5rem;
  margin: 2rem 0;
}

.highlight-box p {
  color: var(--text-main);
  font-weight: 500;
  margin: 0;
}

/* Styled Table */
.table-wrapper {
  overflow-x: auto;
  margin: 2rem 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.styled-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.styled-table th {
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary);
  font-weight: 700;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-glass);
}

.styled-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-glass);
  color: var(--text-muted);
}

.styled-table tr:last-child td {
  border-bottom: none;
}

.styled-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-main);
}

/* Interactive Calculator */
.calc-section {
  padding: 4rem 0;
}

.calc-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-emerald);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-glow);
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.form-input {
  width: 100%;
  padding: 0.85rem 1.25rem;
  background: rgba(7, 9, 14, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.calc-results {
  background: rgba(7, 9, 14, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.75rem;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-glass);
}

.result-item:last-child {
  border-bottom: none;
}

.result-val {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.progress-bar-container {
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  overflow: hidden;
  margin-top: 1.5rem;
  display: flex;
}

.progress-bar-needs { background: #10b981; height: 100%; }
.progress-bar-wants { background: #3b82f6; height: 100%; }
.progress-bar-savings { background: #8b5cf6; height: 100%; }

.status-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 1rem;
}

.status-safe {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.status-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.status-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* FAQ Accordion */
.faq-section {
  padding: 4rem 0;
}

.accordion {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.accordion-item:hover {
  border-color: var(--border-emerald);
}

.accordion-header {
  width: 100%;
  padding: 1.25rem 1.5rem;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 600;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  min-height: 48px;
}

.accordion-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  color: var(--primary);
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.accordion-item.active .accordion-content {
  padding: 0 1.5rem 1.5rem;
  max-height: 500px;
}

/* Legal Pages & Forms */
.legal-page {
  padding: 9rem 0 5rem;
}

.legal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 3rem;
  max-width: 900px;
  margin: 0 auto;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  align-items: start;
}

.contact-info-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}

.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.contact-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid var(--border-emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

/* Footer */
.footer {
  background: #040609;
  border-top: 1px solid var(--border-glass);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}

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

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 1rem;
  max-width: 320px;
}

.footer-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text-main);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* Mobile Responsive & 375px Optimization */
@media (max-width: 992px) {
  .bento-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .bento-col-4, .bento-col-6, .bento-col-8, .bento-col-12 {
    grid-column: span 1;
    width: 100%;
  }

  .calc-grid, .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

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

@media (max-width: 768px) {
  .header {
    padding: 0.5rem 0;
  }

  .nav-wrapper {
    justify-content: space-between;
  }

  .burger-btn {
    display: inline-flex;
  }

  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    width: 100%;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    background: rgba(7, 9, 14, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 2rem 1.5rem;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-glass);
    transform: translateY(-150%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
    z-index: 999;
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links .nav-link,
  .nav-links .btn {
    width: 100%;
    min-height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1rem;
    font-size: 1.05rem;
    text-align: center;
  }

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

  .article-container, .legal-card, .calc-card {
    padding: 1.75rem;
  }

  .hero {
    padding: 7.5rem 0 3rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .hero {
    padding: 6rem 0 2.5rem;
  }

  .hero-badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.85rem;
    max-width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.4;
  }

  h1 {
    font-size: clamp(1.6rem, 6.5vw, 2.2rem);
  }

  h2 {
    font-size: clamp(1.4rem, 5vw, 1.8rem);
  }

  .hero-description {
    font-size: 0.95rem;
    margin: 1rem 0 1.5rem;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
  }

  .hero-actions .btn {
    width: 100%;
    min-height: 48px;
  }

  /* Bento Grid 375px Adaptation */
  .bento-section {
    padding: 3rem 0;
  }

  .section-header {
    margin-bottom: 2rem;
  }

  .bento-grid {
    gap: 1rem;
  }

  .bento-card {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-md);
  }

  .card-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    margin-bottom: 1rem;
  }

  .card-title {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    line-height: 1.35;
  }

  .card-desc {
    font-size: 0.9rem;
    line-height: 1.55;
  }

  /* Calculator 375px Adaptation */
  .calc-section {
    padding: 3rem 0;
  }

  .calc-card {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-md);
  }

  .calc-grid {
    gap: 1.25rem;
  }

  .form-group {
    margin-bottom: 1rem;
  }

  .form-label {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    font-size: 0.88rem;
  }

  .form-input {
    min-height: 48px;
    padding: 0.75rem 0.85rem;
    font-size: 0.95rem;
  }

  .calc-results {
    padding: 1.25rem 1rem;
  }

  .result-item {
    padding: 0.75rem 0;
    font-size: 0.88rem;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .result-val {
    font-size: 1.05rem;
  }

  #valDTI {
    font-size: 1.3rem;
  }

  #dtiBadge {
    display: block;
    width: 100%;
    text-align: center;
    white-space: normal;
    word-break: break-word;
    font-size: 0.8rem;
    padding: 0.6rem 0.75rem;
    line-height: 1.4;
  }

  .progress-bar-container {
    height: 12px;
    border-radius: 6px;
    margin-top: 1.25rem;
  }

  /* Longread & Table Adaptation */
  .article-section {
    padding: 3rem 0;
  }

  .article-container, .legal-card {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-md);
  }

  .article-content h2 {
    font-size: 1.35rem;
    margin: 1.75rem 0 0.75rem;
  }

  .article-content h3 {
    font-size: 1.1rem;
    margin: 1.25rem 0 0.5rem;
  }

  .article-content p, .article-content li {
    font-size: 0.95rem;
    line-height: 1.65;
  }

  .highlight-box {
    padding: 1rem;
    margin: 1.25rem 0;
  }

  .styled-table {
    min-width: 580px;
  }

  /* FAQ Accordion 375px */
  .faq-section {
    padding: 3rem 0;
  }

  .accordion-header {
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    min-height: 48px;
  }

  .accordion-content {
    font-size: 0.88rem;
  }

  .accordion-item.active .accordion-content {
    padding: 0 1rem 1rem;
  }

  /* Footer Touch Targets */
  .footer {
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
  }

  .footer-links a {
    min-height: 48px;
    min-width: 48px;
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
}
