/* Calculadora de Décimo Terceiro - Estilos */

.calc-13-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.calc-13-title {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 600;
    border-bottom: 3px solid #3498db;
    padding-bottom: 15px;
}

.calc-13-form {
    margin-bottom: 30px;
}

.calc-13-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .calc-13-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.calc-13-field {
    display: flex;
    flex-direction: column;
}

.calc-13-label {
    font-weight: 600;
    color: #34495e;
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.calc-13-required {
    color: #e74c3c;
    font-size: 18px;
    font-weight: bold;
}

/* Estilo melhorado para hints de campo */
.calc-13-field-hint {
    display: block;
    font-weight: normal;
    color: #666;
    font-size: 12px;
    margin-top: 4px;
    font-style: italic;
}

.calc-13-input-group {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    height: 48px;
}

.calc-13-input-group:focus-within {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.calc-13-input-prefix {
    padding: 0 1rem;
    background-color: #f8fafc;
    color: #4a5568;
    border-right: 1px solid #e2e8f0;
    font-size: 0.9375rem;
    font-weight: 500;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}

.calc-13-input,
.calc-13-select {
    flex: 1;
    padding: 0 1rem;
    border: none;
    background: transparent;
    font-size: 0.9375rem;
    color: #2d3748;
    min-width: 0;
    height: 100%;
    box-sizing: border-box;
}

/* Ensure number inputs match text inputs */
.calc-13-input[type="number"] {
    -moz-appearance: textfield;
}

.calc-13-input[type="number"]::-webkit-outer-spin-button,
.calc-13-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Ensure consistent height for all inputs */
.calc-13-input,
.calc-13-select,
.calc-13-input-prefix {
    line-height: 1.5;
    height: 44px;
}

/* Ensure consistent alignment of input content */
.calc-13-input {
    padding-top: 0;
    padding-bottom: 0;
}

/* Fix for number input in Firefox */
@-moz-document url-prefix() {
    .calc-13-input[type="number"] {
        padding-top: 0.25rem;
    }
}

.calc-13-input-group:not(:focus-within):hover {
    border-color: #cbd5e0;
}

/* Invalid state */
.calc-13-input:invalid:not(:focus) {
    border-color: #e53e3e;
}

/* Disabled state */
.calc-13-input:disabled,
.calc-13-input[readonly] {
    background-color: #f7fafc;
    cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .calc-13-input,
    .calc-13-input-prefix {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }
}

/* Desktop-specific adjustments */
@media (min-width: 769px) {
    /* Move the select input group down by 24px on desktop */
    .calc-13-field:has(> .calc-13-input-group > .calc-13-select) {
        margin-top: 24px;
    }
}

.calc-13-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

@media (max-width: 480px) {
    .calc-13-buttons {
        flex-direction: column;
    }
}

.calc-13-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 140px;
}

.calc-13-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

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

.calc-13-btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.calc-13-btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
}

.calc-13-btn-secondary {
    background: #ecf0f1;
    color: #2c3e50;
    border: 2px solid #bdc3c7;
}

.calc-13-btn-secondary:hover {
    background: #d5dbdb;
    border-color: #95a5a6;
}

.calc-13-loading {
    display: none;
}

.calc-13-btn.loading .calc-13-btn-text {
    display: none;
}

.calc-13-btn.loading .calc-13-loading {
    display: inline;
}

/* Resultados com layout melhorado conforme sugestões da IA */
.calc-13-results {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    padding: 0;
    margin-top: 30px;
    border: 1px solid #dee2e6;
    overflow: hidden;
}

/* Header do resultado principal - estilo verde como na imagem */
.calc-13-result-header {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calc-13-result-header-label {
    font-size: 18px;
    font-weight: 500;
}

.calc-13-result-header-value {
    font-size: 32px;
    font-weight: 700;
}

.calc-13-details {
    background: white;
    padding: 25px;
    margin: 0;
}

.calc-13-details-title {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
    text-align: left;
    border-bottom: 2px solid #bdc3c7;
    padding-bottom: 10px;
}

/* Grid de detalhes com 4 colunas como na imagem */
.calc-13-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

@media (max-width: 768px) {
    .calc-13-details-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .calc-13-details-grid {
        grid-template-columns: 1fr;
    }
}

.calc-13-detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.calc-13-detail-label {
    font-weight: 500;
    color: #6c757d;
    font-size: 13px;
}

.calc-13-detail-value {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

/* Seção de descontos melhorada */
.calc-13-deductions {
    background: #fff5f5;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #fed7d7;
    margin-top: 20px;
}

.calc-13-deductions-title {
    color: #c53030;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid #e53e3e;
    padding-bottom: 8px;
}

.calc-13-deductions-grid {
    display: flex;
    gap: 20px;
    justify-content: space-between;
}

@media (max-width: 480px) {
    .calc-13-deductions-grid {
        flex-direction: column;
        gap: 10px;
    }
}

.calc-13-deduction-item {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border: 1px dashed #e53e3e;
}

.calc-13-deduction-label {
    font-weight: 600;
    color: #c53030;
    font-size: 14px;
}

.calc-13-deduction-value {
    font-weight: 700;
    color: #c53030;
    font-size: 14px;
}

.calc-13-info {
    background: #e6f3ff;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #3498db;
    margin: 20px 25px 0 25px;
}

.calc-13-info-text {
    color: #2c3e50;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Erro */
.calc-13-error {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    border-left: 4px solid #f44336;
}

.calc-13-error-text {
    color: #c62828;
    margin: 0;
    font-weight: 500;
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calc-13-results,
.calc-13-error {
    animation: fadeIn 0.5s ease-out;
}

/* Loading spinner */
.calc-13-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsividade adicional */
@media (max-width: 480px) {
    .calc-13-container {
        padding: 15px;
        margin: 10px;
    }
    
    .calc-13-title {
        font-size: 24px;
    }
    
    .calc-13-result-header-value {
        font-size: 24px;
    }
    
    .calc-13-detail-item,
    .calc-13-deduction-item {
        padding: 10px;
    }
}
