/* ============ ROOT VARIABLES ============ */
:root {
  --primary: #2563EB;
  --dark-blue: #1E3A8A;
  --bg-light: #F8FAFC;
  --white: #FFFFFF;
  --text-dark: #1E293B;
  --success: #16A34A;
  --medium: #F59E0B;
  --border: #E2E8F0;
  --muted: #64748B;
  --radius: 14px;
  --shadow: 0 4px 16px rgba(30, 41, 59, 0.06);
  --shadow-hover: 0 10px 28px rgba(30, 41, 59, 0.1);
  --transition: all 0.25s ease;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
}

h1, h2, h3, h4 { margin: 0; }
p { margin: 0; }

/* ============ HEADER ============ */
.site-header {
  background: var(--dark-blue);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  transition: box-shadow 0.25s ease;
}

.site-header.scrolled {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-text h1 {
  color: var(--white);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.brand-text p {
  color: #BFDBFE;
  font-size: 12px;
  margin-top: 2px;
}

.main-nav a {
  color: #E2E8F0;
  text-decoration: none;
  margin-left: 26px;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--white);
}

/* ============ LAYOUT ============ */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 24px 60px;
}

#calculator,
#features,
#about {
  scroll-margin-top: 90px;
}

.page-intro {
  text-align: center;
  margin-bottom: 32px;
}

.hero-badge {
  display: inline-block;
  background: #DBEAFE;
  color: var(--primary);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-bottom: 14px;
}

.page-intro h2 {
  font-size: 28px;
  font-weight: 800;
  color: var(--dark-blue);
}

.page-intro p {
  color: var(--muted);
  margin-top: 8px;
  font-size: 15px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  align-items: start;
}

/* ============ CARD ============ */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-hover);
}

.card-header {
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.card-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark-blue);
}

.card-header p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

/* ============ FORM ============ */
.form-group { margin-bottom: 18px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-dark);
  background: var(--bg-light);
  transition: var(--transition);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.input-currency {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg-light);
  overflow: hidden;
  transition: var(--transition);
}

.input-currency:focus-within {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.input-currency span {
  padding: 0 12px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}

.input-currency input {
  border: none;
  background: transparent;
  padding: 12px 12px 12px 0;
}

.input-currency input:focus { box-shadow: none; }

.icon {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: inline-block;
  flex-shrink: 0;
}
.icon-rent { background-color: #DBEAFE; }
.icon-equipment { background-color: #FEF3C7; }
.icon-marketing { background-color: #FCE7F3; }
.icon-dev { background-color: #E0E7FF; }
.icon-salary { background-color: #DCFCE7; }
.icon-misc { background-color: #F1F5F9; }

/* ============ BUTTONS ============ */
.form-actions {
  display: flex;
  gap: 14px;
  margin-top: 24px;
}

.btn {
  flex: 1;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: var(--dark-blue);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--white);
  color: var(--text-dark);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  background: #F1F5F9;
  transform: translateY(-2px);
}

.btn-download {
  width: 100%;
  margin-top: 24px;
  padding: 13px 20px;
  background: var(--white);
  border: 1.5px solid var(--primary);
  color: var(--primary);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-download:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-2px);
}

/* ============ RESULTS ============ */
.empty-state {
  text-align: center;
  padding: 50px 10px;
  color: var(--muted);
}

.empty-state svg { margin-bottom: 14px; }
.empty-state p { font-size: 14px; line-height: 1.6; }

.results-content { display: none; animation: fadeIn 0.5s ease forwards; }
.results-content.show { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.total-cost-block {
  background: linear-gradient(135deg, var(--primary), var(--dark-blue));
  border-radius: var(--radius);
  padding: 24px;
  color: var(--white);
  text-align: center;
  margin-bottom: 22px;
}

.stat-label {
  display: block;
  font-size: 13px;
  opacity: 0.85;
  margin-bottom: 6px;
}

.stat-value {
  display: block;
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 700;
  background: rgba(255,255,255,0.18);
}

.badge.low { background: rgba(255,255,255,0.2); }
.badge.medium { background: var(--medium); color: #fff; }
.badge.high { background: var(--success); color: #fff; }

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

.info-box {
  background: var(--bg-light);
  border-radius: 10px;
  padding: 16px;
  border: 1px solid var(--border);
}

.info-box h4 {
  font-size: 12.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.info-box p {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--dark-blue);
}

.breakdown-section h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-dark);
}

.breakdown-list { list-style: none; margin: 0; padding: 0; }
.breakdown-item { margin-bottom: 14px; }

.breakdown-top {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  margin-bottom: 6px;
}

.breakdown-top .label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-dark);
}

.breakdown-top .value {
  font-weight: 700;
  color: var(--dark-blue);
}

.bar-track {
  width: 100%;
  height: 8px;
  background: #E2E8F0;
  border-radius: 6px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 6px;
  transition: width 0.6s ease;
  min-width: 4px;
}

/* ============ CHART ============ */
.chart-section { margin-bottom: 26px; }

.chart-section h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-dark);
}

.chart-wrapper {
  max-width: 260px;
  margin: 0 auto;
  position: relative;
}

.chart-empty {
  display: none;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 40px 16px;
  line-height: 1.6;
  background: var(--bg-light);
  border: 1px dashed var(--border);
  border-radius: 10px;
}

/* ============ SMART INSIGHTS ============ */
.insights-section {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.insights-section h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.insights-list { list-style: none; padding: 0; margin: 0; }

.insight-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-dark);
  animation: fadeIn 0.4s ease forwards;
}

.insight-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 6px;
  flex-shrink: 0;
}

