/* ============================================ */
/* ANNUALIZED RETURN CALCULATOR - STANDALONE CSS */
/* ============================================ */

:root {
  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --accent: #2563eb;
  --accent-light: #dbeafe;
  --accent-dark: #1d4ed8;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  --positive: #16a34a;
  --negative: #dc2626;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #334155;
  --accent: #3b82f6;
  --accent-light: #1e3a8a;
  --accent-dark: #60a5fa;
  --positive: #22c55e;
  --negative: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* NAVBAR */
.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.hamburger {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  position: relative;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 2px;
  background: var(--text);
  left: 0;
}

.hamburger::before { top: -8px; }
.hamburger::after { top: 8px; }

.nav-menu {
  display: flex;
  list-style: none;
  gap: 8px;
  align-items: center;
}

.nav-menu li { list-style: none; }

.nav-menu a {
  padding: 8px 14px;
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: var(--radius);
  transition: all 0.15s ease;
  text-decoration: none;
  display: inline-block;
}

.nav-menu a:hover,
.nav-menu a.active {
  background: var(--bg-secondary);
  color: var(--accent);
  text-decoration: none;
}

.nav-dropdown { position: relative; }
.dropdown-toggle { cursor: pointer; }

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  min-width: 260px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  display: none;
  z-index: 100;
}

.nav-dropdown:hover .dropdown-menu { display: block; }

.dropdown-category { padding: 8px 0; }

.category-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  margin-bottom: 4px;
}

.dropdown-tools { list-style: none; }
.dropdown-tools li { list-style: none; }

