@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Blue/Navy Theme - Completely Different from Previous Calculators */
    --primary-gradient: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    --secondary-gradient: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
    --accent-gradient: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);

    --primary-blue: #1e3a8a;
    --primary-light: #3b82f6;
    --secondary-purple: #7c3aed;
    --accent-cyan: #0891b2;
    --warning-amber: #f59e0b;
    --success-green: #10b981;
    --danger-red: #ef4444;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-dark: #0f172a;

    --border-color: #cbd5e1;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.12);
    --shadow-lg: 0 8px 32px rgba(15, 23, 42, 0.16);
    --shadow-xl: 0 16px 48px rgba(15, 23, 42, 0.20);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-2xl: 24px;

    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    background: var(--bg-secondary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header - Clean Professional Design */
header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

header .container {
    padding: 1.2rem 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--primary-blue);
}

.logo svg {
    transition: transform var(--transition);
    filter: drop-shadow(0 2px 4px rgba(30, 58, 138, 0.2));
}

.logo:hover svg {
    transform: scale(1.08);
}

/* Hero - Modern Professional Style */
.hero {
    background: var(--primary-gradient);
    color: white;
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 400;
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.hero-badges {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.15);
    padding: 12px 24px;
    border-radius: var(--radius-xl);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition);
}

.badge:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

/* Calculator Section - Two Panel Layout */
.calculator-section {
    padding: 60px 0 80px;
}

.calc-layout {
    display: grid;
    grid-template-columns: 480px 1fr;
    gap: 32px;
    margin-top: 40px;
}

/* Left Panel - Input Form */
.calc-input-panel {
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    padding: 32px;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.panel-header {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--bg-tertiary);
}

.panel-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 8px;
}

.panel-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix,
.input-suffix {
    position: absolute;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    pointer-events: none;
}

.input-prefix {
    left: 16px;
}

.input-suffix {
    right: 16px;
}

.input-group input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 500;
}

.input-group input[type="number"]:not(:placeholder-shown) {
    padding-left: 60px;
}

.input-group input:has(+ .input-suffix) {
    padding-right: 60px;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-light);
    background: white;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.input-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
    font-style: italic;
}

.section-divider {
    margin: 32px 0 20px;
    text-align: center;
    position: relative;
}

.section-divider::before,
.section-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 100px);
    height: 1px;
    background: var(--border-color);
}

.section-divider::before {
    left: 0;
}

.section-divider::after {
    right: 0;
}

.section-divider span {
    background: white;
    padding: 0 16px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Checkbox Groups */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    padding: 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    transition: all var(--transition);
    cursor: pointer;
}

.checkbox-group:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-light);
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--primary-light);
}

.checkbox-group label {
    flex: 1;
    cursor: pointer;
    margin: 0;
}

.checkbox-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.checkbox-desc {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 28px;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-outline {
    background: white;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-outline:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-2px);
}

/* Right Panel - Results */
.calc-results-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.results-hero {
    background: var(--primary-gradient);
    border-radius: var(--radius-2xl);
    padding: 40px;
    color: white;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.results-hero::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.result-main {
    position: relative;
    z-index: 1;
}

.result-label {
    display: block;
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 12px;
    font-weight: 500;
}

.result-amount {
    display: block;
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.result-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: all var(--transition);
}

.result-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.result-card.highlight {
    border: 2px solid var(--warning-amber);
}

.result-card.total {
    grid-column: 1 / -1;
    background: var(--bg-dark);
    color: white;
}

.result-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.result-icon svg {
    fill: white;
}

.result-content {
    flex: 1;
}

.result-title {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.result-card.total .result-title {
    color: rgba(255, 255, 255, 0.8);
}

.result-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
}

.result-card.total .result-value {
    color: white;
    font-size: 2rem;
}

/* Cost Breakdown */
.cost-breakdown {
    background: white;
    border-radius: var(--radius-2xl);
    padding: 32px;
    box-shadow: var(--shadow-md);
}

.cost-breakdown h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--primary-blue);
}

.breakdown-bar {
    display: flex;
    height: 60px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.bar-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all var(--transition);
}

.bar-segment:hover {
    opacity: 0.9;
}

.bar-segment.principal {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.bar-segment.interest {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.bar-segment.fees {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.bar-label {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.breakdown-legend {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-color.principal {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.legend-color.interest {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.legend-color.fees {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Info Section */
.info-section {
    padding: 80px 0;
    background: white;
}

.info-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 50px;
    color: var(--primary-blue);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
}

.info-box {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 32px;
    border: 2px solid var(--border-color);
    transition: all var(--transition);
}

.info-box:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.info-box-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.info-box-icon {
    font-size: 2.5rem;
}

.info-box h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.formula-display {
    background: var(--bg-dark);
    padding: 16px;
    border-radius: var(--radius-md);
    margin: 16px 0;
    overflow-x: auto;
}

.formula-display code {
    color: #fbbf24;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: 600;
}

.info-box p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 12px;
}

.fee-list {
    list-style: none;
}

.fee-list li {
    padding: 10px 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.fee-list li:last-child {
    border-bottom: none;
}

/* FAQ Section */
.faq-section {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.faq-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 50px;
    color: var(--primary-blue);
}

.faq-list {
    max-width: 900px;
    margin: 0 auto;
}

.faq-item {
    background: white;
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.faq-item:hover {
    box-shadow: var(--shadow-md);
}

.faq-item h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--primary-blue);
}

.faq-item p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Footer */
footer {
    background: var(--bg-dark);
    color: white;
    padding: 50px 0 24px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    margin-bottom: 32px;
}

.footer-col h4 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.footer-col p {
    color: var(--text-light);
    line-height: 1.7;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col a {
    color: var(--text-light);
    text-decoration: none;
    transition: color var(--transition);
}

.footer-col a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .calc-layout {
        grid-template-columns: 1fr;
    }

    .calc-input-panel {
        position: static;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.2rem;
    }

    .hero-badges {
        flex-direction: column;
        align-items: center;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .result-amount {
        font-size: 2.5rem;
    }

    .button-group {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .breakdown-legend {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {

    .calc-input-panel,
    .cost-breakdown {
        padding: 24px;
    }

    .results-hero {
        padding: 28px;
    }

    .result-amount {
        font-size: 2rem;
    }
}