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

:root {
  --bg-primary: #FAF9F6;
  --bg-alt: #F5F0EB;
  --bg-card: #FFFFFF;
  --text-primary: #1A1915;
  --text-secondary: #6B6560;
  --text-muted: #9C9590;
  --accent: #D97706;
  --accent-light: #FEF3C7;
  --accent-hover: #B45309;
  --blue: #3B82F6;
  --blue-light: #EFF6FF;
  --green: #059669;
  --green-light: #ECFDF5;
  --red: #DC2626;
  --red-light: #FEF2F2;
  --border: #E8E2DC;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --max-w: 960px;
  --section-gap: 120px;
  --transition: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

body {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
}

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.font-bold { font-weight: 700; }
.accent-text { color: var(--accent); }

/* ===== Animations ===== */
.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity var(--transition), transform var(--transition);
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

.fade-up-delay-1 { transition-delay: 0.1s; }
.fade-up-delay-2 { transition-delay: 0.2s; }
.fade-up-delay-3 { transition-delay: 0.3s; }

@keyframes bounce-arrow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(10px); }
}

/* ===== Navigation ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(250,249,246,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  transition: all 0.3s ease;
}
.nav .container { display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-logo svg { height: 32px; width: auto; }
.nav-logo span { font-weight: 700; font-size: 18px; color: var(--text-primary); letter-spacing: -0.02em; }
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  text-decoration: none; color: var(--text-secondary); font-size: 14px; font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }

/* ===== Section Base ===== */
section { padding: var(--section-gap) 0; }
.section-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--accent); margin-bottom: 16px;
}
.section-label::before {
  content: ''; width: 24px; height: 2px; background: var(--accent); border-radius: 1px;
}
.section-title {
  font-size: 36px; font-weight: 800; line-height: 1.2;
  letter-spacing: -0.03em; margin-bottom: 16px;
}
.section-desc {
  font-size: 17px; color: var(--text-secondary); max-width: 640px; line-height: 1.8;
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  text-align: center; padding-top: 80px; position: relative;
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-alt) 100%);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-light); color: var(--accent);
  padding: 6px 16px; border-radius: 100px; font-size: 13px; font-weight: 600;
  margin-bottom: 32px;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 52px); font-weight: 800;
  line-height: 1.15; letter-spacing: -0.03em; margin-bottom: 16px;
}
.hero h1 .accent { color: var(--accent); }
.hero-sub {
  font-size: 18px; color: var(--text-secondary); margin-bottom: 56px; max-width: 560px; margin-inline: auto;
}
.hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  max-width: 720px; margin: 0 auto;
}
.hero-stat {
  background: var(--bg-card); border-radius: var(--radius-md);
  padding: 28px 20px; box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hero-stat:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.hero-stat .num {
  font-size: 36px; font-weight: 800; color: var(--accent);
  letter-spacing: -0.03em; line-height: 1; display: inline-flex; align-items: baseline; justify-content: center;
}
.hero-stat .unit { font-size: 18px; font-weight: 600; margin-left: 2px;}
.hero-stat .label { font-size: 14px; color: var(--text-secondary); margin-top: 6px; }
.scroll-hint {
  position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
  animation: bounce-arrow 2s infinite;
  color: var(--text-muted); font-size: 13px; text-align: center;
}
.scroll-hint svg { display: block; margin: 6px auto 0; }

/* ===== Cards Grid ===== */
.cards-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  background: var(--bg-card); border-radius: var(--radius-md);
  padding: 36px; box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 20px;
}
.card-icon.blue { background: var(--blue-light); color: var(--blue); }
.card-icon.green { background: var(--green-light); color: var(--green); }
.card-icon.amber { background: var(--accent-light); color: var(--accent); }
.card h3 { font-size: 20px; font-weight: 700; margin-bottom: 10px; letter-spacing: -0.02em; }
.card p { font-size: 15px; color: var(--text-secondary); line-height: 1.7; }

