@view-transition {
    navigation: auto;
}

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

html,
body {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100%;
}

/* Header & navigation */

.header {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(5, 150, 105, 0.15);
}

.site-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.site-title-link {
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.25s ease;
}

.nav-links a:hover {
    color: #e5e7eb;
    transform: scale(1.05);
}

.desktop-nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.dropdown {
    position: relative;
}

.dropdown-toggle {
    background: none;
    border: none;
    color: #ffffff;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.25s ease;
}

.dropdown-toggle:hover {
    color: #e5e7eb;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 110%;
    right: 0;
    background: #ffffff;
    min-width: 220px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    margin-top: 8px;
    overflow: hidden;
    z-index: 1100;
}

.dropdown.open .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: #4a5568;
    padding: 12px 20px;
    display: block;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.25s ease;
}

.dropdown-content a:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #ffffff;
    padding-left: 28px;
}

/* Mobile menu */

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    z-index: 1101;
}

.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 999;
}

.mobile-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.mobile-menu {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    padding: 16px 24px 24px;
    border-radius: 0 0 22px 22px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 1001;
}

.mobile-menu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.mobile-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-menu li + li {
    margin-top: 12px;
}

.mobile-menu a {
    color: #f9fafb;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    display: block;
    padding: 10px 6px;
    border-radius: 10px;
    transition: background 0.25s ease, transform 0.2s ease;
}

.mobile-menu a:hover {
    background: rgba(16, 185, 129, 0.25);
    transform: translateX(4px);
}

/* Page hero */

.page-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    padding: 80px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120'><path d='M0,0 Q300,60 600,30 T1200,0 L1200,120 L0,120 Z' fill='rgba(255,255,255,0.05)'/></svg>")
        repeat-x bottom;
    background-size: 1200px 120px;
    opacity: 0.3;
}

.page-header h1 {
    font-size: 2.9rem;
    font-weight: 900;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.25);
    animation: slideInDown 0.6s ease;
}

.page-header p {
    font-size: 1.25rem;
    position: relative;
    z-index: 1;
    opacity: 0.96;
    animation: slideInUp 0.6s ease;
}

/* Main layout */

.calculator-container {
    max-width: 1400px;
    margin: -60px auto 60px;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.calculator-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.6s ease;
}

.card-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #f59e0b;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Inputs */

.input-section {
    margin-bottom: 24px;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.input-wrapper {
    position: relative;
}

.input-field,
.select-field {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #cbd5e0;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.input-field:focus,
.select-field:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.input-prefix {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #4a5568;
    font-weight: 600;
    pointer-events: none;
}

.input-field.with-prefix {
    padding-left: 52px;
}

.calculate-btn {
    width: 100%;
    margin-top: 24px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
}

.calculate-btn:active {
    transform: scale(0.98);
}

/* Results */

.results-section {
    display: none;
}

.results-section.show {
    display: block;
}

.result-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.result-box {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 24px;
    border-radius: 16px;
    border-left: 4px solid #f59e0b;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.result-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.2);
}

.result-box.highlight {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    grid-column: 1 / -1;
}

.result-box.highlight .result-label {
    color: rgba(255, 255, 255, 0.9);
}

.result-box.highlight .result-value {
    color: #ffffff;
    font-size: 2.6rem;
}

.result-box.highlight .result-subtext {
    color: rgba(255, 255, 255, 0.85);
}

.result-label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.result-value {
    font-weight: 800;
    color: #f59e0b;
    font-size: 1.8rem;
}

.result-subtext {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 4px;
}

/* Charts / breakdown */

.chart-container {
    background: #ffffff;
    padding: 28px 24px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tax-burden-message {
    color: #4a5568;
    text-align: center;
    margin-top: 14px;
}

.progress-bar-container {
    background: #e2e8f0;
    border-radius: 12px;
    height: 40px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    transition: width 0.8s ease;
}

.tax-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 10px;
    border-left: 4px solid #f59e0b;
}

.tax-breakdown-label {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem;
}

.tax-breakdown-value {
    font-weight: 700;
    color: #f59e0b;
    font-size: 1.05rem;
}

.tax-breakdown-value.credits {
    color: #10b981;
}

/* Download buttons */

.download-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.download-btn {
    flex: 1;
    padding: 14px 18px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
