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

body {
    min-height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #111827;
}

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

body.menu-open {
    overflow: hidden;
}

/* -------- HEADER & NAV -------- */

.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);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.site-logo {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.1);
}

.brand-text {
    color: #ffffff;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.01em;
}

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

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

.nav-right {
    position: relative;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    transition: all 0.25s ease;
    font-weight: 500;
    display: inline-block;
}

.nav-link:hover {
    color: #e5e7eb;
    transform: scale(1.06);
}

/* Dropdown (desktop) */

.dropdown {
    position: relative;
}

.dropdown-toggle {
    background: none;
    border: none;
    color: #ffffff;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 4px;
    font-size: 0.95rem;
    transition: color 0.25s ease;
}

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

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

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

.dropdown-content a {
    color: #4a5568;
    padding: 12px 20px;
    text-decoration: none;
    display: block;
    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 nav */

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

/* mobile overlay */
.mobile-menu {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    align-items: flex-start;
    justify-content: center;
    z-index: 999;
}

.mobile-menu.open {
    display: flex;
}

.mobile-menu-panel {
    width: 100%;
    max-width: 480px;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-radius: 0 0 18px 18px;
    padding: 18px 24px 26px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    transform: translateY(-100%);
    transition: transform 0.25s ease-out;
}

.mobile-menu.open .mobile-menu-panel {
    transform: translateY(0);
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-menu-links a {
    color: #ecfdf5;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.3);
}

.mobile-menu-links a:last-child {
    border-bottom: none;
}

.mobile-menu-links a:hover {
    color: #ffffff;
}

/* -------- PAGE HEADER / HERO -------- */

.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 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;
}

.emoji-hero {
    font-size: 64px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.page-header h1 {
    font-size: 2.8rem;
    max-width: 900px;
    margin: 0 auto 16px;
    font-weight: 900;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.25);
}

.page-header p {
    font-size: 1.1rem;
    max-width: 820px;
    margin: 0 auto;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-18px); }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* -------- CALCULATOR 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);
}

.card-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #667eea;
    margin-bottom: 26px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

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

.input-wrapper {
    position: relative;
}

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

.input-field:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

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

.input-prefix {
    left: 20px;
}

.input-suffix {
    right: 20px;
}

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

.input-field.with-suffix {
    padding-right: 60px;
}

.slider-container {
    margin-top: 12px;
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, #667eea 0%, #764ba2 100%);
    outline: none;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.slider:hover {
    opacity: 1;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    border: none;
}

.select-field {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #cbd5e0;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-field:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.calculate-btn {
    width: 100%;
    margin-top: 28px;
    padding: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.25s ease;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 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, 1fr);
    gap: 18px;
    margin-bottom: 26px;
}

.result-box {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8edff 100%);
    padding: 20px;
    border-radius: 16px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.result-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.18);
}

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

.result-box.highlight .result-label,
.result-box.highlight .result-subtext,
.result-box.highlight .result-value {
    color: #ffffff;
}

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

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

.result-value {
    font-weight: 800;
    color: #667eea;
    font-size: 1.9rem;
}

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

/* Chart block */

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

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

.donut-chart {
    width: 280px;
    height: 280px;
    margin: 0 auto;
    position: relative;
}

.donut-chart svg {
    transform: rotate(-90deg);
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-center-label {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 4px;
}

.donut-center-value {
    font-size: 24px;
    font-weight: 800;
    color: #667eea;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.legend-text {
    font-size: 14px;
    color: #4a5568;
    font-weight: 600;
}

.legend-value {
    font-size: 14px;
    color: #667eea;
    font-weight: 700;
}

/* Stats & schedule */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.stat-item {
    background: #f8fafc;
    padding: 16px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

.stat-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
}

.payment-schedule {
    margin-top: 18px;
    max-height: 500px;
    overflow-y: auto;
}

.payment-item {
    background: #f8fafc;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: 80px 1fr 1fr 1fr 1fr;
    gap: 14px;
    align-items: center;
    border: 2px solid #e2e8f0;
    transition: all 0.25s ease;
}

.payment-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.payment-label {
    font-weight: 700;
    color: #667eea;
    font-size: 15px;
}

.payment-value {
    text-align: center;
}

.payment-value-label {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 4px;
}

.payment-value-amount {
    font-size: 14px;
    font-weight: 700;
    color: #2d3748;
}

/* Downloads */

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

.download-btn {
    flex: 1;
    padding: 13px 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s ease;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

/* -------- INFO CARDS -------- */

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
    margin-top: 36px;
}

.info-card {
    background: #ffffff;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #667eea;
    transition: all 0.25s ease;
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 9px 26px rgba(102, 126, 234, 0.28);
}

.info-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2933;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-card p {
    color: #4a5568;
    line-height: 1.7;
    font-size: 0.95rem;
}

.info-card a {
    color: #2563eb;
    text-decoration: none;
}

.info-card a:hover {
    text-decoration: underline;
}

.info-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    margin-top: 10px;
}

/* -------- BLOG SECTION -------- */

.blog-section {
    max-width: 900px;
    margin: 70px auto;
    padding: 0 20px;
}

.blog-content {
    background: #ffffff;
    border-radius: 24px;
    padding: 42px 36px 46px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    line-height: 1.8;
}

.blog-content h2 {
    font-size: 2.2rem;
    font-weight: 900;
    margin-bottom: 26px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.blog-content h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 14px;
    color: #111827;
}

.blog-content p {
    color: #4b5563;
    font-size: 0.98rem;
    margin-bottom: 16px;
}

.blog-content a {
    color: #2563eb;
    text-decoration: none;
}

.blog-content a:hover {
    text-decoration: underline;
}

.blog-content strong {
    color: #4c6fff;
}

/* -------- FAQ -------- */

.faq-section {
    background: linear-gradient(135deg, #eef2ff 0%, #e0f2fe 100%);
    padding: 50px 0 60px;
}

.faq-heading {
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 28px;
    color: #1f2937;
}

.faq-item {
    background: #ffffff;
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 14px;
    box-shadow: 0 4px 16px rgba(148, 163, 184, 0.3);
}

.faq-item h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: #111827;
}

.faq-item p {
    margin: 0;
    color: #4b5563;
    font-size: 0.95rem;
}

/* -------- FOOTER -------- */

.footer {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: #ffffff;
    padding: 60px 0 22px;
    margin-top: 70px;
}

.footer-column h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 18px;
    color: #a0aec0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-column ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-column li {
    margin-bottom: 10px;
}

.footer-column a {
    color: #cbd5e0;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.footer-column a:hover {
    color: #14b8a6;
    transform: translateX(4px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 32px;
    padding-top: 22px;
    text-align: center;
    color: #a0aec0;
    font-size: 0.9rem;
}

/* -------- RESPONSIVE -------- */

@media (max-width: 1024px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }

    .result-summary {
        grid-template-columns: 1fr;
    }

    .payment-item {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .main-nav {
        position: static;
        transform: none;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .page-header {
        padding: 60px 16px 70px;
    }

    .page-header h1 {
        font-size: 2.1rem;
    }

    .page-header p {
        font-size: 0.98rem;
    }

    .calculator-card {
        padding: 24px 20px;
    }

    .blog-content {
        padding: 28px 22px 32px;
    }

    .blog-content h2 {
        font-size: 1.9rem;
    }

    .download-buttons {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* view transition */
@view-transition {
    navigation: auto;
}
