/* ===== Premium Design System ===== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ===== CSS Variables (Luxury Upgrade) ===== */
:root {
  --primary: #0f2b5b;
  --primary-light: #1e4d8c;
  --primary-lighter: #2b6cb0;
  --accent: #eab308;
  --accent-hover: #ca8a04;
  --accent-soft: rgba(234, 179, 8, 0.12);
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-section: #f1f5f9;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);
  --shadow-xl: 0 24px 60px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 40px rgba(234, 179, 8, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

/* ===== Background Pattern (Upgraded) ===== */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(ellipse at 15% 30%, rgba(30, 77, 140, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 85% 70%, rgba(234, 179, 8, 0.035) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 90%, rgba(43, 108, 176, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Subtle dot pattern overlay */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-image: radial-gradient(circle, rgba(0,0,0,0.015) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

/* ===== Header ===== */
header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: box-shadow 0.3s ease;
}

header.scrolled {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
}

.logo span {
  color: var(--accent);
}

nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

nav a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  position: relative;
}

nav a:hover {
  color: var(--primary);
  background: rgba(49, 130, 206, 0.06);
}

nav a.active {
  color: var(--primary);
  background: rgba(49, 130, 206, 0.08);
  font-weight: 600;
}

/* ===== Hero Section (Luxury Upgrade) ===== */
.hero {
  background: linear-gradient(165deg, #0f2b5b 0%, #1e4d8c 35%, #2b6cb0 70%, #1a5276 100%);
  color: #fff;
  padding: 120px 40px 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Mesh gradient overlay */
.hero::before {
  content: '';
  position: absolute;
  top: -60%;
  right: -25%;
  width: 800px;
  height: 800px;
  background: 
    radial-gradient(circle at 30% 40%, rgba(234, 179, 8, 0.12) 0%, transparent 60%),
    radial-gradient(circle at 70% 60%, rgba(43, 108, 176, 0.2) 0%, transparent 60%);
  border-radius: 50%;
  animation: hero-float 12s ease-in-out infinite alternate;
}

@keyframes hero-float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-40px, 30px) scale(1.05); }
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -15%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  animation: hero-float 15s ease-in-out infinite alternate-reverse;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 32px;
  color: rgba(255, 255, 255, 0.95);
}

.hero h1 {
  font-size: 60px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -2px;
  margin-bottom: 24px;
  text-shadow: 0 2px 30px rgba(0,0,0,0.15);
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--accent) 0%, #fbbf24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.7;
  opacity: 0.85;
  max-width: 540px;
  margin: 0 auto 40px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 36px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.hero-btn.primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
}

.hero-btn.primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.45);
}

.hero-btn.secondary {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.hero-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* ===== Section Title ===== */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(49, 130, 206, 0.08);
  color: var(--primary-light);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.section-title {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text);
  margin-bottom: 12px;
}

.section-desc {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ===== Calculator Grid ===== */
.calc-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 40px;
}

.calc-grid-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.calc-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: block;
  position: relative;
  overflow: hidden;
}

.calc-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-lighter), var(--accent));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.calc-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.calc-card:hover::before {
  opacity: 1;
}

.calc-card-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, rgba(49, 130, 206, 0.08) 0%, rgba(49, 130, 206, 0.04) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 20px;
}

.calc-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.calc-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
}

.calc-card-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-light);
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.3s ease;
}

.calc-card:hover .calc-card-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ===== Calculator Page ===== */
.calc-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 60px 40px 80px;
  position: relative;
  z-index: 1;
}

.calc-page h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text);
  margin-bottom: 8px;
}

.calc-page .subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.6;
}

/* Breadcrumb */
.breadcrumb {
  max-width: 800px;
  margin: 24px auto 0;
  padding: 0 40px;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  margin: 0 8px;
  color: var(--text-muted);
}

/* Form */
.calc-form {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 40px;
  border: 1px solid var(--border);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 14px 18px;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all 0.2s ease;
  background: #fff;
  color: var(--text);
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary-lighter);
  box-shadow: 0 0 0 4px rgba(49, 130, 206, 0.1);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.calc-btn {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(26, 54, 93, 0.25);
  letter-spacing: 0.2px;
}

.calc-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26, 54, 93, 0.35);
}

.calc-btn:active {
  transform: translateY(0);
}

/* Result */
.result-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 40px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: none;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.result-box.show {
  display: block;
}

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

.result-box h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
  letter-spacing: -0.5px;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid #f1f5f9;
}

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

