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

:root {
  --navy: #0F2B4C;
  --navy-mid: #1A3A5C;
  --navy-light: #2A5580;
  --blue-accent: #2E86DE;
  --blue-light: #7BB8E8;
  --blue-muted: #9BBDD8;
  --blue-dim: #7AA0BE;
  --white: #ffffff;
  --bg: #f7f8fa;
  --bg-secondary: #f0f2f5;
  --text-primary: #111827;
  --text-secondary: #6B7280;
  --border: #E5E7EB;
  --green-bg: #EAF3DE;
  --green-text: #3B6D11;
  --amber-bg: #FAEEDA;
  --teal-bg: #E1F5EE;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.6;
}

/* HEADER */
header {
  background: var(--navy);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 20px;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.site-logo span { color: var(--blue-accent); }
nav { display: flex; gap: 24px; align-items: center; }
nav a { font-size: 13px; color: var(--blue-muted); text-decoration: none; transition: color 0.15s; }
nav a:hover { color: var(--white); }

/* CALC PAGE HERO */
.calc-hero {
  background: var(--navy);
  padding: 40px 32px 36px;
  text-align: center;
}
.calc-hero .breadcrumb { font-size: 12px; color: var(--blue-dim); margin-bottom: 12px; }
.calc-hero .breadcrumb a { color: var(--blue-muted); text-decoration: none; }
.calc-hero .breadcrumb a:hover { color: var(--white); }
.calc-hero h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(22px, 3.5vw, 32px);
  font-weight: 400;
  color: var(--white);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.calc-hero p { font-size: 15px; color: var(--blue-muted); max-width: 500px; margin: 0 auto; }

/* LANG BAR */
.lang-bar {
  background: var(--white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.lang-label { font-size: 12px; color: var(--text-secondary); margin-right: 4px; }
.lang-btn {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.15s;
}
.lang-btn:hover { border-color: var(--blue-accent); color: var(--text-primary); }
.lang-btn.active { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* MAIN LAYOUT */
.calc-layout {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 24px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  align-items: start;
}

/* CALCULATOR CARD */
.calc-card-main {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.field-group { margin-bottom: 20px; }
.field-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.field-group label .hint {
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 12px;
  margin-left: 4px;
}
.input-wrap { position: relative; }
.input-prefix, .input-suffix {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-secondary);
  pointer-events: none;
}
.input-prefix { left: 12px; }
.input-suffix { right: 12px; }
.input-wrap input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--white);
  outline: none;
  transition: border-color 0.15s;
}
.input-wrap input:focus { border-color: var(--blue-accent); }
.has-prefix input { padding-left: 28px; }
.has-suffix input { padding-right: 32px; }

select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--white);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}
select:focus { border-color: var(--blue-accent); }

.calc-btn {
  width: 100%;
  padding: 14px;
  background: var(--blue-accent);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 8px;
}
.calc-btn:hover { background: #1a70c8; }

/* RESULTS */
.results-box {
  background: var(--navy);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 24px;
  display: none;
}
.results-box.visible { display: block; }
.results-title { font-size: 13px; font-weight: 500; color: var(--blue-muted); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 16px; }
.result-primary {
  font-family: 'DM Serif Display', serif;
  font-size: 42px;
  color: var(--white);
  line-height: 1;
  margin-bottom: 4px;
}
.result-label { font-size: 13px; color: var(--blue-dim); margin-bottom: 20px; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.result-item { background: var(--navy-mid); border-radius: var(--radius-md); padding: 14px; }
.result-item-label { font-size: 11px; color: var(--blue-dim); margin-bottom: 4px; }
.result-item-value { font-size: 18px; font-weight: 500; color: var(--white); }

/* SIDEBAR */
.sidebar { display: flex; flex-direction: column; gap: 20px; }

.info-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.info-card h3 { font-size: 14px; font-weight: 500; margin-bottom: 12px; color: var(--text-primary); }
.info-card p, .info-card li { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }
.info-card ul { padding-left: 16px; }
.info-card li { margin-bottom: 4px; }

.related-grid { display: flex; flex-direction: column; gap: 8px; }
.related-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: border-color 0.15s;
}
.related-link:hover { border-color: var(--blue-accent); }
.related-link .rel-icon { font-size: 18px; }
.related-link .rel-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }

/* AD SLOT */
.ad-slot {
  background: var(--bg-secondary);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
}

/* CONTENT SECTION */
.content-section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px 40px;
}
.content-section h2 { font-size: 20px; font-weight: 500; margin-bottom: 12px; margin-top: 28px; }
.content-section p { font-size: 14px; color: var(--text-secondary); line-height: 1.8; margin-bottom: 12px; }
.content-section h3 { font-size: 16px; font-weight: 500; margin: 20px 0 8px; }

/* DISCLAIMER */
.disclaimer {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  padding: 16px 24px 32px;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.7;
}

/* FOOTER */
footer {
  background: var(--navy);
  color: var(--blue-muted);
  padding: 32px;
  margin-top: 20px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-logo { font-family: 'DM Serif Display', serif; font-size: 18px; color: var(--white); }
.footer-logo span { color: var(--blue-accent); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { font-size: 13px; color: var(--blue-muted); text-decoration: none; }
.footer-links a:hover { color: var(--white); }
.footer-copy { font-size: 12px; color: #4A6A8A; width: 100%; text-align: center; margin-top: 20px; padding-top: 20px; border-top: 1px solid #1A3A5C; }

/* RESPONSIVE */
@media (max-width: 720px) {
  header { padding: 12px 16px; }
  .calc-hero { padding: 28px 16px; }
  .calc-layout { grid-template-columns: 1fr; padding: 20px 16px; }
  .result-grid { grid-template-columns: 1fr; }
  .content-section { padding: 0 16px 32px; }
  .lang-bar { padding: 10px 16px; }
}