.insight-item.positive .dot { background: var(--success); }
.insight-item.warning .dot { background: var(--medium); }

/* ============ SCROLL REVEAL ============ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ SECTION HEADING ============ */
.section-heading {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 40px;
}

.section-heading h2 {
  font-size: 26px;
  font-weight: 800;
  color: var(--dark-blue);
}

.section-heading p {
  color: var(--muted);
  margin-top: 8px;
  font-size: 14.5px;
}

/* ============ HOW IT WORKS ============ */
.how-it-works { margin-top: 70px; }

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 30px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
  transition: var(--transition);
}

.step-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.step-number {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 30px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(37,99,235,0.3);
}

.step-icon { font-size: 30px; margin: 14px 0 12px; }

.step-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark-blue);
  margin-bottom: 8px;
}

.step-card p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
}

/* ============ FEATURES ============ */
.features-section {
  max-width: 1200px;
  margin: 80px auto 0;
  padding: 0 24px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.feature-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 26px 20px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  text-align: left;
}

.feature-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.feature-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}

.feature-icon-blue { background: #DBEAFE; }
.feature-icon-green { background: #DCFCE7; }
.feature-icon-amber { background: #FEF3C7; }
.feature-icon-purple { background: #EDE9FE; }

.feature-card h3 {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--dark-blue);
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
}

/* ============ ABOUT ============ */
.about-section {
  max-width: 900px;
  margin: 80px auto 0;
  padding: 0 24px;
}

.about-inner { text-align: center; }

.about-text {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.8;
  text-align: center;
}

/* ============ FOOTER ============ */
.site-footer {
  background: var(--dark-blue);
  color: #E2E8F0;
  padding: 46px 24px 0;
  margin-top: 90px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  text-align: left;
}

.footer-brand h3 {
  color: var(--white);
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 10px;
}

.footer-brand p {
  max-width: 320px;
  font-size: 13.5px;
  color: #BFDBFE;
  line-height: 1.7;
}

.footer-links h4 {
  color: var(--white);
  font-size: 14px;
  margin-bottom: 12px;
}

.footer-links a {
  display: block;
  color: #CBD5E1;
  text-decoration: none;
  font-size: 13.5px;
  margin-bottom: 8px;
  transition: var(--transition);
}

.footer-links a:hover { color: var(--white); }

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  padding: 18px 0;
  font-size: 12.5px;
  color: #94A3B8;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .card { padding: 22px; }
  .steps-grid { grid-template-columns: 1fr; gap: 20px; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column; }
  .info-grid { grid-template-columns: 1fr; }
  .header-inner { flex-direction: column; gap: 10px; }
  .main-nav a { margin: 0 10px; }
  .page-intro h2 { font-size: 22px; }
  .stat-value { font-size: 26px; }
  .features-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; }
  .section-heading h2 { font-size: 22px; }
}