/* ========================================
   CALCULADORA RETENCIÓN - CSS COMPLETO
   ======================================== */

:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
}

/* ========================================
   LAYOUT BASE
   ======================================== */

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

.calculator-wrapper {
    width: 100%;
}

/* ========================================
   BREADCRUMB
   ======================================== */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.breadcrumb-link {
    color: var(--gray-600);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-link:hover {
    color: var(--primary);
}

.breadcrumb-separator {
    color: var(--gray-300);
}

.breadcrumb-current {
    color: var(--gray-900);
    font-weight: 500;
}

/* ========================================
   HEADER
   ======================================== */

.calculator-header {
    text-align: center;
    margin-bottom: 40px;
}

.calculator-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.title-icon {
    font-size: 2.2rem;
}

.calculator-description {
    font-size: 1.1rem;
    color: var(--gray-600);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ========================================
   INFO BANNER
   ======================================== */

.info-banner-main {
    display: flex;
    gap: 15px;
    padding: 20px 25px;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-radius: 16px;
    margin-bottom: 35px;
    border-left: 4px solid var(--info);
}

.banner-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.banner-content strong {
    display: block;
    font-size: 1.1rem;
    color: var(--gray-900);
    margin-bottom: 5px;
}

.banner-content p {
    color: var(--gray-700);
    margin: 0;
    font-size: 0.95rem;
}

/* ========================================
   CALCULATOR LAYOUT - MÁS COMPACTO
   ======================================== */

.calculator-layout {
    display: grid;
    grid-template-columns: 500px 1fr;
    gap: 30px;
    margin-bottom: 60px;
    align-items: start;
}

/* ========================================
   FORM SECTION
   ======================================== */

.form-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
    margin-bottom: 20px;
}

.form-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-icon {
    font-size: 1.4rem;
}

.form-description {
    font-size: 0.95rem;
    color: var(--gray-600);
    margin-bottom: 20px;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.95rem;
}

.label-text {
    flex: 1;
}

.label-icon {
    font-size: 1.1rem;
    opacity: 0.7;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    padding-left: 35px;
    font-size: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    transition: all 0.3s;
    font-family: inherit;
    color: var(--gray-900);
    font-weight: 500;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-prefix {
    position: absolute;
    left: 16px;
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.95rem;
    pointer-events: none;
}

.form-help {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--gray-600);
}

/* ========================================
   DEDUCTION ITEMS
   ======================================== */

.deduction-item {
    padding: 18px;
    background: var(--gray-50);
    border-radius: 12px;
    margin-bottom: 14px;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.deduction-item:hover {
    border-color: var(--primary);
    background: white;
}

/* Custom Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    position: relative;
}

.checkbox-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid var(--gray-300);
    border-radius: 6px;
    background: white;
    transition: all 0.3s;
    flex-shrink: 0;
    position: relative;
}

.checkbox-container input:checked ~ .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkmark::after {
    content: '✓';
    position: absolute;
    display: none;
    color: white;
    font-weight: bold;
    font-size: 14px;
    left: 4px;
    top: 0px;
}

.checkbox-container input:checked ~ .checkmark::after {
    display: block;
}

.checkbox-label {
    flex: 1;
}

.checkbox-label strong {
    font-size: 0.95rem;
}

.badge-info {
    display: inline-block;
    padding: 3px 8px;
    background: var(--success);
    color: white;
    font-size: 0.7rem;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: 600;
}

.deduction-help {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin: 8px 0 0 34px;
}

/* Nested Fields */
.nested-fields {
    margin-top: 14px;
    padding-left: 34px;
}

.form-group-small {
    margin-bottom: 0;
}

.form-label-small {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
    display: block;
}

.form-input-small {
    width: 100%;
    padding: 10px 14px;
    padding-left: 35px;
    font-size: 0.95rem;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    transition: all 0.3s;
}

.form-input-small:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ========================================
   BUTTONS
   ======================================== */

.btn-calculate {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    margin-bottom: 12px;
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-arrow {
    font-size: 1.3rem;
    transition: transform 0.3s;
}

.btn-calculate:hover .btn-arrow {
    transform: translateX(5px);
}

.btn-reset {
    width: 100%;
    padding: 12px 24px;
    background: white;
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-reset:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

/* ========================================
   RESULTS SECTION
   ======================================== */

.results-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
}

.results-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-icon {
    font-size: 1.4rem;
}

.result-main {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 16px;
    margin-bottom: 25px;
    color: white;
}

.result-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 10px;
}

.result-value {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.result-note {
    font-size: 0.9rem;
    opacity: 0.85;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.result-item {
    background: var(--gray-50);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    gap: 12px;
    border: 1px solid var(--gray-200);
}

.result-item-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.result-item-content {
    flex: 1;
}

.result-item-label {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.result-item-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
}

.recommendation {
    background: #dbeafe;
    border-left: 4px solid var(--info);
    border-radius: 8px;
    padding: 18px;
}

.recommendation h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 10px;
}

.recommendation p {
    color: var(--gray-700);
    line-height: 1.6;
    margin: 0;
    font-size: 0.95rem;
}

/* Empty State */
.empty-state {
    background: white;
    border-radius: 20px;
    padding: 50px 30px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 2px dashed var(--gray-200);
}

.empty-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 10px;
}

.empty-text {
    color: var(--gray-600);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ========================================
   CONTENT SECTIONS
   ======================================== */

.content-section {
    margin-bottom: 50px;
}

.content-section h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 20px;
}

.content-section p {
    color: var(--gray-600);
    line-height: 1.8;
    font-size: 1rem;
    margin-bottom: 18px;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.info-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-200);
}

.info-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.info-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.info-card p {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin: 0;
    line-height: 1.5;
}

/* Tax Table */
.table-responsive {
    overflow-x: auto;
    margin: 25px 0;
}

.tax-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.tax-table thead {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.tax-table th {
    padding: 15px;
    text-align: left;
    font-weight: 700;
}

.tax-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--gray-200);
}

.tax-table tbody tr:hover {
    background: var(--gray-50);
}

/* Related Grid */
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.related-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-200);
    transition: all 0.3s;
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.related-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
}

.related-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.related-card p {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin: 0;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
    .calculator-layout {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .calculator-title {
        font-size: 1.8rem;
    }
    
    .info-grid,
    .results-grid,
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .nested-fields {
        padding-left: 0;
    }
    
    .deduction-help {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .page-container {
        padding: 20px 15px 60px;
    }
    
    .result-value {
        font-size: 2.2rem;
    }
}