/* ========================================
   Kubernetes 비용 최적화 계산기
   Design: InfoGrab EAM — Pretendard, 4px radius, no shadow
   ======================================== */

:root {
  --color-primary: #1a1a2e;
  --color-accent: #e94560;
  --color-success: #2ecc71;
  --color-warning: #f39c12;
  --color-bg: #ffffff;
  --color-surface: #f8f9fa;
  --color-text: #1a1a1a;
  --color-text-secondary: #6c757d;
  --color-border: #e5e5e5;
  --font-main: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
  --radius: 4px;
  --max-width: 1200px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: var(--font-main);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  word-break: keep-all;
  overflow-x: hidden;
}

a { color: var(--color-accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: #c73650; }

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

/* ---- Animations ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(32px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-32px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(32px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes countUp {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-on-scroll.from-left {
  transform: translateX(-32px);
}
.animate-on-scroll.from-left.visible {
  transform: translateX(0);
}

.animate-on-scroll.from-right {
  transform: translateX(32px);
}
.animate-on-scroll.from-right.visible {
  transform: translateX(0);
}

/* ---- Navigation ---- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.97);
  border-bottom: 1px solid var(--color-border);
  transition: border-color var(--transition);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

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

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  font-size: 14px;
  color: var(--color-text-secondary);
  transition: color var(--transition);
}

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

/* Hamburger toggle (hidden on desktop) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.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 (Asymmetric) ---- */
.hero {
  padding-top: 100px;
  padding-bottom: 80px;
  position: relative;
  overflow: hidden;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-content {
  animation: fadeInLeft 0.8s ease forwards;
}

.hero-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 4px 12px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--color-primary);
  margin-bottom: 20px;
}

.hero h1 em {
  font-style: normal;
  color: var(--color-accent);
}

.hero-desc {
  font-size: 18px;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 480px;
}

.hero-image {
  position: relative;
  animation: fadeInRight 0.8s ease 0.2s both;
}

.hero-image img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.hero-image::before {
  content: '';
  position: absolute;
  top: -16px;
  right: -16px;
  width: 100%;
  height: 100%;
  border: 2px solid var(--color-accent);
  border-radius: var(--radius);
  z-index: -1;
  opacity: 0.3;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  min-height: 48px;
  text-decoration: none;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.btn-primary:hover {
  background: #c73650;
  color: #fff;
  transform: translateY(-2px);
}

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

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

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

.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-sm {
  font-size: 14px;
  padding: 10px 20px;
  min-height: 44px;
}

.btn-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---- Stats Row ---- */
.stats-row {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 64px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.stat-item {
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  animation: fadeInUp 0.6s ease both;
}

.stat-item:nth-child(2) { animation-delay: 0.1s; }
.stat-item:nth-child(3) { animation-delay: 0.2s; }
.stat-item:nth-child(4) { animation-delay: 0.3s; }

.stat-number {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
}

.stat-number .unit { font-size: 18px; color: var(--color-text-secondary); }

.stat-label {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

/* ---- Features Section (Asymmetric) ---- */
.features {
  padding: 80px 0;
  background: var(--color-surface);
}

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

.section-header {
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-header p {
  font-size: 16px;
  color: var(--color-text-secondary);
  max-width: 560px;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.feature-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: center;
  padding: 32px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}

.feature-card:hover { border-color: var(--color-accent); }

.feature-card:nth-child(2) {
  margin-top: 48px; /* asymmetric offset */
}

.feature-card-img img {
  width: 200px;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius);
}

.feature-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--color-primary);
}

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

/* ---- Wizard Section ---- */
.wizard-section {
  padding: 80px 0;
}

.wizard-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Progress Bar */
.wizard-progress {
  display: flex;
  align-items: center;
  margin-bottom: 48px;
  position: relative;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  z-index: 2;
}

.progress-step-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-secondary);
  transition: all var(--transition);
}

.progress-step.active .progress-step-dot {
  border-color: var(--color-accent);
  color: var(--color-accent);
  animation: pulse 2s infinite;
}

.progress-step.done .progress-step-dot {
  border-color: var(--color-success);
  background: var(--color-success);
  color: #fff;
}

.progress-step-label {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 8px;
  text-align: center;
}

.progress-step.active .progress-step-label { color: var(--color-accent); font-weight: 700; }

.progress-line {
  position: absolute;
  top: 18px;
  left: 12.5%;
  right: 12.5%;
  height: 2px;
  background: var(--color-border);
  z-index: 1;
}

.progress-line-fill {
  height: 100%;
  background: var(--color-success);
  transition: width 0.5s ease;
  width: 0%;
}

/* Wizard Form */
.wizard-form {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 48px;
  background: var(--color-bg);
}

.wizard-step { display: none; }
.wizard-step.active {
  display: block;
  animation: fadeInUp 0.4s ease;
}

.wizard-step h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.wizard-step .step-desc {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 32px;
}

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

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

.form-group .hint {
  font-weight: 400;
  color: var(--color-text-secondary);
  font-size: 12px;
  margin-left: 8px;
}

.form-input,
.form-select {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-family: var(--font-main);
  font-size: 16px;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  transition: border-color var(--transition);
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
  border-color: var(--color-accent);
}

.form-input.error { border-color: var(--color-accent); }

.form-error {
  font-size: 12px;
  color: var(--color-accent);
  margin-top: 4px;
  display: none;
}

