/* =========================================
   GainCalculator — main.css  v2
   New brand: Electric Orange on Deep Navy
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400&display=swap');

/* ── Brand Tokens ────────────────────────── */
:root {
  --brand:        #f97316;   /* orange-500  */
  --brand-dark:   #ea580c;   /* orange-600  */
  --brand-light:  #fff7ed;   /* orange-50   */
  --brand-glow:   rgba(249,115,22,.18);

  --surface:      #080e1a;   /* deep navy   */
  --surface-2:    #0f1929;   /* navy-800    */
  --surface-3:    #1a2640;   /* navy-700    */
  --surface-4:    #243352;   /* navy-600    */

  --text:         #f0f4f8;
  --text-muted:   #8ba0b8;
  --text-faint:   #4a6280;
  --border:       #1e2f47;
  --border-light: #2a3f5a;

  --radius:       0.75rem;
  --radius-lg:    1.25rem;
  --radius-xl:    1.75rem;
  --shadow-card:  0 4px 24px rgba(0,0,0,.45);
  --shadow-glow:  0 0 40px rgba(249,115,22,.12);
}

/* ── Base Reset ──────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--surface);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Typography ──────────────────────────── */
h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: #fff;
}

h1 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); margin-bottom: 0.9rem; font-weight: 800; }
h2 { font-size: clamp(1.2rem, 2.2vw, 1.6rem); margin-bottom: 0.7rem; }
h3 { font-size: clamp(1rem, 1.5vw, 1.15rem); margin-bottom: 0.45rem; }

p {
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 0.75rem;
}

/* Softer bold — not harsh white on dark bg */
strong, b { font-weight: 700; color: #c8d6e0; }

/* H2 in content sections — accent */
.content-section h2 {
  position: relative;
  padding-left: 1rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}
.content-section h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.15em;
  height: calc(100% - 0.3em);
  width: 3px;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
  border-radius: 2px;
}

/* Content section: paragraphs breathe with bottom margin */
.content-section p { margin-bottom: 1.25rem; }
.content-section ul, .content-section ol { margin-bottom: 1.25rem; }



a {
  color: var(--brand);
  text-decoration: none;
  transition: color .15s ease;
}
a:hover { color: var(--brand-dark); }

ul, ol { color: var(--text-muted); padding-left: 1.4rem; }
li { margin-bottom: 0.45rem; line-height: 1.7; }

/* ── Header ──────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(8,14,26,.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.site-header nav { max-width: 1280px; margin: 0 auto; }

.logo {
  font-weight: 900;
  font-size: 1.3rem;
  letter-spacing: -0.04em;
  color: #fff !important;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
}
.logo-text {
  display: inline;
  letter-spacing: -0.04em;
  white-space: nowrap;
  color: #fff;
}
/* Only the inner Calculator span should be orange */
.logo-text > span,
.logo > span:not(.logo-text) { color: var(--brand); }

/* Footer logo */
.footer-logo {
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: -0.04em;
  color: #fff !important;
  display: inline-flex;
  align-items: center;
  gap: 0;
}
.footer-logo span { color: var(--brand); }

.nav-link {
  color: var(--text-muted) !important;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
  border-radius: 0.5rem;
  transition: color .15s, background .15s;
}
.nav-link:hover { color: #fff !important; background: var(--surface-3); }

#mobile-nav {
  display: none;
  flex-direction: column;
  padding: 0.75rem 1.25rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  gap: 0.15rem;
}
#mobile-nav.open { display: flex; }
#mobile-nav a {
  color: var(--text-muted);
  font-weight: 500;
  padding: 0.55rem 0.75rem;
  border-radius: 0.5rem;
  transition: color .15s, background .15s;
}
#mobile-nav a:hover { color: #fff; background: var(--surface-3); }

/* ── Hero ─── */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(249,115,22,.1);
  border: 1px solid rgba(249,115,22,.25);
  color: #fb940c;
  font-size: 0.775rem;
  font-weight: 700;
  padding: 0.3rem 1rem;
  border-radius: 999px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Calc Card ───────────────────────────── */
.calc-card {
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  overflow: hidden;
}

.calc-card-header {
  padding: 1.5rem 1.75rem;
  position: relative;
  overflow: hidden;
}

.calc-card-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='30' cy='30' r='29' stroke='rgba(255,255,255,.04)' stroke-width='1'/%3E%3C/svg%3E") center/100px repeat;
  pointer-events: none;
}

.calc-card-header h2 {
  color: #fff;
  font-size: 1.15rem;
  margin: 0 0 0.2rem;
  padding-left: 0;
}
.calc-card-header h2::before { display: none; }

