/* Calculadora de Impuesto sobre la Renta - EvatarAI */
/* Estilo moderno con menú horizontal tipo TesorerIA */

:root {
    --brand-500: #88b027;
    --brand-600: #498632;
    --brand-700: #1e4113;
    --brand-50: #f4f9e8;
    --brand-100: #e5f2c9;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --error: #dc2626;
    --success: #10b981;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --font-heading: 'Krona One', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
    font-family: var(--font-body);
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================================
   NAVBAR HORIZONTAL ESTILO TESORERIA
   ============================================================================ */

.navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-logo {
    width: 180px;
    height: 50px;
    object-fit: contain;
}

.navbar-title {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    color: var(--brand-700);
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.navbar-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    position: relative;
}

.navbar-link svg {
    flex-shrink: 0;
    transition: transform 0.2s;
}

.navbar-link:hover svg {
    transform: translateY(-2px);
}

.navbar-link:hover {
    background: var(--gray-100);
    color: var(--brand-600);
}

.navbar-link.active {
    background: var(--brand-50);
    color: var(--brand-700);
}

.navbar-link.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--brand-500);
}

/* Hamburger Toggle Button (Hidden on Desktop) */
.navbar-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.hamburger-line {
    width: 30px;
    height: 3px;
    background: var(--brand-600);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.navbar-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.navbar-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ============================================================================
   LAYOUT GENERAL
   ============================================================================ */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.main-content {
    flex: 1;
    padding: 2rem 0;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.page-header {
    margin-bottom: 2rem;
    text-align: center;
}

.page-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--brand-700);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* ============================================================================
   CARDS
   ============================================================================ */

.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--brand-50), white);
    border-bottom: 2px solid var(--brand-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-700);
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

.results-card {
    border: 2px solid var(--brand-500);
}

.results-card .card-header {
    background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
}

.results-card .card-title {
    color: white;
}

/* ============================================================================
   EXPORT BUTTONS
   ============================================================================ */

.export-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-export {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    color: var(--brand-700);
    border: 2px solid white;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.btn-export:hover {
    background: var(--brand-50);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-export svg {
    stroke-width: 2;
}

/* ============================================================================
   FORMS
   ============================================================================ */

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

.form-label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.label-hint {
    color: var(--gray-500);
    font-weight: 400;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
    font-family: var(--font-body);
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(136, 176, 39, 0.1);
}

.form-text {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.875rem;
    color: var(--gray-500);
}

.currency-input {
    font-family: monospace;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--brand-700);
}

/* ============================================================================
   CUSTOM SELECT (DROPDOWN MODERNO)
   ============================================================================ */

.custom-select-wrapper {
    position: relative;
}

.custom-select {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    background: linear-gradient(135deg, #ffffff, #f9fafb);
    appearance: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.custom-select:hover {
    border-color: var(--brand-500);
    background: linear-gradient(135deg, #ffffff, var(--brand-50));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(136, 176, 39, 0.15);
}

.custom-select:focus {
    outline: none;
    border-color: var(--brand-600);
    background: white;
    box-shadow: 0 0 0 4px rgba(136, 176, 39, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.custom-select option {
    padding: 1rem;
    background: white;
    color: var(--gray-800);
    font-weight: 500;
}

.custom-select option:checked {
    background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
    color: white;
}

.select-arrow {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--gray-500);
    transition: all 0.2s;
}

.custom-select:hover + .select-arrow,
.custom-select:focus + .select-arrow {
    color: var(--brand-600);
}

/* ============================================================================
   TOGGLE BUTTONS
   ============================================================================ */

.btn-group-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    background: var(--gray-100);
    padding: 0.25rem;
    border-radius: 0.5rem;
}

.btn-radio {
    display: none;
}

.btn-toggle {
    padding: 0.75rem 1rem;
    text-align: center;
    font-weight: 600;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--gray-600);
}

.btn-radio:checked + .btn-toggle {
    background: var(--brand-500);
    color: white;
    box-shadow: var(--shadow);
}

/* ============================================================================
   CHECKBOXES
   ============================================================================ */

.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.form-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: var(--brand-500);
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.checkbox-label {
    cursor: pointer;
    font-weight: 500;
    margin: 0;
    line-height: 1.5;
}

.checkbox-hint {
    color: var(--gray-500);
    font-size: 0.875rem;
    display: block;
    font-weight: 400;
}

/* ============================================================================
   SECTIONS
   ============================================================================ */

.section-divider {
    margin: 2rem 0 1.5rem 0;
    padding-top: 1.5rem;
    border-top: 2px solid var(--gray-200);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-600);
    margin: 0 0 1rem 0;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

/* ============================================================================
   ALERTS
   ============================================================================ */

.alert {
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert-error {
    background: #fef2f2;
    border-color: var(--error);
    color: #991b1b;
}

/* ============================================================================
   RESULTS TABLE
   ============================================================================ */

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

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

.results-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.9rem;
}

.results-table .highlight {
    background: var(--brand-50);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--brand-700);
}

.text-right {
    text-align: right !important;
}

.text-success {
    color: var(--success);
}

.mb-4 {
    margin-bottom: 1.5rem;
}

/* ============================================================================
   FAQs
   ============================================================================ */

.faq-item {
    border-left: 4px solid var(--brand-500);
    padding-left: 1.25rem;
    margin-bottom: 1.5rem;
}

.faq-question {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--brand-700);
    margin-bottom: 0.75rem;
}

.faq-answer {
    color: var(--gray-700);
    line-height: 1.7;
}

.faq-answer ul,
.faq-answer ol {
    margin-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.faq-answer li {
    margin-bottom: 0.5rem;
}

.disclaimer {
    background: var(--gray-100);
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--brand-500);
}

/* ============================================================================
   TABLAS FISCALES
   ============================================================================ */

.fiscal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 0.75rem;
    overflow: hidden;
}