.dropdown-tools a {
  display: block;
  padding: 6px 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.dropdown-tools a:hover {
  background: var(--bg-secondary);
  color: var(--accent);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.view-all {
  display: block;
  padding: 8px 12px;
  font-weight: 600;
  color: var(--accent);
  text-align: center;
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  font-size: 1.1rem;
  border-radius: var(--radius);
}

.nav-theme-item { list-style: none; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-menu {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    flex-direction: column;
    padding: 20px;
    border-top: 1px solid var(--border);
    display: none;
    align-items: stretch;
    gap: 4px;
  }
  .nav-menu.active { display: flex; }
  .nav-dropdown:hover .dropdown-menu {
    position: static;
    display: block;
    box-shadow: none;
    border: none;
    padding-left: 16px;
  }
  .nav-menu a { display: block; width: 100%; }
}

/* HERO */
.arc-hero {
  padding: 60px 0 40px;
  text-align: center;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.arc-hero h1 {
  font-size: 2.5rem;
  margin-bottom: 16px;
  color: var(--text);
  font-weight: 800;
}

.arc-hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

.arc-hero-badge {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* CALCULATOR */
.arc-calculator-section { padding: 60px 0; }

.arc-calculator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
}

.arc-form-card,
.arc-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.arc-form-title,
.arc-result-title {
  font-size: 1.3rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  color: var(--text);
  font-weight: 700;
}

.arc-form-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* Monthly Return Rows */
.arc-return-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.arc-return-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 80px;
}

.arc-input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.arc-input-wrap input {
  width: 100%;
  padding: 10px 40px 10px 14px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.arc-input-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.arc-input-suffix {
  position: absolute;
  right: 14px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  pointer-events: none;
}

.arc-form-actions {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}

.arc-btn-add,
.arc-btn-remove {
  flex: 1;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.arc-btn-add:hover {
  border-color: var(--accent);
  color: var(--accent);
  border-style: solid;
}

.arc-btn-remove:hover {
  border-color: var(--negative);
  color: var(--negative);
  border-style: solid;
}

.arc-btn-group {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.arc-btn {
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  flex: 1;
  font-family: inherit;
}

.arc-btn.primary {
  background: var(--accent);
  color: white;
}

.arc-btn.primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.arc-btn.secondary {
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
}

.arc-btn.secondary:hover {
  background: var(--bg);
  border-color: var(--accent);
}

/* Result Card */
.arc-highlight-box {
  padding: 32px 24px;
  border-radius: var(--radius);
  text-align: center;
  margin-bottom: 24px;
  color: white;
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  transition: background 0.3s ease;
}

.arc-highlight-box.negative {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
}

.arc-result-label {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.arc-result-value {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 4px;
}

.arc-result-subtext {
  font-size: 0.95rem;
  opacity: 0.9;
}

.arc-breakdown-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

.arc-breakdown-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.arc-breakdown-item:last-child { border-bottom: none; }
.arc-breakdown-label { color: var(--text-secondary); }
.arc-breakdown-value { font-weight: 700; color: var(--text); }
.arc-breakdown-value.positive { color: var(--positive); }
.arc-breakdown-value.negative { color: var(--negative); }

.arc-formula-box,
.arc-excel-box {
  background: var(--bg-secondary);
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  border-left: 3px solid var(--accent);
}

.arc-excel-box { border-left-color: #16a34a; }

.arc-formula-box code,
.arc-excel-box code {
  display: block;
  margin-top: 6px;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
  word-break: break-all;
}

.arc-copy-bar { text-align: center; }

.arc-copy-btn {
  padding: 10px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  font-family: inherit;
  transition: all 0.15s ease;
}

.arc-copy-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Steps Section */
.arc-steps-section {
  margin-top: 48px;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.arc-steps-section h3 {
  font-size: 1.3rem;
  margin-bottom: 20px;
  color: var(--text);
}

.arc-steps-list {
  list-style: none;
  padding: 0;
  counter-reset: step-counter;
}

.arc-steps-list li {
  padding: 12px 0 12px 40px;
  border-bottom: 1px solid var(--border);
  position: relative;
  color: var(--text-secondary);
  font-size: 0.95rem;
  counter-increment: step-counter;
}

.arc-steps-list li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.arc-steps-list li:last-child { border-bottom: none; }

.arc-steps-list code {
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
}

/* Formula Section */
.arc-formula-section {
  padding: 60px 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.arc-formula-section h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 40px;
  font-weight: 700;
}

.arc-formula-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}

.arc-formula-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.arc-formula-card h3 {
  font-size: 1.15rem;
  margin-bottom: 16px;
  color: var(--text);
}

.arc-formula-box-large {
  background: var(--bg-secondary);
  padding: 18px;
  border-radius: var(--radius);
  text-align: center;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  overflow-x: auto;
}

.arc-formula-box-large code {
  font-family: 'Courier New', monospace;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.arc-legend {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.arc-legend li {
  padding: 6px 0;
  line-height: 1.5;
}

.arc-legend strong {
  color: var(--text);
  font-family: 'Courier New', monospace;
}

.arc-formula-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
  font-style: italic;
}

.arc-example-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px;
}

.arc-example-card h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
}

.arc-example-card p {
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.7;
}

/* Content Article */
.arc-content-article {
  padding: 60px 0;
  background: var(--bg-secondary);
}

.arc-content-article h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  font-weight: 700;
}

.arc-content-article h3 {
  font-size: 1.4rem;
  margin: 32px 0 16px;
  color: var(--text);
}

.arc-content-article p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
}

.arc-content-article ul,
.arc-content-article ol {
  margin-left: 24px;
  color: var(--text-secondary);
  line-height: 1.9;
  margin-bottom: 16px;
}

.arc-internal-links {
  margin-top: 40px;
  padding: 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.arc-internal-links h3 { margin-top: 0; }
.arc-internal-links ul { list-style: none; margin: 0; padding: 0; }
.arc-internal-links li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.arc-internal-links li:last-child { border-bottom: none; }
.arc-internal-links a { color: var(--accent); font-weight: 600; text-decoration: none; }
.arc-internal-links a:hover { text-decoration: underline; }

/* FAQ */
.arc-faq { padding: 60px 0; }

.arc-faq h2 {
  text-align: center;
  margin-bottom: 40px;
  font-size: 2rem;
  font-weight: 700;
}

.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 18px 0;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  font-family: inherit;
}

.faq-question:hover { color: var(--accent); }

.faq-icon {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--accent);
  flex-shrink: 0;
  line-height: 1;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-answer p {
  padding: 0 0 18px;
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.98rem;
}

/* Footer */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-brand p {
  color: var(--text-secondary);
  margin-top: 12px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.footer-logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent);
}

.footer-tagline {
  font-weight: 600;
  color: var(--accent);
  margin-top: 8px;
}

.footer-nav ul { list-style: none; padding: 0; }
.footer-nav li { margin-bottom: 8px; list-style: none; }

.footer-nav a {
  color: var(--text-secondary);
  font-size: 0.92rem;
  text-decoration: none;
}

.footer-nav a:hover { color: var(--accent); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-privacy {
  margin-top: 6px;
  font-size: 0.82rem;
}

/* Responsive */
@media (max-width: 900px) {
  .arc-calculator-grid,
  .arc-formula-grid { grid-template-columns: 1fr; }
  .arc-hero h1 { font-size: 2rem; }
  .arc-result-value { font-size: 2.5rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 640px) {
  .arc-hero { padding: 40px 0 30px; }
  .arc-hero h1 { font-size: 1.75rem; }
  .arc-btn-group { flex-direction: column; }
  .arc-form-card, .arc-result-card { padding: 20px; }
  .arc-result-value { font-size: 2.2rem; }
  .arc-return-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .arc-return-label { min-width: auto; }
  .arc-formula-box code,
  .arc-excel-box code { font-size: 0.75rem; }
}