:root {
    --primary: #0F172A;
    --primary-light: #1E293B;
    --accent: #3B82F6;
    --accent-hover: #2563EB;
    --background: #F8FAFC;
    --surface: #FFFFFF;
    --text: #1E293B;
    --text-light: #64748B;
    --success: #10B981;
    --border: #E2E8F0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 0.75rem;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--primary);
    letter-spacing: -0.025em;
}

h1 { font-size: 2.75rem; font-weight: 800; }
h2 { font-size: 2rem; font-weight: 700; }
h3 { font-size: 1.5rem; font-weight: 600; }
p { margin-bottom: 1.25rem; }
a { color: var(--accent); text-decoration: none; transition: all 0.2s; }
a:hover { color: var(--accent-hover); }

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
header {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.03em;
}

nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
}

nav a {
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.95rem;
}

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

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.75rem;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text);
    border-radius: var(--radius);
    transition: background 0.2s;
}

.mobile-menu-btn:hover {
    background-color: var(--background);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%);
    color: white;
    padding: 6rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.1) 0%, transparent 60%);
    pointer-events: none;
}

.hero h1 { color: white; margin-bottom: 1.5rem; font-size: 3.5rem; }
.hero p { font-size: 1.25rem; opacity: 0.9; max-width: 600px; margin: 0 auto 2.5rem; line-height: 1.6; }

/* Main Content */
main {
    flex: 1;
    padding: 4rem 0;
}

/* Cards & Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.tool-card h3 { margin-bottom: 0.75rem; color: var(--primary); }
.tool-card p { color: var(--text-light); font-size: 0.95rem; margin-bottom: 1.5rem; flex-grow: 1; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.btn:hover { 
    background: var(--accent-hover); 
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.4);
}

.btn:active { transform: translateY(0); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--accent);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 2rem;
    align-self: flex-start;
    transition: all 0.2s;
}

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

/* Calculator UI */
.calculator-wrapper {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 3rem;
    align-items: start;
    background: var(--surface);
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.calculator-form {
    background: transparent;
    padding: 0;
    box-shadow: none;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
    background-color: #F8FAFC;
    color: var(--primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    background-color: white;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.form-control::placeholder {
    color: #94A3B8;
}

/* Hide number input arrows */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

.input-group {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: #F8FAFC;
    transition: all 0.2s;
    overflow: hidden;
}

.input-group:focus-within {
    border-color: var(--accent);
    background-color: white;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.input-group .form-control {
    border: none;
    border-radius: 0;
    box-shadow: none;
    background-color: transparent;
}

.input-group .form-control:focus {
    box-shadow: none;
}

.input-prefix, .input-suffix {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    color: var(--text-light);
    font-weight: 500;
    background-color: #F1F5F9;
    font-size: 1rem;
}

.input-prefix {
    border-right: 1px solid var(--border);
}

.input-suffix {
    border-left: 1px solid var(--border);
}

.result-box {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    color: white;
    padding: 2.5rem;
    border-radius: 1rem;
    position: sticky;
    top: 6rem;
    box-shadow: var(--shadow-lg);
}

.result-item {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 1rem;
}

.result-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.result-label { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.7; display: block; margin-bottom: 0.5rem; }
.result-value { font-size: 2rem; font-weight: 700; color: #60A5FA; }

/* Share Buttons */
.share-container {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.share-label {
    font-weight: 600;
    color: var(--primary);
    margin-right: 0.5rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.share-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
    color: white;
}

.share-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.share-twitter { background-color: #1DA1F2; }
.share-facebook { background-color: #1877F2; }
.share-linkedin { background-color: #0A66C2; }
.share-whatsapp { background-color: #25D366; }
.share-copy { background-color: var(--text-light); cursor: pointer; border: none; }

/* Content Section */
.content-section {
    margin-top: 5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.faq-item {
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 0;
}
.faq-question {
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    color: var(--primary);
}
.faq-answer {
    margin-top: 1rem;
    color: var(--text-light);
    display: none;
    line-height: 1.7;
}
.faq-item.active .faq-answer { display: block; }

/* Footer */
footer {
    background: var(--primary);
    color: white;
    border-top: none;
    padding: 5rem 0 2rem;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-col h4 { font-size: 1.1rem; margin-bottom: 1.5rem; color: white; font-weight: 700; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.75rem; }
.footer-col a { color: #94A3B8; font-size: 0.95rem; }
.footer-col a:hover { color: white; }

.copyright {
    text-align: center;
    color: #64748B;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
}

/* Breadcrumbs */
.breadcrumbs {
    margin-bottom: 2rem;
    color: var(--text-light);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.breadcrumbs a {
    color: var(--text-light);
}

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

.breadcrumbs span {
    color: var(--primary);
    font-weight: 500;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
    margin-top: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.amortization-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    font-size: 0.95rem;
}

.amortization-table th,
.amortization-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.amortization-table th {
    background-color: #F1F5F9;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}

.amortization-table tr:last-child td {
    border-bottom: none;
}

.amortization-table tr:hover {
    background-color: #F8FAFC;
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1E293B;
    color: #F8FAFC;
    padding: 1.5rem;
    z-index: 1000;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
}

.cookie-content p {
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.cookie-buttons {
    display: flex;
    gap: 1rem;
}

.cookie-buttons .btn {
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
}

.cookie-buttons .btn-outline {
    border-color: #64748B;
    color: #F8FAFC;
}

.cookie-buttons .btn-outline:hover {
    background: #334155;
}

@media (min-width: 768px) {
    .cookie-content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

/* Utilities */
.w-full { width: 100%; }
.mt-4 { margin-top: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.text-center { text-align: center; }

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .calculator-wrapper { 
        grid-template-columns: 1fr; 
        padding: 1.25rem;
        gap: 1.5rem;
    }
    
    .mobile-menu-btn { 
        display: block; 
        z-index: 101;
    }

    .nav-links { 
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--surface);
        box-shadow: var(--shadow-lg);
        padding: 0;
        margin: 0;
        border-top: 1px solid var(--border);
        z-index: 100;
        gap: 0;
    }

    .nav-links.active {
        display: flex;
        animation: slideDown 0.2s ease-out;
    }

    .nav-links li {
        width: 100%;
        margin: 0;
    }

    .nav-links a {
        display: block;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--border);
        width: 100%;
        color: var(--text);
        font-size: 1rem;
    }

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

    .logo {
        font-size: 1.25rem;
        gap: 0.5rem;
    }
    .logo svg {
        width: 24px;
        height: 24px;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .hero { padding: 3rem 1rem; }
    .hero h1 { font-size: 2.25rem; }
    .hero p { font-size: 1.1rem; margin-bottom: 2rem; }
    
    .result-box { 
        position: static; 
        margin-top: 0; 
        padding: 1.5rem;
    }
    
    .result-value { 
        font-size: 1.75rem; 
        word-break: break-word;
    }

    .footer-grid {
        gap: 2rem;
    }

    .btn {
        min-height: 44px;
    }

    .form-control {
        min-height: 44px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    .modal-content {
        padding: 1.5rem;
    }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Welcome Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--surface);
    border-radius: 1rem;
    padding: 2.5rem;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--primary);
}

.modal-icon {
    width: 64px;
    height: 64px;
    background: #EFF6FF;
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

.modal-text {
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.6;
}

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