.fiscal-table thead {
    background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-500) 100%);
    color: white;
}

.fiscal-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fiscal-table tbody tr {
    border-bottom: 1px solid var(--gray-200);
    transition: background 0.2s ease;
}

.fiscal-table tbody tr:hover {
    background: var(--gray-50);
}

.fiscal-table tbody tr:last-child {
    border-bottom: none;
}

.fiscal-table td {
    padding: 1rem;
    color: var(--gray-700);
}

.fiscal-table .tramo-rango {
    font-weight: 600;
    color: var(--brand-700);
}

.fiscal-table .tramo-tasa {
    font-weight: 700;
    color: var(--brand-600);
    font-size: 1.1rem;
}

.creditos-fiscales {
    background: var(--brand-50);
    border-left: 4px solid var(--brand-500);
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-top: 2rem;
}

.creditos-fiscales h3 {
    color: var(--brand-700);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.creditos-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.credito-item {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.credito-label {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.credito-valor {
    color: var(--brand-700);
    font-size: 1.25rem;
    font-weight: 700;
}

.info-adicional {
    background: var(--gray-50);
    border-left: 4px solid var(--gray-400);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1.5rem;
}

.info-adicional h4 {
    color: var(--gray-700);
    font-size: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.info-adicional p {
    color: var(--gray-600);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ============================================================================
   FOOTER
   ============================================================================ */

.footer {
    background: var(--brand-700);
    color: var(--gray-300);
    padding: 2rem 0;
    margin-top: auto;
}

.footer-disclaimer {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}

.footer-copyright {
    text-align: center;
    font-size: 0.875rem;
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

.slide-in {
    animation: fadeIn 0.4s ease-out;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
    .navbar-content {
        flex-wrap: wrap;
        position: relative;
    }

    .navbar-brand {
        flex: 1;
    }

    .navbar-toggle {
        display: flex;
    }

    .navbar-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: 1rem 0;
        box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
        border-radius: 0.75rem;
        margin-top: 0.5rem;
        border: 1px solid rgba(255, 255, 255, 0.3);
    }

    .navbar-menu.active {
        display: flex;
        animation: slideDown 0.3s ease;
    }

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

    .navbar-link {
        text-align: center;
        padding: 1rem 1.5rem;
    }

    .navbar-link.active::after {
        display: none;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .page-subtitle {
        font-size: 0.875rem;
    }

    .btn-group-toggle {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .export-buttons {
        width: 100%;
    }

    .btn-export {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .navbar-logo {
        width: 140px;
        height: 40px;
    }

    .navbar-title {
        font-size: 1rem;
    }

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

    .btn-export {
        width: 100%;
    }
}