.form-input.error + .form-error { display: block; }

.input-with-unit {
  position: relative;
}

.input-with-unit .unit {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--color-text-secondary);
  pointer-events: none;
}

.input-with-unit .form-input { padding-right: 48px; }

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

/* Range slider */
.range-group {
  margin-bottom: 24px;
}

.range-group label {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

.range-group .range-value {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--color-accent);
}

input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  background: var(--color-border);
  border-radius: 3px;
}

input[type="range"]:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: pointer;
  border: 2px solid #fff;
  outline: 1px solid var(--color-accent);
}

/* Wizard actions */
.wizard-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

/* ---- Results Dashboard ---- */
.results-section {
  padding: 80px 0;
  background: var(--color-surface);
  display: none;
}

.results-section.active { display: block; }

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

/* Savings highlight */
.savings-hero {
  text-align: center;
  padding: 64px 0;
  animation: fadeInUp 0.6s ease;
}

.savings-hero .label {
  font-size: 16px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.savings-hero .amount {
  font-family: var(--font-mono);
  font-size: 64px;
  font-weight: 700;
  color: var(--color-accent);
  animation: countUp 0.8s ease;
}

.savings-hero .amount .currency { font-size: 32px; vertical-align: top; }

.savings-hero .period {
  font-size: 16px;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

/* Result grid */
.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 48px;
}

.result-card {
  padding: 32px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.result-card.full-width {
  grid-column: 1 / -1;
}

.result-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 16px;
}

/* Chart container */
.chart-container {
  position: relative;
  height: 280px;
}

/* Recommendations */
.recommendation-list {
  list-style: none;
}

.recommendation-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
}

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

.rec-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.rec-content h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.rec-content p {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.rec-saving {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-success);
  margin-top: 4px;
}

/* Summary numbers */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.summary-item {
  text-align: center;
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.summary-item .val {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
}

.summary-item .desc {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

/* ---- Provider Comparison ---- */
.providers-section {
  padding: 80px 0;
  display: none;
}

.providers-section.active { display: block; }

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

.provider-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.provider-table th,
.provider-table td {
  padding: 16px 20px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid var(--color-border);
}

.provider-table th {
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.provider-table td { color: var(--color-text); }

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

.provider-table tr:hover td { background: var(--color-surface); }

.provider-table .price {
  font-family: var(--font-mono);
  font-weight: 700;
}

.provider-table .savings-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-success);
  background: rgba(46, 204, 113, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius);
}

.provider-table .current-provider {
  background: rgba(233, 69, 96, 0.05);
}

.badge-korean {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-primary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 2px 8px;
  border-radius: var(--radius);
  margin-left: 8px;
}

/* ---- CTA Section ---- */
.cta-section {
  padding: 80px 0;
  background: var(--color-primary);
  color: #fff;
  text-align: center;
}

.cta-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 24px;
}

.cta-section h2 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
}

.cta-section p {
  font-size: 16px;
  opacity: 0.8;
  margin-bottom: 32px;
}

.btn-white {
  background: #fff;
  color: var(--color-primary);
  font-weight: 700;
}

.btn-white:hover {
  background: var(--color-surface);
  color: var(--color-primary);
  transform: translateY(-2px);
}

/* ---- Footer ---- */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--color-border);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.footer a { color: var(--color-text-secondary); }
.footer a:hover { color: var(--color-text); }

/* ---- Toast Notification ---- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--color-primary);
  color: #fff;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  z-index: 200;
  transform: translateY(100px);
  opacity: 0;
  transition: all var(--transition);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ---- Loading Skeleton ---- */
.skeleton {
  background: linear-gradient(90deg, var(--color-surface) 25%, #eee 50%, var(--color-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

/* ---- Print Styles ---- */
@media print {
  .nav, .hero, .features, .wizard-section, .cta-section, .footer { display: none !important; }
  .results-section, .providers-section { display: block !important; background: #fff !important; }
  .result-card { break-inside: avoid; }
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .hero-image { order: -1; }
  .hero-image img { height: 280px; }
  .hero h1 { font-size: 36px; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-card { grid-template-columns: 1fr; }
  .feature-card:nth-child(2) { margin-top: 0; }
  .feature-card-img img { width: 100%; height: 180px; }
  .result-grid { grid-template-columns: 1fr; }
  .provider-table { font-size: 12px; }
  .provider-table th, .provider-table td { padding: 12px; }
}

@media (max-width: 640px) {
  .hero { padding-top: 80px; padding-bottom: 48px; }
  .hero h1 { font-size: 28px; }
  .hero-desc { font-size: 16px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-number { font-size: 24px; }
  .wizard-form { padding: 24px; }
  .form-row { grid-template-columns: 1fr; }
  .savings-hero .amount { font-size: 40px; }
  .summary-grid { grid-template-columns: 1fr; }
  .nav-toggle { display: flex; }
  .nav-links { display: none; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: rgba(255,255,255,0.98); border-bottom: 1px solid var(--color-border); padding: 16px 24px; gap: 0; }
  .nav-links.open { display: flex; }
  .nav-links li { border-bottom: 1px solid var(--color-border); }
  .nav-links li:last-child { border-bottom: none; }
  .nav-links a { display: block; padding: 12px 0; font-size: 16px; }
  .btn-group { flex-direction: column; }
  .btn { width: 100%; }
  .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
  .provider-table { display: block; overflow-x: auto; }
}