.calc-card-body { padding: 1.75rem; }

/* Single consistent calculator header */
.calc-card-header { background: linear-gradient(135deg, #ea580c 0%, #9a3412 100%); }

/* ── Form Elements ───────────────────────── */
.form-group { margin-bottom: 1.15rem; }

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-input,
.form-select {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border-light);
  border-radius: 0.6rem;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.7rem 1rem;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
  -webkit-appearance: none;
}

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

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(249,115,22,.14);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%238ba0b8' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

/* Unit toggle */
.unit-toggle {
  display: inline-flex;
  background: var(--surface);
  border: 1.5px solid var(--border-light);
  border-radius: 0.5rem;
  overflow: hidden;
}
.unit-toggle button {
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color .15s, background .15s;
  font-family: inherit;
  letter-spacing: 0.02em;
}
.unit-toggle button.active { background: var(--brand); color: #fff; }

/* ── Buttons ─────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.85rem 1.75rem;
  border: none;
  border-radius: 0.65rem;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, filter .15s;
  width: 100%;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 16px rgba(249,115,22,.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(249,115,22,.45);
  filter: brightness(1.05);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.7rem 1.1rem;
  border: 1.5px solid var(--border-light);
  border-radius: 0.65rem;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.btn-secondary:hover { color: var(--text); border-color: var(--text-faint); background: var(--surface-3); }

/* ── Result Box ──────────────────────────── */
.result-box {
  background: linear-gradient(135deg, rgba(249,115,22,.07) 0%, rgba(234,88,12,.05) 100%);
  border: 1.5px solid rgba(249,115,22,.22);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  display: none;
  animation: resultFadeIn .35s ease;
}
@keyframes resultFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.result-box.show { display: block; }

.result-number {
  font-size: clamp(2.75rem, 7vw, 4rem);
  font-weight: 900;
  color: var(--brand);
  line-height: 1;
  letter-spacing: -0.04em;
}

.result-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-faint);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.result-badge {
  display: inline-block;
  padding: 0.28rem 1.1rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.badge-elite        { background: rgba(250,204,21,.12); color: #fbbf24; border: 1px solid rgba(250,204,21,.25); }
.badge-advanced     { background: rgba(34,197,94,.1);   color: #4ade80; border: 1px solid rgba(34,197,94,.25); }
.badge-intermediate { background: rgba(99,102,241,.1);  color: #818cf8; border: 1px solid rgba(99,102,241,.25); }
.badge-novice       { background: rgba(139,160,184,.08);color: #8ba0b8; border: 1px solid rgba(139,160,184,.2); }

/* ── FAQ — Card Style ──────────────────── */
.faq-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  overflow: hidden;
  transition: border-color .2s;
}
.faq-item:hover,
.faq-item.open { border-color: rgba(249,115,22,.35); }

.faq-question {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 1rem 1.25rem;
  font-family: inherit;
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: color .15s;
}
.faq-question:hover { color: var(--brand); }
.faq-icon {
  flex-shrink: 0; width: 16px; height: 16px;
  color: var(--text-faint);
  transition: transform .3s, color .15s;
}
.faq-item.open .faq-icon { transform: rotate(45deg); color: var(--brand); }
.faq-answer { overflow: hidden; max-height: 0; transition: max-height .35s ease; }
.faq-answer-inner {
  padding: 0 1.25rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.75;
}
.faq-item.open .faq-answer { max-height: 600px; }

/* ── Related Tools ───────────────────────── */
.related-tool-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  text-decoration: none;
}
.related-tool-card:hover {
  border-color: var(--brand);
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(249,115,22,.14);
}
.related-tool-card .card-title { font-weight: 700; font-size: 0.9rem; color: var(--text); }
.related-tool-card .card-desc  { font-size: 0.78rem; color: var(--text-faint); line-height: 1.6; }
.related-tool-card .card-arrow { color: var(--brand); font-size: 0.78rem; font-weight: 700; margin-top: 0.35rem; }

/* ── Category Cards ──────────────────────── */
.category-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.category-card:hover {
  border-color: rgba(249,115,22,.4);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(249,115,22,.1);
}
.category-icon {
  width: 48px; height: 48px;
  border-radius: 0.8rem;
  background: rgba(249,115,22,.1);
  border: 1px solid rgba(249,115,22,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 0.9rem;
}

/* ── Tool Listing Link ───────────────────── */
.tool-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.65rem;
  border-radius: 0.45rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.tool-link:hover { background: var(--surface-3); color: var(--text); }
.tool-link svg { flex-shrink: 0; color: var(--brand); opacity: 0.7; }

/* ── Footer ──────────────────────────────── */
.site-footer { background: var(--surface-2); border-top: 1px solid var(--border); }
.footer-link { color: var(--text-faint); font-size: 0.875rem; transition: color .15s; }
.footer-link:hover { color: var(--text-muted); }

/* ── Breadcrumb ──────────────────────────── */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; font-size: 0.775rem; }
.breadcrumb a { color: var(--text-faint); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb-sep { color: var(--border-light); }
.breadcrumb-current { color: var(--text-muted); font-weight: 500; }

/* ── Related Tool Cards ──────────────────── */
.related-tool-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color .2s, background .2s;
}
.related-tool-card:hover {
  border-color: rgba(249,115,22,.4);
  background: var(--surface-3);
  color: var(--text);
}
.related-tool-card .card-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  display: block;
}
.related-tool-card .card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: block;
  line-height: 1.5;
}
.related-tool-card .card-arrow {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand);
  display: block;
  margin-top: 0.2rem;
}

/* ── Stats ───────────────────────────────── */
.stat-number { font-size: 1.85rem; font-weight: 900; color: var(--brand); display: block; letter-spacing: -0.04em; }
.stat-label  { font-size: 0.75rem; color: var(--text-faint); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

/* ── Highlight Box ───────────────────────── */
.highlight-box {
  background: rgba(249,115,22,.06);
  border-left: 3px solid var(--brand);
  border-radius: 0 0.6rem 0.6rem 0;
  padding: 1.1rem 1.3rem;
  margin: 1.5rem 0;
}
.highlight-box p { margin-bottom: 0.4rem; }

/* ── Data Table ──────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: 0.75rem; border: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th {
  background: var(--surface-3);
  color: var(--text-muted);
  font-weight: 700;
  padding: 0.75rem 1.1rem;
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.data-table td { padding: 0.75rem 1.1rem; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,.02); color: var(--text); }

/* ── Error Message ───────────────────────── */
.msg-error {
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.25);
  color: #f87171;
  border-radius: 0.5rem;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 0.75rem;
}

/* ── Layout Utilities ────────────────────── */
.section     { padding: 4rem 0; }
.section-sm  { padding: 2.25rem 0; }
/* Tighter gap between tool hero desc and first content section */
.tool-hero + .section, .tool-hero + .section.content-section { padding-top: 1.75rem; }
.container   { max-width: 1280px; margin: 0 auto; padding: 0 1.25rem; }
.container-narrow { max-width: 820px; margin: 0 auto; padding: 0 1.25rem; }
.divider     { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.page-content { padding-top: 4.5rem; }

/* Gradient headline util — used sparingly */
.gradient-text {
  background: linear-gradient(135deg, #fff 0%, var(--brand) 60%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Tool page hero */
.tool-hero {
  padding: 2rem 0 1rem;
  background: none;
}

/* Full-width title block above the 2-col grid */
.tool-hero-title {
  margin-bottom: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}
.tool-hero-title .category-label {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: .65rem;
}
.tool-hero-title h1 {
  font-size: clamp(2rem, 4vw, 2.85rem);
  font-weight: 900;
  letter-spacing: -.03em;
  line-height: 1.1;
  margin-bottom: .6rem;
  color: #fff;
}
.tool-hero-title .lead {
  font-size: .975rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 600px;
  margin: 0;
}

/* Tight breadcrumb spacing on tool pages */
.tool-breadcrumb-wrap {
  padding-top: 0.9rem;
  padding-bottom: 0;
}

/* Centered calculator block */
.tool-calc-center {
  max-width: 720px;
  margin: 0 auto;
}

/* Description text below the calculator */
.tool-hero-desc {
  max-width: 720px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.tool-hero-desc p { color: var(--text-muted); line-height: 1.75; margin-bottom: .85rem; }
.tool-hero-desc p:last-child { margin-bottom: 0; }

/* Section separator — no top borders, tighter spacing for related tools */
.section-sep { border-top: none; }
.content-section + .section-sm { border-top: none; }
.section-sm.section-sep { padding-top: 1.25rem; }

/* Orange left-accent bar for FAQ and Related headings */
.section-title-accent {
  position: relative;
  padding-left: 1rem !important;
  margin-bottom: 1.25rem;
}
.section-title-accent::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.15em;
  height: calc(100% - 0.3em);
  width: 3px;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
  border-radius: 2px;
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 768px) {
  .calc-card-body    { padding: 1.25rem; }
  .calc-card-header  { padding: 1.25rem; }
  .section           { padding: 2.25rem 0; }
  .container-narrow  { padding: 0 1rem; }
}
