:root {
    --primary: #2b4c7e;
    --primary-light: #abc2e8;
    --bg-gradient: linear-gradient(135deg, #6b8cce 0%, #4b6baf 100%);
    --card-bg: #d9e3f0;
    --text-main: #1e2b3c;
    --text-muted: #536885;
    --border-color: #b0c4de;
    --danger: #b84040;
    --success: #298256;
    --white: #ffffff;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    min-height: 100vh;
    box-sizing: border-box;
}

header {
    width: 100%;
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    max-width: 1000px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.2s;
}

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

main {
    width: 100%;
    max-width: 800px;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ad-space {
    width: 100%;
    max-width: 728px;
    height: 90px;
    background-color: rgba(255, 255, 255, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #f1f5f9;
    margin: 20px 0;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    font-size: 0.9rem;
    backdrop-filter: blur(4px);
}

.app-container {
    width: 100%;
    animation: fadeIn 0.5s ease-out;
}

.input-section {
    background-color: var(--card-bg);
    padding: 40px 20px;
    border-radius: 20px;
    box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.15);
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 2rem;
    margin-top: 0;
    margin-bottom: 25px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.025em;
}

.main-input {
    width: 100%;
    max-width: 350px;
    padding: 18px 24px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 2.2rem;
    text-align: center;
    font-weight: 700;
    color: var(--primary);
    background-color: var(--white);
    box-sizing: border-box;
    outline: none;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.main-input::-webkit-outer-spin-button,
.main-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.main-input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.main-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
    transform: translateY(-2px);
}

.main-input::placeholder {
    color: #94a3b8;
    font-size: 1.5rem;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.result-card {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.15);
    border-top: 6px solid var(--primary);
    transition: all 0.3s ease;
}

.result-card:nth-child(2) {
    border-top-color: var(--success);
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 25px -5px rgba(0, 0, 0, 0.2);
}

.result-card h2 {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0;
    margin-bottom: 25px;
    color: var(--text-muted);
    text-align: center;
    font-weight: 700;
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.15rem;
    font-weight: 500;
}

.data-row:last-child {
    border-bottom: none;
    font-weight: 800;
    font-size: 1.4rem;
    padding-bottom: 0;
    padding-top: 20px;
}

.data-row.total-neto { color: var(--primary); }
.data-row.total-bruto { color: var(--success); }
.iva-amount { color: var(--danger); font-weight: 600; }

.result-with-copy {
    display: flex;
    align-items: center;
    gap: 8px;
}

.copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    color: var(--text-muted);
    transition: all 0.2s;
}

.copy-btn:hover {
    background-color: rgba(255, 255, 255, 0.5);
    color: var(--primary);
    transform: scale(1.05);
}

.copy-btn svg { width: 18px; height: 18px; }
.data-row:last-child .copy-btn svg { width: 20px; height: 20px; }
.copy-btn.copied { color: var(--success); }

.seo-content {
    background-color: var(--white);
    padding: 40px;
    border-radius: 20px;
    margin-top: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    color: var(--text-muted);
    line-height: 1.7;
    width: 100%;
    box-sizing: border-box;
}

.seo-content h2 {
    color: var(--primary);
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 700;
}

.seo-content h3 {
    color: var(--text-main);
    font-size: 1.3rem;
    margin-top: 30px;
    margin-bottom: 15px;
}

.seo-content p { margin-bottom: 20px; }
.seo-content ul { margin-bottom: 20px; padding-left: 20px; }
.seo-content li { margin-bottom: 10px; }

.highlight-box {
    background-color: #f8fafc;
    border-left: 4px solid var(--primary);
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}

footer {
    width: 100%;
    background-color: var(--text-main);
    color: var(--white);
    padding: 40px 20px;
    margin-top: auto;
    text-align: center;
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--border-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--white);
    text-decoration: underline;
}

.legal-container {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 40px auto;
    color: var(--text-main);
    line-height: 1.7;
}

.legal-container h1 { color: var(--primary); }
.legal-container h2 { color: #4b6baf; margin-top: 30px; font-size: 1.5rem; }
.legal-container a { color: var(--primary); text-decoration: none; }
.legal-container a:hover { text-decoration: underline; }
.back-link { display: inline-block; margin-bottom: 20px; font-weight: 600; color: var(--primary); text-decoration: none; }

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

@media (max-width: 768px) {
    .results-grid { grid-template-columns: 1fr; gap: 20px; }
    h1 { font-size: 1.6rem; }
    .main-input { font-size: 1.6rem; padding: 15px; }
    .seo-content { padding: 25px 20px; }
    .seo-content h2 { font-size: 1.5rem; }
    .navbar { flex-direction: column; gap: 15px; }
    .legal-container { margin: 20px; padding: 25px 20px; }
}