/* ===== Revenue Cards ===== */
.revenue-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 40px; box-shadow: var(--shadow-md); border: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.revenue-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
}
.revenue-card.payment::before { background: linear-gradient(90deg, var(--blue), #818CF8); }
.revenue-card.insurance::before { background: linear-gradient(90deg, var(--green), #34D399); }
.revenue-card .tag {
  display: inline-flex; padding: 4px 12px; border-radius: 100px;
  font-size: 12px; font-weight: 600; margin-bottom: 16px;
}
.revenue-card.payment .tag { background: var(--blue-light); color: var(--blue); }
.revenue-card.insurance .tag { background: var(--green-light); color: var(--green); }
.revenue-card h3 { font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.formula-box {
  background: var(--bg-alt); border-radius: var(--radius-sm);
  padding: 16px 20px; font-size: 14px; font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--text-secondary); margin-top: 16px; border: 1px solid var(--border);
  line-height: 1.8;
}
.formula-box .highlight { color: var(--accent); font-weight: 600; }

/* ===== Rate Table ===== */
.rate-table-wrapper {
  background: var(--bg-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); border: 1px solid var(--border); overflow: hidden;
}
.rate-table { width: 100%; border-collapse: collapse; }
.rate-table thead { background: var(--bg-alt); }
.rate-table th {
  padding: 16px 24px; text-align: left; font-size: 13px;
  font-weight: 600; color: var(--text-secondary); text-transform: uppercase;
  letter-spacing: 0.05em;
}
.rate-table td {
  padding: 20px 24px; border-top: 1px solid var(--border);
  font-size: 15px; vertical-align: middle;
}
.rate-table tr:hover td { background: rgba(217,119,6,0.03); }
.rate-table .rate-num { font-weight: 700; font-size: 18px; color: var(--accent); }
.rate-table .rate-sub { font-size: 12px; color: var(--text-muted); display: block; margin-top: 2px; }

/* ===== Plan Compare ===== */
.plan-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.plan-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 36px; border: 2px solid var(--border);
  transition: all 0.3s ease; position: relative;
}
.plan-card.recommended {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-lg);
}
.plan-badge {
  position: absolute; top: -12px; right: 24px;
  background: var(--accent); color: white; font-size: 12px;
  font-weight: 700; padding: 4px 14px; border-radius: 100px;
}
.plan-card h3 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.plan-card .plan-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }
.plan-card ul { list-style: none; }
.plan-card li {
  padding: 8px 0; font-size: 15px; color: var(--text-secondary);
  display: flex; align-items: flex-start; gap: 10px;
}
.plan-card li::before { content: '✓'; color: var(--green); font-weight: 700; flex-shrink: 0; }

/* ===== Profit Showcase ===== */
.profit-section { background: var(--bg-alt); }
.profit-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-bottom: 40px; }
.profit-module {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 36px; box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.profit-module h4 { font-size: 16px; font-weight: 600; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.profit-line {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 15px;
}
.profit-line:last-child { border-bottom: none; }
.profit-line .val { font-weight: 700; color: var(--text-primary); }
.profit-total {
  background: linear-gradient(135deg, #1A1915 0%, #2D2A24 100%);
  border-radius: var(--radius-lg); padding: 48px;
  text-align: center; color: white; position: relative; overflow: hidden;
}
.profit-total::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 50%, rgba(217,119,6,0.15) 0%, transparent 60%);
}
.profit-total h3 { font-size: 20px; font-weight: 600; opacity: 0.8; margin-bottom: 32px; position: relative; }
.profit-total-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; position: relative; }
.profit-total-item .year-label { font-size: 14px; opacity: 0.6; margin-bottom: 4px; }
.profit-total-item .year-amount {
  font-size: 48px; font-weight: 800; color: var(--accent);
  letter-spacing: -0.03em; line-height: 1; display: inline-flex; align-items: baseline; justify-content: center;
}
.profit-total-item .year-note { font-size: 13px; opacity: 0.5; margin-top: 8px; }

/* ===== Calculator ===== */
.calc-section { background: var(--bg-primary); }
.calc-wrapper {
  background: var(--bg-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  overflow: hidden;
}
.calc-header {
  background: linear-gradient(135deg, #1A1915, #2D2A24);
  color: white; padding: 32px 40px;
}
.calc-header h3 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.calc-header p { font-size: 14px; opacity: 0.6; }
.export-btn {
  background: rgba(255,255,255,0.1); color: white; border: 1px solid rgba(255,255,255,0.2);
  padding: 10px 20px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 8px; transition: all 0.2s;
}
.export-btn:hover { background: rgba(255,255,255,0.2); }
.calc-body { padding: 40px; }
.calc-inputs { display: grid; gap: 24px; margin-bottom: 40px; }
.calc-field label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 8px;
}
.calc-field .input-row { display: flex; align-items: center; gap: 12px; }
.calc-field input[type="number"] {
  width: 100%; padding: 12px 16px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 16px; font-weight: 600;
  font-family: inherit; transition: border-color 0.2s; background: var(--bg-primary);
}
.calc-field input[type="number"]:focus { outline: none; border-color: var(--accent); background: white; }
.calc-field .unit-text { font-size: 14px; color: var(--text-muted); white-space: nowrap; }

.toggle-row {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; background: var(--bg-alt); border-radius: var(--radius-sm);
  margin-bottom: 40px;
}
.toggle-switch {
  position: relative; width: 48px; height: 26px; flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--border);
  border-radius: 13px; cursor: pointer; transition: 0.3s;
}
.toggle-slider::before {
  content: ''; position: absolute; width: 20px; height: 20px;
  left: 3px; bottom: 3px; background: white;
  border-radius: 50%; transition: 0.3s; box-shadow: var(--shadow-sm);
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); }
.toggle-label { font-size: 14px; font-weight: 600; }
.toggle-desc { font-size: 12px; color: var(--text-muted); }