.result-label {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.result-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.result-highlight {
  background: linear-gradient(135deg, rgba(49, 130, 206, 0.06) 0%, rgba(49, 130, 206, 0.02) 100%);
  border: 1px solid rgba(49, 130, 206, 0.12);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-top: 24px;
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

/* ===== Info Section ===== */
.info-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 40px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.info-section h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.info-section p,
.info-section li {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 12px;
}

.info-section ul {
  padding-left: 24px;
  margin-top: 16px;
}

.info-section li::marker {
  color: var(--primary-lighter);
}

/* ===== FAQ Section ===== */
.faq-section {
  max-width: 900px;
  margin: 48px auto 0;
  padding: 40px 0;
}

.faq-section h2 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 32px;
  letter-spacing: -1px;
  text-align: center;
}

.faq-item {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.faq-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--primary-lighter);
}

.faq-item h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  line-height: 1.5;
}

.faq-item p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 0;
}

/* ===== Features Section ===== */
.features-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 40px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.feature-item {
  text-align: center;
  padding: 32px 24px;
}

.feature-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, rgba(49, 130, 206, 0.08) 0%, rgba(245, 158, 11, 0.08) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 20px;
}

.feature-item h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.feature-item p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ===== Footer ===== */
footer {
  background: var(--primary);
  color: rgba(255, 255, 255, 0.7);
  padding: 60px 40px 40px;
  font-size: 14px;
  margin-top: 100px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}

.footer-brand {
  font-size: 20px;
  font-weight: 800;
  color: white;
  margin-bottom: 16px;
}

.footer-brand span {
  color: var(--accent);
}

.footer-desc {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 24px;
}

.footer-col h4 {
  font-size: 14px;
  font-weight: 600;
  color: white;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-col a {
  display: block;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 12px;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: white;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .calc-grid-inner {
    grid-template-columns: repeat(2, 1fr);
  }
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-inner {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 16px; }
  .hero-actions { flex-direction: column; align-items: center; }
  .form-row { grid-template-columns: 1fr; }
  .calc-grid-inner { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .calc-grid, .features-section, .calc-page { padding-left: 20px; padding-right: 20px; }
  .header-inner { padding: 0 20px; }
  nav { display: none; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .calc-form, .result-box, .info-section { padding: 24px; }
}

/* ===== Dynamic Elements (Premium & Clean) ===== */

/* Fade-in on scroll */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered fade-in for cards */
.calc-card.fade-in:nth-child(1) { transition-delay: 0s; }
.calc-card.fade-in:nth-child(2) { transition-delay: 0.1s; }
.calc-card.fade-in:nth-child(3) { transition-delay: 0.2s; }
.calc-card.fade-in:nth-child(4) { transition-delay: 0.3s; }
.calc-card.fade-in:nth-child(5) { transition-delay: 0.4s; }
.calc-card.fade-in:nth-child(6) { transition-delay: 0.5s; }

/* Ripple effect on buttons */
.ripple {
  position: relative;
  overflow: hidden;
}
.ripple span.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: ripple-anim 0.6s ease-out;
  pointer-events: none;
}
@keyframes ripple-anim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Floating icon animation (subtle) */
@keyframes float-subtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.calc-card-icon {
  animation: float-subtle 4s ease-in-out infinite;
}
.calc-card:nth-child(2) .calc-card-icon { animation-delay: 0.5s; }
.calc-card:nth-child(3) .calc-card-icon { animation-delay: 1s; }
.calc-card:nth-child(4) .calc-card-icon { animation-delay: 1.5s; }
.calc-card:nth-child(5) .calc-card-icon { animation-delay: 2s; }
.calc-card:nth-child(6) .calc-card-icon { animation-delay: 2.5s; }

/* Number rolling animation */
@keyframes number-roll {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.result-value.rolling {
  animation: number-roll 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Auto-trigger number roll when result box shows */
.result-box.show .result-value {
  animation: number-roll 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.result-box.show .result-item:nth-child(1) .result-value { animation-delay: 0.05s; }
.result-box.show .result-item:nth-child(2) .result-value { animation-delay: 0.1s; }
.result-box.show .result-item:nth-child(3) .result-value { animation-delay: 0.15s; }
.result-box.show .result-item:nth-child(4) .result-value { animation-delay: 0.2s; }
.result-box.show .result-item:nth-child(5) .result-value { animation-delay: 0.25s; }

/* Hero background shimmer (very subtle) */
.hero::before {
  animation: shimmer 8s ease-in-out infinite alternate;
}
@keyframes shimmer {
  0% { opacity: 0.8; }
  100% { opacity: 1; }
}

/* Smooth page load */
body {
  animation: page-load 0.5s ease-out;
}
@keyframes page-load {
  from { opacity: 0; }
  to { opacity: 1; }
}
