:root {
  /* Premium Fintech Palette */
  --bg-body: #F3F4F6;
  --bg-surface: #FFFFFF;
  --primary: #111827; 
  --primary-hover: #000000;
  --accent: #4F46E5;
  --text-main: #111827;
  --text-muted: #6B7280;
  --border: #E5E7EB;
  --error: #EF4444;
  
  /* Precision Spacing */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --tracking-tight: -0.03em;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-float: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* TYPOGRAPHY */
h1, h2, h3 { font-weight: 800; letter-spacing: var(--tracking-tight); color: var(--text-main); line-height: 1.1; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); } /* Adjusted for mobile fit */
h2 { font-size: 1.5rem; }
p { font-size: 1.05rem; color: var(--text-muted); }
.tabular-nums { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; font-weight: 600; }

/* LAYOUT */
.container { width: 100%; max-width: 1024px; margin: 0 auto; padding: 0 1.5rem; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media(min-width: 768px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* NAVBAR */
.navbar {
  position: sticky; top: 0; z-index: 1002;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.05); padding: 1rem 0;
}
.nav-content { display: flex; justify-content: space-between; align-items: center; }
.logo { font-weight: 800; font-size: 1.25rem; text-decoration: none; color: var(--primary); letter-spacing: -0.04em; z-index: 1001; }

.nav-links { display: none; }
.nav-links a { margin-left: 2.5rem; text-decoration: none; color: var(--text-muted); font-weight: 500; font-size: 0.95rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--primary); }
@media(min-width: 768px) { .nav-links { display: block; } .mobile-toggle { display: none; } }

/* MOBILE NAV */
.mobile-toggle { background: none; border: none; cursor: pointer; z-index: 1001; padding: 0.5rem; }
.mobile-menu-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
  background: rgba(255, 255, 255, 0.98); backdrop-filter: blur(20px);
  z-index: 1000; display: flex; flex-direction: column; justify-content: center; align-items: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.mobile-menu-overlay.active { opacity: 1; pointer-events: all; }
.mobile-menu-overlay a {
  font-size: 1.75rem; font-weight: 800; color: var(--primary); text-decoration: none; margin: 1.25rem 0;
  opacity: 0; transform: translateY(20px); transition: all 0.4s ease;
}
.mobile-menu-overlay.active a { opacity: 1; transform: translateY(0); }

/* CALCULATOR CARD */
.calc-card {
  background: var(--bg-surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float); border: 1px solid var(--border);
  overflow: hidden; margin: 2rem auto 4rem; max-width: 480px;
}
.calc-header { padding: 2rem 2rem 1.5rem; border-bottom: 1px solid var(--border); background: #FAFAFA; }
.calc-body { padding: 2rem; }

/* INPUTS */
.input-group { margin-bottom: 1.5rem; }
.input-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.75rem; color: var(--text-main); }
.currency-input { position: relative; }
.currency-input span { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-weight: 500; }
.currency-input input {
  width: 100%; padding: 1rem 1rem 1rem 2.5rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 1.25rem; font-weight: 600; color: var(--primary); background: #fff;
  outline: none; transition: all 0.2s;
}
.currency-input input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1); }
.warning-text { color: var(--error); font-size: 0.85rem; margin-top: 0.5rem; font-weight: 500; }

/* TOGGLE & RESULTS */
.toggle-wrapper { display: flex; justify-content: space-between; align-items: center; background: #F9FAFB; padding: 1rem; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #E5E7EB; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 2px; bottom: 2px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }

.receipt-divider { height: 1px; background-image: linear-gradient(to right, var(--border) 50%, transparent 50%); background-size: 8px 1px; margin: 2rem 0; }
.line-item { display: flex; justify-content: space-between; margin-bottom: 1rem; color: var(--text-muted); font-size: 0.95rem; }
.line-item.total { color: var(--primary); font-weight: 800; font-size: 1.5rem; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 2px solid var(--border); align-items: center; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 1rem 1.5rem; border-radius: var(--radius-sm); font-weight: 600; text-decoration: none; transition: all 0.2s; cursor: pointer; border: none; font-size: 1rem; }
.btn-primary { background: var(--primary); color: white; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
.btn-outline { background: white; border: 1px solid var(--border); color: var(--text-muted); }
.full-width { width: 100%; }

footer { margin-top: auto; padding: 4rem 0; background: white; border-top: 1px solid var(--border); text-align: center; }
.footer-link { margin: 0 1rem; color: var(--text-muted); text-decoration: none; font-size: 0.9rem; }
.footer-link:hover { text-decoration: underline; }
/* COOKIE BANNER */
.cookie-banner {
    position: fixed;
    bottom: -100%; /* Hidden by default */
    left: 0;
    width: 100%;
    background: #ffffff;
    border-top: 1px solid #E5E7EB;
    padding: 1.5rem;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 9999;
    transition: bottom 0.5s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* Slide up when active */
.cookie-banner.active {
    bottom: 0;
}

.cookie-content {
    max-width: 1024px;
    width: 100%;
    text-align: center;
}

.cookie-content h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.cookie-content p {
    font-size: 0.9rem;
    color: #4B5563;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.cookie-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-cookie-accept {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-cookie-reject {
    background: transparent;
    border: 1px solid #D1D5DB;
    color: #4B5563;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-cookie-accept:hover { background: var(--primary-hover); }
.btn-cookie-reject:hover { background: #F3F4F6; }

@media (min-width: 768px) {
    .cookie-banner {
        flex-direction: row;
        justify-content: center;
        text-align: left;
        padding: 1rem 2rem;
    }
    .cookie-content {
        text-align: left;
        margin-right: 2rem;
    }
    .cookie-content p { margin-bottom: 0; }
}