.calc-results {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  padding-top: 32px; border-top: 1px solid var(--border);
}
.calc-result {
  text-align: center; padding: 24px 16px;
  background: var(--bg-alt); border-radius: var(--radius-md);
}
.calc-result .r-label { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.calc-result .r-value {
  font-size: 28px; font-weight: 800; color: var(--accent);
  letter-spacing: -0.02em;
}
.calc-result .r-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.calc-result.highlight-result {
  background: linear-gradient(135deg, #1A1915, #2D2A24);
  color: white;
}
.calc-result.highlight-result .r-label { color: rgba(255,255,255,0.6); }
.calc-result.highlight-result .r-sub { color: rgba(255,255,255,0.4); }

/* ===== Footer ===== */
.footer {
  background: #1A1915; color: rgba(255,255,255,0.5);
  padding: 48px 0; text-align: center; font-size: 13px;
}
.footer-logo { margin-bottom: 16px; opacity: 0.6; }
.footer a { color: rgba(255,255,255,0.5); }

/* ===== Calculator Mode & Redesign ===== */
.calc-group-title {
  font-size: 16px; font-weight: 700; color: var(--text-primary);
  margin-top: 32px; margin-bottom: 16px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border); display: flex; align-items: center;
}
.calc-group-title:first-child { margin-top: 0; }
.calc-group-title::before {
  content: ''; display: inline-block; width: 4px; height: 16px;
  background: var(--accent); border-radius: 2px; margin-right: 8px;
}

.mode-selector {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px;
}
.mode-radio { cursor: pointer; display: block; }
.mode-radio input[type="radio"] { display: none; }
.mode-card {
  padding: 16px; border: 2px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-primary); transition: all 0.2s; height: 100%;
}
.mode-card .mode-name {
  display: block; font-size: 15px; font-weight: 700; margin-bottom: 4px;
  color: var(--text-primary);
}
.mode-card .mode-desc {
  display: block; font-size: 13px; color: var(--text-muted); line-height: 1.5;
}
.mode-radio input[type="radio"]:checked + .mode-card {
  border-color: var(--accent); background: var(--accent-light);
}
.mode-radio input[type="radio"]:checked + .mode-card .mode-name {
  color: var(--accent-hover);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  :root { --section-gap: 80px; }
  .section-title { font-size: 28px; }
  .hero h1 { font-size: 28px; }
  .hero-stats { grid-template-columns: 1fr; max-width: 300px; }
  .cards-2, .plan-cards, .profit-grid, .profit-total-grid { grid-template-columns: 1fr; }
  .calc-inputs { grid-template-columns: 1fr !important; }
  .mode-selector { grid-template-columns: 1fr; }
  .primary-tier, .secondary-tier, .tertiary-tier { grid-template-columns: 1fr !important; }
  .hardware-inputs { grid-template-columns: 1fr !important; }
  .cards-3 { grid-template-columns: 1fr; }
  .calc-results { grid-template-columns: 1fr; }
  .calc-header { flex-direction: column; align-items: flex-start !important; gap: 16px; }
  .nav-links { display: none; }
  .calc-body, .calc-header { padding: 24px; }
  .profit-total { padding: 32px 24px; }
  .profit-total-item .year-amount { font-size: 36px; }
}

/* ===== Print Styles (PDF Export) ===== */
@media print {
  @page { margin: 1cm; size: A4 portrait; }
  body { background: white; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .nav, .scroll-hint, #calculator { display: none !important; }
  section { padding: 40px 0; page-break-inside: avoid; }
  .hero { min-height: auto; padding-top: 20px; page-break-after: avoid; }
  .hero-stats { margin-bottom: 40px; }
  .cards-2, .cards-3, .plan-cards { display: flex; flex-direction: row; gap: 16px; }
  .card, .revenue-card, .plan-card, .profit-module { flex: 1; padding: 20px; box-shadow: none; border: 1px solid #ddd; }
  .profit-grid { display: flex; flex-direction: row; }
  .profit-total { padding: 24px; }
  .profit-total-grid { display: flex; justify-content: space-around; }
  .hero-badge { margin-bottom: 16px; }
  .section-title { font-size: 24px; margin-bottom: 8px; }
  .section-desc { font-size: 14px; margin-bottom: 24px; }
  .footer { padding: 20px 0; background: white; color: #333; }
  .footer-logo svg text { fill: #333; }
}
